-
Notifications
You must be signed in to change notification settings - Fork 211
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
Issue with coverage[toml] when installing with require-hashes. #612
Comments
this issue in PIP is still open for 2.5 years with no solution in sight: |
I saw that this issue was fixed, reverted ... then upstreamchanges toml to tomli etc etc ... Why does pytest-cov even need toml from coverage? Why even use that extra? |
Yeah I guess we could stop depending on coverage with an extra :/ |
I upgraded pip with |
@ionelmc I don't think so. Pip's behavior is correct — if hash checking is requested by the end-user, it requires that the entire dependency tree has hashes recorded. It's the users' responsibility to provide said hashes. This has nothing to do with extras, just the transitive deps. |
@alinocco Yey ... latest pip 24.x works !!! @webknjaz Actually pip behavior with extras was broken forever (even ack bug in pip is still open), but it seems they actually patched it in 24.x. Basically it does not matter if you define extras or not ... dependency with extras will always have the same hashes:
User responsibility is to provide extra dependencies (tomli in this case) together with hashes. And expect pip to correctly resolve coverage in both cases (with extras flags) ... For coverage in this case it is the same set of whls and hashes in the end. Not to mention that coverage[toml] resolves to nothing for python 3.11 (https://github.com/nedbat/coveragepy/blob/master/setup.py#L102) You can check it, if you my requirements.txt from the issue and check that there was indeed a bug in pip:
It works with 24.1.2:
Now regarding toml extras ... if pytest-cov needs tomli itself to work it should include it itself ... if it does not ... it should be removed ... What if tomli is removed form coverage or switched to other implementation. Would pytest-cov be broken then? |
Summary
There is an issue when installing pytest-cov with require hashes mode.
We install from pip with all hahes provided on target machine. requirements.txt is generated via pipenv.
Expected vs actual result
It should install coverage and pytest-cov without an error. Now this happens everytime there is new coverage release and we are behind latest. It happens always after every new release of coverage, before we can update all the projects, breaking the deployment.
Instead of working we get:
Reproducer
Create standard pipenv file:
Now that I have requiremernts:
Versions
(.venv) ➜ testbug pip --version
pip 23.2.1 from /Users/myuser/temp/testbug/.venv/lib/python3.11/site-packages/pip (python 3.11)
(.venv) ➜ testbug python --version
Python 3.11.5
The text was updated successfully, but these errors were encountered: