Skip to content

Commit

Permalink
TST: fix pyproject-only test (ensure build-time dependencies are inst…
Browse files Browse the repository at this point in the history
…alled)
  • Loading branch information
neutrinoceros committed Dec 13, 2023
1 parent 0bff37c commit 9283a42
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions extension_helpers/tests/test_setup_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def test():
"""
)

buildtime_requirements = ["setuptools>=43.0.0", "wheel", "Cython"]
test_pkg.join("pyproject.toml").write(
dedent(
f"""\
Expand All @@ -389,9 +390,7 @@ def test():
find = {{namespaces = false}}
[build-system]
requires = ["setuptools>=43.0.0",
"wheel",
"cython"]
requires = [{', '.join(f'"{_}"' for _ in buildtime_requirements)}]
build-backend = 'setuptools.build_meta'
"""
Expand All @@ -404,17 +403,28 @@ def test():
with test_pkg.as_cwd():
# NOTE: we disable build isolation as we need to pick up the current
# developer version of extension-helpers
subprocess.call(
[
sys.executable,
"-m",
"pip",
"install",
".",
"--no-build-isolation",
f"--target={install_temp}",
]
)
# In order to do so, we need to ensure that build-time dependencies are
# installed first
cmd1 = [
sys.executable,
"-m",
"pip",
"install",
*buildtime_requirements,
f"--target={install_temp}",
]
subprocess.call(cmd1)

cmd2 = [
sys.executable,
"-m",
"pip",
"install",
".",
"--no-build-isolation",
f"--target={install_temp}",
]
subprocess.call(cmd2)

if "" in sys.path:
sys.path.remove("")
Expand Down

0 comments on commit 9283a42

Please sign in to comment.