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
pip-compile breaks with Pip 22.1.1 - AttributeError: 'RequirementSet' object has no attribute 'add_requirement'. #1623
Comments
More of a general question, but this is the second Pip update in 9 days that has rendered pip-tools unusable. Is it a bad idea to be always updating Pip to the latest release? |
IMO it's not pip-tool's fault. pip didn't follow semantic versioning convention when a) it removed a method (=backwards incompatible change) and b) it didn't upgrade the major version. Under these circumstances the only reliable way to go is to pin to an exact pip version (which is not a good idea anyway). |
Sorry if I came across as blaming pip-tools for this, I recognize that the pip project is the one that made an incompatible change in both these instances. However, I haven't found great guidance on how to avoid things like this. Even if pip upgraded the major version for this change, the pip-tools README states that pip-tools 6.5+ is compatible with all versions of pip greater than or equal to 21.2. So based on this information, it would be reasonable to expect pip-tools to work with this new pip version, even it has a bigger version number than it actually did. |
I feel like between this and #1617, there needs to be a fundamental change in how Some ideas:
For users, there are also alternative locking solutions that don't depend on |
Maybe vendoring the important parts of |
Would it work to run CI with |
We have the daily job for testing pip-tools against pip's main branch. We only need volunteers who can track and address failed jobs shortly. |
Still experiencing this exception. pip-tools 6.6.2 and pip 22.1.1 installed. Python 3.9.12. But pip-compile --version shows version 6.6.1. The change in https://github.com/jazzband/pip-tools/pull/1624/files is not in my installed copy. Manually adding that change gets pip-compile working. Is pip-compile 6.6.1 supposed to be in the 6.6.2 distribution of the pip-tools package? Is that fix in pull 1624 supposed to be in pip-tools 6.6.2? |
verify if you run pip-compile from proper environment. |
@Czaki Very nice catch. I looked in the paths in exception and it was executing pip-compile from a global installation instead of the active virtualenv. The virtual env had 6.6.2 but the global was 6.6.1. Thanks for pointing me in the right direction to find the root problem. |
I just made pip-and-pip-tools, for use in my own CI dependencies. |
This commit upgrades the version of pip-tools used in this repository from 6.6.1 to 6.6.2. In version 6.6.1 of pip-tools, there is a bug that is preventing pip-tools from working. This is breaking the Python requirements update GitHub action in this repository. The error is "AttributeError: 'RequirementSet' object has no attribute 'add_requirement'". The error was reported here: jazzband/pip-tools#1623. The fix to this bug was released in version 6.6.2 of pip-tools. See the pull request here: jazzband/pip-tools#1624.
This just cropped up in a slightly different way today, on pip-compile 6.12.3 and pip 23.1.2
Not sure what to do other than to downgrade both. |
Running pip-compile will break when using the latest Pip release, 22.1.1.
This commit appears to be the cause of the break.
Environment Versions
Python 3.10.4
pip 22.1.1 from %MyProject%\venv\lib\site-packages\pip (python 3.10)
pip-compile, version 6.6.1
Steps to replicate
Expected result
pip-compile produces a requirements.txt file without error
Actual result
No requirements.txt file is produced. This callstack is shown
The text was updated successfully, but these errors were encountered: