Skip to content
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

Installation from path or url cannot be constrained to a version #6310

Open
danpawlik opened this issue Mar 1, 2019 · 6 comments
Open

Installation from path or url cannot be constrained to a version #6310

danpawlik opened this issue Mar 1, 2019 · 6 comments
Labels
type: support User Support

Comments

@danpawlik
Copy link

danpawlik commented Mar 1, 2019

Environment

  • pip version: 19.0.3
  • Python version: 3.6
  • OS: Ubuntu 18.04

Hi,
Im working for company that is doing own software.
One software require to install keystonemiddleware package. We don't want to install it from pip repository, but using a git.

How to reproduce:

virtualenv -p python3 --no-wheel /opt/openstack/test
/opt/openstack/test/bin/pip install -c "https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens" "https://github.com/openstack/keystonemiddleware.git@stable/queens#egg=keystonemiddleware"

It raises an error:

< SOME NOT IMPORTANT/REQUIRED PACKAGES >
Ignoring scandir: markers 'python_version == "2.7"' don't match your environment
Ignoring futures: markers 'python_version == "2.7"' don't match your environment
Ignoring happybase: markers 'python_version == "2.7"' don't match your environment
Ignoring sortedcontainers: markers 'python_version == "3.4"' don't match your environment
Ignoring sortedcontainers: markers 'python_version == "3.5"' don't match your environment
', err: 'Could not satisfy constraints for 'keystonemiddleware': installation from path or url cannot be constrained to a version

Where packages like: scandir, futures, happybase, sortedcontainers are not required for keystonemiddleware.

@pfmoore
Copy link
Member

pfmoore commented Mar 1, 2019

This is expected behaviour. A URL or file requirement references a specific set of source code, and so it makes no sense to supply a version specification as well.

@sdatko
Copy link

sdatko commented Mar 1, 2019

This bothers me as well. In my case I would like to keep constrains for the remaining dependencies. Wound't it be more appropriate to just skip version checking for that single package specified via URL (but not it's dependencies), possibly with warning instead? Or at least provide an option for ignoring that error.

Moreover, for projects kept in git we often have the possibility to determine version string, when it is set in setup.cfg or determined from versioning git tags (pbr), so it would be technically possible to check them against constraints.

@uranusjr
Copy link
Member

uranusjr commented Mar 11, 2019

Related: #5898. Also see the discussion on distutils-sig (linked mid-thread in the issue).

@pradyunsg pradyunsg added the type: support User Support label Mar 12, 2019
@pradyunsg
Copy link
Member

Also, relevant comment: #5898 (comment)

@danpawlik
Copy link
Author

danpawlik commented May 7, 2019

Workaround for that problem:

  • git clone my-project
  • pip install -c upper-constraints.txt ./my-project

Pip doesn't check the version of local git project. Awesome

@Natim
Copy link

Natim commented Dec 9, 2019

Ok you should remove it from the constraint file. But I guess a -e in the constraint file that is the exact same value as the requirements.txt should not complain about it being constrained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support User Support
Projects
None yet
Development

No branches or pull requests

6 participants