-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Fix compile cached vcs packages #1649
Fix compile cached vcs packages #1649
Conversation
for more information, see https://pre-commit.ci
# from ``ireq.link`` when the link is found in the wheel cache. | ||
# ``ireq.link`` would point to the wheel cache, while this points | ||
# to the found remote link (e.g. from pypi.org). | ||
link=candidate.source_link, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad your copy_install_requirement
extensibility made this easy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very handy indeed!
tests/test_cli_compile.py
Outdated
# Install and cache VCS package | ||
# TODO: install package in isolated environment | ||
subprocess.run( | ||
[ | ||
sys.executable, | ||
"-m" "pip", | ||
"install", | ||
vcs_package, | ||
], | ||
check=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my machine, this doesn't cause a wheel for six to be cached in ~/.cache/pip/wheels
. I did a quick sanity check with [sys.executable, "-m", "pip", "cache", "dir"]
here to confirm that ~/.cache/pip/wheels
is the relevant cache on my machine when running under tox -e py310-piplatest-coverage
.
I had a similar issue when writing the MWE script in #1647. Pip would not cache the wheel unless I installed another version of the VCS package first.
Doing that doesn't seem to fix the issue here though. On my machine, replacing typeguard @ ...
with six @ git+https:/benjaminp/six@65486e4383f9f411da95937451205d3c7b61b9e1
in my MWE script doesn't actually cause the issue to occur—for some reason I can't get Pip to cache a wheel for this version of six.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested changes atugushev/pip-tools@fix-compile-cached-vcs-1647...gschaffner:pip-tools:fix-compile-cached-vcs-1647.
bb2e91edbd3d0f1bdd86c41e84c88621f8d35690 is failing—I can't find a way to get Pip to cache six-1.16.0-py2.py3*.whl
. I am not sure why1, but the easiest fix is probably to change to another package that supports 3.7–3.10, has no dependencies for this range of Pythons, and that Pip will cache a wheel for, e.g. Plumbum 1.7.2. As far as I can tell, there isn't another candidate for this that's already used in pip-tools's suite elsewhere (the list of git+
's used elsewhere seems to be pip-tools, django, pip, and billiard).
1: My guess is that this is because six does not use setuptools_scm
, but I haven't looked into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test works on CI. As you can see it fails without the fix:
AssertionError: assert 'six @ git+ht...05d3c7b61b9e1' == 'six @ file:/...-none-any.whl' - six @ file:///Users/albert/Library/Caches/pip/wheels/b4/42/6d/bab90ef8caaba6e66b7c1b7e35d83fbe1b67ae9a1101839ff2/six-1.16.0-py2.py3-none-any.whl + six @ git+https:/benjaminp/six@65486e4383f9f411da95937451205d3c7b61b9e1
I think that should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gschaffner what would you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay!
Without the fix, the test mistakenly passes on my laptop when run as
$ git checkout 53f36d88bbaaad3ece3e964b015015690c6792e9 # or 835b7e58c4fb929e114d88fce7e1f911aef2c4cd
$ rm -r ~/.cache/pip/wheels
$ tox -e py310-piplatest-coverage -- --no-cov tests/test_cli_compile.py::test_compile_cached_vcs_package # or tox -e py310-piplatest-coverage
Can you replicate? It seems like the test is not putting six into the cache.
(My initial guess was that the test was failing (as it should) on GHA because six was already in the wheels cache loaded by
This doesn't seem to be the case however—see that there is no wheel for six loaded in https:/jazzband/pip-tools/runs/7439890847?check_suite_focus=true#step:7:223.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but isn't it all fine if you just replace six with any other package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my first thought. However, while the test works on CI, it can mistakenly pass in a different setup. This makes me think that the test is flaky and must be reworked in a way as suggested here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks, yeah I'm on board to get the fix out ahead of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking issue #1686.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndydeCleyre okay, all set.
53f36d8
to
57012f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gschaffner thanks! Feel free to. |
Fixes #1647
Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.