python and PEP 440 - how serious is this warning about PEP440?

11,786

Solution 1

As an end user, this shouldn't be a serious concern for you, it just means that, since the version number specified doesn't agree with the rules for python package versions, that the python packaging system cannot reliably discern which other versions of this package are before or after it.

In particular, its not specified if 2014.2.2.dev5.g... should come before or after 2014.2.2.dev5, since the rules don't say anything about what g is supposed to mean.

this is not likely to affect you too much; since either are going to be dev releases; and both strictly are between 2014.2.1 and 2014.2.2

Solution 2

Each Python package can specify its own version. Among other things, PEP440 says that a version specification should be stored in the __version__ attribute of the module, that it should be a string, and that should consist of major version number, minor version number and build number separated by dots (e.g. '2.7.8') give or take a couple of other optional variations. In one of the packages you are installing, the developers appear to have broken these recommendations by using the suffix '.gb329598'. The warning says that this may confuse certain package managers (setuptools and friends) in some circumstances.

It seems PEP440 does allow arbitrary "local version labels" to be appended to a version specifier, but these must be affixed with a '+', not a '.'.

Share:
11,786
Mark
Author by

Mark

Updated on June 16, 2022

Comments

  • Mark
    Mark almost 2 years

    I had to install OpenStack using devstack infrastructure for experiements with open vSwitch, and found this in the logs:

    /usr/lib/python2.7/site-packages/setuptools/dist.py:298: UserWarning: The version specified ('2014.2.2.dev5.gb329598') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
    

    I googled and found that PEP stands for Python Enhancement Proposal and PEP 440 is obviously a particular proposal, but I wonder how serious this warning is and what is PEP 440 defining?

  • j0057
    j0057 over 9 years
    Re: "the developers appear to have broken these recommendations" -- in fact, the recommendations were amended such that the developers are now breaking them.
  • Phil Cooper
    Phil Cooper over 9 years
    RE "build number". you correctly say that there are optional variants but the N(.N)* portion is called the release segment and they suggest ("major.minor.micro"). build number is about the building and packaging, not-so-much about versioning. Could build number look like micro and be called local versioning info....dunno but I think build should not be conflated with version.
  • uday
    uday about 2 years
    Any option to not show this warning?
  • uday
    uday about 2 years
    Any option to not show this warning?
  • uday
    uday about 2 years
    Any option to not show this warning?