-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
editable requirements are not allowed as constraints with the new backtracking resolver #1755
Comments
https://pip.pypa.io/en/stable/user_guide/#constraints-files New resolver has more strict syntax in constraints files and does not support editables there since pip-20.3. |
Is there any suggested workaround here to solve the goals of:
|
Ok but I mean ... constructively, the only difference from what I'm doing and the examples in the README for pip-tools is that I'm using editable installs - a super common thing to do. It seems I have to do something like pip-compile a file, then post-process it to remove any editable requirements so that I can use that file as constraints for the next pip-compile? pip-compile setup.in
grep -v '^-e file:' setup.txt > setup.constraints.txt
pip-compile src.in
grep -v '^-e file:' src.txt > src.constraints.txt
pip-compile dev.in With the following
Is there a better way? Based on the pip docs, I'm also screwed if I use things like extras, ignoring the editable installs. I would need to parse and rewrite the dependencies to remove extras. It indicates that this pattern itself is just "wrong" because they don't anticipate this type of cascading constraints idea. But again, this idea is in the pip-tools README so I just wonder if there is a plan on how to deal with this. I know I'm coming in hot/desperate but pip-tools is the closest thing I have to a "python workspace manager" and it's stressful keeping it working lol. |
I see there is also
|
A few options as a workaround I could think of:
|
At a very minimum, the README section Workflow for Layered Requirements needs to be updated with new advice (I'm not sure what the advice should be). Users following it who hit this error are going to have no idea what to do. |
I'm one of those users following the |
After some more research, specially after checking #1613, is now clear that the trick is always using |
Why don't you pass |
I guess it depends on the scenario. In my particular scenario I don't want to use |
Why are extras not relevant in the output file? If I'm running into this same issue, and trying to figure out how to deal with it. |
Let's assume in |
Sounds like you should be waiting for PEP 735 to land. What you describe is essentially "dependency groups". And I totally understand the importance.
Because what you pass to |
I'm using a pattern of 3 requirement files:
base.txt
)Setup includes a local package that is used by later src packages as a custom setuptools build class.
Since things are ordered, we use the pins from the previous file as constraints for the next file to ensure that all the files are pinned to the same versions. Thus:
With the pip-tools workflow we then update each
.txt
file in order:This workflow only fails when using
--resolver=backtracking
.Tested with pip-tools 6.11.0.
The text was updated successfully, but these errors were encountered: