-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[2020-resolver] Fails if two versions with ; python_version
in constraints for the same package
#8724
Comments
Does this happen if it’s a requirements file ( |
@uranusjr no, it works perfectly with |
To make sure my environment doesn't interfere with anything, I created a Docker setup to test this.
#!/bin/bash
cat >/constraints.txt <<EOF
Django==3.0.9 ; python_version >= "3.6"
Django==2.2.15 ; python_version < "3.6"
EOF
cd /opt/python
for PYTHON in *; do
echo
echo $PYTHON
$PYTHON/bin/python -m venv /venv-$PYTHON
. /venv-$PYTHON/bin/activate
pip install -q -U pip
pip install -q -U "pip @ https://github.com/pypa/pip/archive/master.zip"
pip install --use-feature 2020-resolver --constraint /constraints.txt Django
done Then run it in a manylinux container with Docker or Podman:
For me this outputs:
|
Thanks! I think I have an idea what’s going on; we’re likely not excluding lines based on the markers when we process the constraints file. |
162: Update pip to 20.2.2 r=duckinator a=pyup-bot This PR updates [pip](https://pypi.org/project/pip) from **20.2.1** to **20.2.2**. <details> <summary>Changelog</summary> ### 20.2.2 ``` =================== Bug Fixes --------- - Only attempt to use the keyring once and if it fails, don't try again. This prevents spamming users with several keyring unlock prompts when they cannot unlock or don't want to do so. (`8090 <https://github.com/pypa/pip/issues/8090>`_) - Fix regression that distributions in system site-packages are not correctly found when a virtual environment is configured with ``system-site-packages`` on. (`8695 <https://github.com/pypa/pip/issues/8695>`_) - Disable caching for range requests, which causes corrupted wheels when pip tries to obtain metadata using the feature ``fast-deps``. (`8701 <https://github.com/pypa/pip/issues/8701>`_, `8716 <https://github.com/pypa/pip/issues/8716>`_) - Always use UTF-8 to read ``pyvenv.cfg`` to match the built-in ``venv``. (`8717 <https://github.com/pypa/pip/issues/8717>`_) - 2020 Resolver: Correctly handle marker evaluation in constraints and exclude them if their markers do not match the current environment. (`8724 <https://github.com/pypa/pip/issues/8724>`_) ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pip - Changelog: https://pyup.io/changelogs/pip/ - Homepage: https://pip.pypa.io/ </details> Co-authored-by: pyup-bot <github-bot@pyup.io>
What did you want to do?
I want to install a different version of a package depending on the Python version.
constraints.txt
:Output
Additional information
Tried with
The text was updated successfully, but these errors were encountered: