Skip to content

Commit 25f72fe

Browse files
authored
Merge pull request #1 from marscher/versioneer
Added Versioneer
2 parents ab8c09f + 8cc1a00 commit 25f72fe

File tree

7 files changed

+2359
-20
lines changed

7 files changed

+2359
-20
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
projX/_version.py export-subst

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include projX/_version.py

projX/__init__.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,11 @@ def _impl():
8383
# TODO add loggers
8484

8585
return threading.Thread(target=_impl if _report_status() else lambda: '')
86-
87-
88-
# http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package
89-
from pkg_resources import get_distribution, DistributionNotFound
90-
import os.path
91-
try:
92-
_dist = get_distribution('projX')
93-
# Normalize case for Windows systems
94-
dist_loc = os.path.normcase(_dist.location)
95-
here = os.path.normcase(__file__)
96-
if not here.startswith(os.path.join(dist_loc, 'projX')):
97-
# not installed, but there is another version that *is*
98-
raise DistributionNotFound
99-
except DistributionNotFound:
100-
__version__ = 'Please install this project with setup.py'
101-
else:
102-
__version__ = _dist.version
86+
from ._version import get_versions
87+
__version__ = get_versions()['version']
88+
del get_versions
10389

10490

10591
# start check in background
10692
_version_check(__version__).start()
10793

108-
109-

0 commit comments

Comments
 (0)