Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: fix pyproject-only test (ensure build-time dependencies are installed) #80

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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