Skip to content

Commit 8c06ee9

Browse files
Merge pull request #147 from pypa/master_testscript
fix handing the own version fixes #129
2 parents b0d17f1 + 9c9fc79 commit 8c06ee9

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ matrix:
1616
env: TOXENV=flake8
1717
- python: '3.5'
1818
env: TOXENV=flake8
19+
- python: '2.7'
20+
env: SELFINSTALL=1
21+
- python: '3.5'
22+
env: SELFINSTALL=1
1923
cache:
2024
files:
2125
- $HOME/.pip/cache
2226
- $Home/.cache/pip
2327
install: pip install tox
2428
script:
25-
- tox -e $TOXENV
29+
- python testing/runtests_travis.py
2630

2731

2832

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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
from subprocess import call
3+
4+
import os
5+
6+
if os.environ.get('TOXENV'):
7+
# normal tox run, lets jsut have tox do its job
8+
import tox
9+
tox.cmdline()
10+
elif os.environ.get('SELFINSTALL'):
11+
# self install testing needs some clarity
12+
# so its being executed without any other tools running
13+
call('python setup.py sdist', shell=True)
14+
call('easy_install dist/*', shell=True)
15+
import pkg_resources
16+
dist = pkg_resources.get_distribution('setuptools_scm')
17+
assert set(dist.version) == set(".0"), dist.version

0 commit comments

Comments
 (0)