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

CI: Reduce pip behaviour dependencies in test suite #2105

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.t.err

# Python cruft
__pycache__
*.pyc

# Virtualenvs
Expand Down
13 changes: 13 additions & 0 deletions tests/test_cli_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3428,9 +3428,21 @@ def test_compile_recursive_extras_build_targets(runner, tmp_path, current_resolv
[project.optional-dependencies]
footest = ["small-fake-b"]
dev = ["foo[footest]"]
[build-system]
requires = ["setuptools == 70.0.0"]
build-backend = "setuptools.build_meta"
"""
)
)
version_constraints = [
"setuptools<70.1.0",
"wheel<0.43",
]
constraints_file = tmp_path / "constraints.txt"
constraints_file.write_text("\n".join(version_constraints))
env = os.environ.copy() # Copy entire env to avoid Windows compatibility issues
# Work around https://github.com/jazzband/pip-tools/pull/1681/files#r1667748889
env["PIP_CONSTRAINT"] = str(constraints_file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this was to be made conditional? Perhaps, the test could be parametrized with variants before and after certain pip version that would run in different jobs (through the skipif mark). It'd be able to cover the concern of breaking on older versions…

out = runner.invoke(
cli,
[
Expand All @@ -3448,6 +3460,7 @@ def test_compile_recursive_extras_build_targets(runner, tmp_path, current_resolv
"--output-file",
"-",
],
env=env,
)
expected = rf"""foo[footest] @ {tmp_path.as_uri()}
small-fake-a==0.2
Expand Down
3 changes: 0 additions & 3 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ def test_diff_should_not_uninstall(fake_dist):
"pip-tools==1.1.1",
"pip-review==1.1.1",
"pkg-resources==0.0.0",
"setuptools==34.0.0",
"wheel==0.29.0",
"python==3.0",
"distribute==0.1",
"wsgiref==0.1",
"argparse==0.1",
)
Expand Down
Loading