Skip to content

Commit ff948dc

Browse files
committed
fix bug when using callable version_scheme
This fixes bug introduced with 0f1c98d, looking like this: Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-zfpnaarq/xd-docker/setup.py", line 69, in <module> setup_requires=['setuptools_scm'], File "/usr/local/lib/python3.4/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/usr/local/lib/python3.4/site-packages/setuptools/dist.py", line 272, in __init__ _Distribution.__init__(self,attrs) File "/usr/local/lib/python3.4/distutils/dist.py", line 280, in __init__ self.finalize_options() File "/usr/local/lib/python3.4/site-packages/setuptools/dist.py", line 327, in finalize_options ep.load()(self, ep.name, value) File "/usr/local/lib/python3.4/site-packages/setuptools_scm-1.10.2.dev8+ng4835e4d-py3.4.egg/setuptools_scm/integration.py", line 16, in version_keyword AttributeError: 'function' object has no attribute 'pop' Signed-off-by: Esben Haabendal <[email protected]>
1 parent c178ee7 commit ff948dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setuptools_scm/integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ def version_keyword(dist, keyword, value):
1212
return
1313
if value is True:
1414
value = {}
15-
if os.path.exists('PKG-INFO'):
16-
value.pop('root', None)
1715
if getattr(value, '__call__', None):
1816
value = value()
17+
if os.path.exists('PKG-INFO'):
18+
value.pop('root', None)
1919
dist.metadata.version = get_version(**value)
2020

2121

0 commit comments

Comments
 (0)