Skip to content

Commit

Permalink
another test
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jan 7, 2024
1 parent 1d4c02e commit 14502f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion piptools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def build_project_metadata(

if attempt_static_parse:
if build_targets:
raise AssertionError(
raise ValueError(
"Cannot execute the PEP 517 optional get_requires_for_build* "
"hooks statically"
)
Expand Down
10 changes: 10 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ def test_build_project_metadata_static(tmp_path):
("fake_direct_runtime_dep", set(), "None"),
]
assert metadata.extras == ("x",)


def test_build_project_metadata_raises_error(tmp_path):
src_pkg_path = pathlib.Path(PACKAGES_PATH) / "small_fake_with_build_deps"
shutil.copytree(src_pkg_path, tmp_path, dirs_exist_ok=True)
src_file = tmp_path / "setup.py"
with pytest.raises(ValueError, match="Cannot execute the PEP 517 optional.* hooks statically"):
build_project_metadata(
src_file, ("editable",), attempt_static_parse=True, isolated=True, quiet=False
)

0 comments on commit 14502f4

Please sign in to comment.