setuptools_scm: Regression: get_version works for 1.10.1 and 1.11.1, but not 1.13.1
Summary
setuptools_scm 1.13.1 fails for several of my projects. 1.10.1 and 1.11.1 worked fine. The ultimate error is (full traceback below):
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/version.py", line 86, in meta
assert tag is not None, 'cant parse version %s' % tag
AssertionError: cant parse version None
Python 3.5.2, Ubuntu 16.04, various versions of setuptools_scm (see below).
This error appears to occur only for head revisions on several repos. Affected repos use hg-git, although I have no evidence that that’s related.
Reproduction
snafu$ hg clone git@github.com:biocommons/bioutils.git
destination directory: bioutils
importing git objects into hg
updating to branch default
41 files updated, 0 files merged, 0 files removed, 0 files unresolved
snafu$ cd bioutils/
snafu$ pyvenv venv
snafu$ source venv/bin/activate
(venv) snafu$ pip install --upgrade pip setuptools
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-28.8.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Found existing installation: setuptools 20.7.0
Uninstalling setuptools-20.7.0:
Successfully uninstalled setuptools-20.7.0
Successfully installed pip-9.0.1 setuptools-28.8.0
# recent commits, with any tags
(venv) snafu$ hg log -l 7 -G -T '{rev} {node|short} {tags}'
@ 59 4aac87427260 default/default/master default/master tip
|
o 58 f9ca4a4c9c1c 0.2.0a2
|
o 57 f7d97e9493ae
|
o 56 57709bd798a4
|
o 55 019f38efb5c2
|
o 54 12c36903cb55 0.2.0a1
|
o 53 6bf205dc9ec0
# generate a table of get_version results for the above commits and setuptools_scm 1.10.1, 1.11.1, 1.13.1
(venv) snafu$ for r in 4aac f9ca f7d9 5770 019f 12c3 6bf2; do hg up -q $r; echo -n $(hg id -it); for v in 1.10.1 1.11.1 1.13.1; do pip install setuptools_scm==$v 1>/dev/null 2>&1; echo -n ,$(python -c 'from setuptools_scm import get_version; print(get_version())' 2>/dev/null | tail -1); done; echo; done >|data
(venv) snafu$ column -ts, <data
4aac87427260 default/default/master default/master tip 0.2.0a2 0.2.0a2
f9ca4a4c9c1c 0.2.0a2 0.2.0a2 0.2.0a2 0.2.0a2
f7d97e9493ae 0.2.0a2.dev3+nf7d97e9493ae 0.2.0a2.dev3+nf7d97e9493ae 0.2.0a2.dev3+nf7d97e9493ae
57709bd798a4 0.2.0a2.dev2+n57709bd798a4 0.2.0a2.dev2+n57709bd798a4 0.2.0a2.dev2+n57709bd798a4
019f38efb5c2 0.2.0a1 0.2.0a1 0.2.0a1
12c36903cb55 0.2.0a1 0.2.0a1 0.2.0a1 0.2.0a1
6bf205dc9ec0 0.1.4.dev4+n6bf205dc9ec0 0.1.4.dev4+n6bf205dc9ec0 0.1.4.dev4+n6bf205dc9ec0
Columns are 1) changeset + tags, 2) 1.10.1 get_version, 3) 1.11.1 get_version, 4) 1.13.1 get_version
Example Tracebacks
These are all collected for the same bioutils commit (changeset 4aac87427260).
1.13.1
(venv) snafu$ pip install setuptools_scm==1.13.1; python -c 'from setuptools_scm import get_version; print(get_version())'
Collecting setuptools_scm==1.13.1
Using cached setuptools_scm-1.13.1-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Successfully installed setuptools-scm-1.13.1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/__init__.py", line 117, in get_version
parsed_version = _do_parse(root, parse)
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/__init__.py", line 82, in _do_parse
version = version_from_scm(root)
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/__init__.py", line 31, in version_from_scm
return _version_from_entrypoint(root, 'setuptools_scm.parse_scm')
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/__init__.py", line 37, in _version_from_entrypoint
return ep.load()(root)
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/hg.py", line 43, in parse
return _hg_tagdist_normalize_tagcommit(root, tag, dist, node)
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/hg.py", line 17, in _hg_tagdist_normalize_tagcommit
return meta(tag, distance=dist, node=node, dirty=dirty)
File "/home/reece/projects/biocommons/bioutils/venv/lib/python3.5/site-packages/setuptools_scm/version.py", line 86, in meta
assert tag is not None, 'cant parse version %s' % tag
AssertionError: cant parse version None
1.11.1
(venv) snafu$ pip install setuptools_scm==1.11.1; python -c 'from setuptools_scm import get_version; print(get_version())'
Collecting setuptools_scm==1.11.1
Using cached setuptools_scm-1.11.1-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Found existing installation: setuptools-scm 1.13.1
Uninstalling setuptools-scm-1.13.1:
Successfully uninstalled setuptools-scm-1.13.1
Successfully installed setuptools-scm-1.11.1
0.2.0a3.dev2+n932c0cfb2774
1.10.1
(venv) snafu$ pip install setuptools_scm==1.10.1; python -c 'from setuptools_scm import get_version; print(get_version())'
Collecting setuptools_scm==1.10.1
Using cached setuptools_scm-1.10.1-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Found existing installation: setuptools-scm 1.11.1
Uninstalling setuptools-scm-1.11.1:
Successfully uninstalled setuptools-scm-1.11.1
Successfully installed setuptools-scm-1.10.1
0.2.0a3.dev2+n932c0cfb2774
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (20 by maintainers)
Commits related to this issue
- experiment with a failing test for #134 — committed to RonnyPfannschmidt/setuptools_scm by RonnyPfannschmidt 8 years ago
@avirshup deserves the credit for making a much better and more reliable hg integration