@@ -164,13 +164,11 @@ def test_install_pep660_from_reqs_file(
164
164
), "a .egg-link file should not have been created"
165
165
166
166
167
- def test_install_no_pep660_setup_py_fallback (
168
- tmpdir : Path , script : PipTestEnvironment
169
- ) -> None :
167
+ def test_install_no_pep660 (tmpdir : Path , script : PipTestEnvironment ) -> None :
170
168
"""
171
- Test that we fall back to setuptools develop when using a backend that
172
- does not support build_editable. Since there is a pyproject.toml,
173
- the prepare_metadata_for_build_wheel hook is called.
169
+ Test the error message when the build backend does not support PEP 660.
170
+ Since there is a pyproject.toml, the prepare_metadata_for_build_wheel hook
171
+ is called.
174
172
"""
175
173
project_dir = _make_project (tmpdir , BACKEND_WITHOUT_PEP660 , with_setup_py = True )
176
174
result = script .pip (
@@ -179,38 +177,14 @@ def test_install_no_pep660_setup_py_fallback(
179
177
"--no-build-isolation" ,
180
178
"--editable" ,
181
179
project_dir ,
182
- allow_stderr_warning = False ,
180
+ allow_error = True ,
183
181
)
182
+ assert result .returncode != 0
184
183
_assert_hook_called (project_dir , "prepare_metadata_for_build_wheel" )
185
184
assert (
186
- result .test_env .site_packages .joinpath ("project.egg-link" )
187
- in result .files_created
188
- ), "a .egg-link file should have been created"
189
-
190
-
191
- def test_install_no_pep660_setup_cfg_fallback (
192
- tmpdir : Path , script : PipTestEnvironment
193
- ) -> None :
194
- """
195
- Test that we fall back to setuptools develop when using a backend that
196
- does not support build_editable. Since there is a pyproject.toml,
197
- the prepare_metadata_for_build_wheel hook is called.
198
- """
199
- project_dir = _make_project (tmpdir , BACKEND_WITHOUT_PEP660 , with_setup_py = False )
200
- result = script .pip (
201
- "install" ,
202
- "--no-index" ,
203
- "--no-build-isolation" ,
204
- "--editable" ,
205
- project_dir ,
206
- allow_stderr_warning = False ,
185
+ "Cannot build editable project because "
186
+ "the build backend does not have the build_editable hook" in result .stderr
207
187
)
208
- print (result .stdout , result .stderr )
209
- _assert_hook_called (project_dir , "prepare_metadata_for_build_wheel" )
210
- assert (
211
- result .test_env .site_packages .joinpath ("project.egg-link" )
212
- in result .files_created
213
- ), ".egg-link file should have been created"
214
188
215
189
216
190
def test_wheel_editable_pep660_basic (tmpdir : Path , script : PipTestEnvironment ) -> None :
0 commit comments