Skip to content

Versioneer reported version of dev build is incorrect #15156

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

Closed
jcrist opened this issue Jan 18, 2017 · 5 comments
Closed

Versioneer reported version of dev build is incorrect #15156

jcrist opened this issue Jan 18, 2017 · 5 comments
Labels
Bug Build Library building on various platforms

Comments

@jcrist
Copy link
Contributor

jcrist commented Jan 18, 2017

Sometimes it's nice to install projects from master to get recent fixes (e.g. pip install git+https://github.com/pandas-dev/pandas.git). However, since pandas switched to using dev branches for 0.19.1+, versioneer incorrectly reports the version of the dev build as 0.19.0. This breaks checks for version, e.g. the following would report false for a build off master, when semantically master is after the 0.19.2 release:

from distutils.version import LooseVersion
import pandas as pd

LooseVersion(pd.__version__) > '0.19.2'

I'm not sure if there is an easy/good fix for this, just opening this to discuss.

@jorisvandenbossche
Copy link
Member

@jcrist When installed with pip from github directly, does it give you 0.19.0 or 0.19.0-n-hash?

@jcrist
Copy link
Contributor Author

jcrist commented Jan 18, 2017

0.19.0+n-hash. Same as building it from source normally:

(pandas) jcrist ~ $ pip install git+https://github.com/pandas-dev/pandas.git
Collecting git+https://github.com/pandas-dev/pandas.git
  Cloning https://github.com/pandas-dev/pandas.git to /var/folders/vl/xj_l5ml95sbfm7x480g60x440000gp/T/pip-jRkfFH-build
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./anaconda/envs/pandas/lib/python2.7/site-packages/python_dateutil-2.5.3-py2.7.egg (from pandas==0.19.0+343.g8e13da2)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in ./anaconda/envs/pandas/lib/python2.7/site-packages/pytz-2016.6.1-py2.7.egg (from pandas==0.19.0+343.g8e13da2)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in ./anaconda/envs/pandas/lib/python2.7/site-packages (from pandas==0.19.0+343.g8e13da2)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./anaconda/envs/pandas/lib/python2.7/site-packages/six-1.10.0-py2.7.egg (from python-dateutil->pandas==0.19.0+343.g8e13da2)
Installing collected packages: pandas
  Running setup.py install for pandas ... done
Successfully installed pandas-0.19.0+343.g8e13da2
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(pandas) jcrist ~ $ python -c "import pandas;print(pandas.__version__)"
0.19.0+343.g8e13da2

Versioneer just grabs the version from git describe --tags --dirty --always --long:

(pandas) jcrist pandas $ git describe --tags --dirty --always --long
v0.19.0-343-g8e13da2

@sinhrks sinhrks added Build Library building on various platforms Bug labels Jan 19, 2017
@jreback
Copy link
Contributor

jreback commented Jan 19, 2017

we don't have a concept of minor release detection anymore, as the master branch (ATM) is all encompasing, from >= 0.19.0 till now. So detection of something that started existing only in 0.19.2 is theoretically impossible via the tags, though obviously via duck typing it is.

So solutions are:

  • use a specific commit counter in LooseVersion
  • tag master at the same time as we tag 0.19.x with a (non-annotated?) tag that 'marks' it, e.g. v0.19.2_released or something
  • duck type for the features that are specifically needed

@jorisvandenbossche
Copy link
Member

Another option would be to tag master with eg 0.20.0.dev after branching 0.19.x.

In that case a check like " >= 0.19.2" would work for both master and 0.19.2 (but of course is only correct if your master is up to date)

@jreback
Copy link
Contributor

jreback commented Oct 24, 2017

closing

@jreback jreback closed this as completed Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Build Library building on various platforms
Projects
None yet
Development

No branches or pull requests

4 participants