Skip to content

Commit 9c9fc79

Browse files
Merge pull request #146 from RonnyPfannschmidt/setup/fix_version
merging the pr that fixes obtaining the own version i'm leaving all commits in place since i used some to do release testing
2 parents 8f4da52 + fd87aad commit 9c9fc79

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v1.15.3
2+
=======
3+
4+
* bring back correctly getting our version in the own sdist, finalizes #114
5+
6+
17
v1.15.2
28
=======
39

setup.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@
2424
sys.exit('please run `python setup.py egg_info` first')
2525

2626

27+
def _find_hackish_version():
28+
here = os.path.dirname(os.path.abspath(__file__))
29+
sys.path.insert(0, here)
30+
from setuptools_scm.hacks import parse_pkginfo
31+
from setuptools_scm import get_version
32+
try:
33+
return get_version(
34+
root=here, parse=parse_pkginfo,
35+
**scm_config())
36+
except IOError:
37+
pass
38+
39+
2740
def scm_config():
2841
from setuptools_scm.version import (
2942
guess_next_dev_version,
@@ -38,13 +51,15 @@ def scm_config():
3851
with open('README.rst') as fp:
3952
long_description = fp.read()
4053

54+
found_version = _find_hackish_version()
4155

4256
arguments = dict(
4357
name='setuptools_scm',
4458
url='https://github.com/pypa/setuptools_scm/',
4559
zip_safe=True,
60+
version=found_version,
4661
# pass here since entrypints are not yet registred
47-
use_scm_version=scm_config,
62+
use_scm_version=found_version is None and scm_config,
4863
author='Ronny Pfannschmidt',
4964
author_email='[email protected]',
5065
description=('the blessed package to manage your versions by scm tags'),

testing/runtests_travis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
import os
55

66
if os.environ.get('TOXENV'):
7+
# normal tox run, lets jsut have tox do its job
78
import tox
89
tox.cmdline()
910
elif os.environ.get('SELFINSTALL'):
11+
# self install testing needs some clarity
12+
# so its being executed without any other tools running
1013
call('python setup.py sdist', shell=True)
1114
call('easy_install dist/*', shell=True)
1215
import pkg_resources
1316
dist = pkg_resources.get_distribution('setuptools_scm')
14-
assert set(dist.version) != set(".0"), dist.version
17+
assert set(dist.version) == set(".0"), dist.version

0 commit comments

Comments
 (0)