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

pip installs latest version in python2.7 environment #292

Closed
Andrey-mp opened this issue Mar 26, 2020 · 6 comments
Closed

pip installs latest version in python2.7 environment #292

Andrey-mp opened this issue Mar 26, 2020 · 6 comments
Labels

Comments

@Andrey-mp
Copy link
Contributor

Andrey-mp commented Mar 26, 2020

Issue description

pip2 installs stestr of version 3.0.0 in python2.7 env. It happens cause pypi doesn't have metadata tag 'data-requires-python'. This happens cause setup.cfg has key 'requires-python' instead of 'python-requires'

Expected behavior and actual behavior
expected: version <3.0.0 will be install by pip2.
actual: version 3.0.0 is installed by pip2

Steps to reproduce the problem
Run docker's image centos:7 and after installing pip try to install stestr by pip.

Specifications like the version of the project, operating system, or hardware

System information

  • OS: centos:7
  • stestr version (stestr --version): 3.0.0
  • Python release (python --version): 2.7
  • pip packages (pip freeze): doesn't matter

Additional information

@Andrey-mp Andrey-mp added the bug label Mar 26, 2020
@Andrey-mp
Copy link
Contributor Author

Andrey-mp commented Mar 26, 2020

#293

@mtreinish
Copy link
Owner

mtreinish commented Mar 26, 2020

We were discussing this issue earlier today on openstack-qa in IRC: http://eavesdrop.openstack.org/irclogs/%23openstack-qa/%23openstack-qa.2020-03-26.log.html#t2020-03-26T19:40:06

Based on this discussion it appears that the issue with python 2.7 is caused by a temporary pypi issue. Apparently pbr supports python requires-python and python-requires`. If this is not the case and we do need to update the package metadata (per #293) then I will push that out as 3.0.1 and you can just blacklist 3.0.0 in your py 2.7 package's requirements.

@gmannos
Copy link

gmannos commented Mar 27, 2020

'python-requires' support in there for sure in pbr - https://github.com/openstack/pbr/blob/9257b6843568052be1dc1a5f3df6f629795e08b2/pbr/util.py#L116

'python-requires' is introduced from PEP440 version and until PEP345 it used to support 'requires-python also 'https://www.python.org/dev/peps/pep-0345/#requires-python

I am not finding enough evidence that 'requires-python' is still supported or it is being removed. still checking....

@Andrey-mp
Copy link
Contributor Author

Andrey-mp commented Mar 27, 2020

The tricky thing is that pypi really doesn't return that metadata.
Also I've checked latest pip in new centos:7 container. It installs version 3.0.0

@mtreinish
Copy link
Owner

mtreinish commented Mar 30, 2020

3.0.1 has been pushed out with #293 applied

@Andrey-mp
Copy link
Contributor Author

Andrey-mp commented Mar 30, 2020

Thank you!

openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Mar 30, 2020
stestr 3.0.0 is released with drop the support of
py2 but had some issue on setup.cfg metadata to restrict
the installation on <py3 env.
- mtreinish/stestr#292

This is fixed and released in 3.0.1

Let's cap the stestr version for py2 and py3 env
also adding 3.0.0 in blacklist.

Change-Id: Id0c2371c9ba37a3f19c2e0a3c121f99b54ac9ce8
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Mar 30, 2020
* Update requirements from branch 'master'
  - Merge "Fix on stestr requirements for non-py2"
  - Fix on stestr requirements for non-py2
    
    stestr 3.0.0 is released with drop the support of
    py2 but had some issue on setup.cfg metadata to restrict
    the installation on <py3 env.
    - mtreinish/stestr#292
    
    This is fixed and released in 3.0.1
    
    Let's cap the stestr version for py2 and py3 env
    also adding 3.0.0 in blacklist.
    
    Change-Id: Id0c2371c9ba37a3f19c2e0a3c121f99b54ac9ce8
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Aug 6, 2020
* Update pbr from branch 'master'
  - Merge "Update python requires packaging metadata for package"
  - Update python requires packaging metadata for package
    
    The metadata field, 'python-requires' was introduced in PEP440 and
    appears to have superseded 'requires-python'. [1] The metadata that pbr
    uses for itself and it's test package was using the old incorrect field,
    this commit updates it to be the proper metadata to show a working
    example. To a certain extent it probably doesn't matter because it's very
    unlikely someone will try to install pbr with python 2.5, but it's more
    about making sure that pbr itself is leading by example and that it's own
    config actually works.
    
    [1] mtreinish/stestr#292
    
    Change-Id: I5eb14d490a3731b6b95d7a1137c33ec2d73f193f
openstack-mirroring pushed a commit to openstack/pbr that referenced this issue Aug 6, 2020
The metadata field, 'python-requires' was introduced in PEP440 and
appears to have superseded 'requires-python'. [1] The metadata that pbr
uses for itself and it's test package was using the old incorrect field,
this commit updates it to be the proper metadata to show a working
example. To a certain extent it probably doesn't matter because it's very
unlikely someone will try to install pbr with python 2.5, but it's more
about making sure that pbr itself is leading by example and that it's own
config actually works.

[1] mtreinish/stestr#292

Change-Id: I5eb14d490a3731b6b95d7a1137c33ec2d73f193f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants