Skip to content

Commit

Permalink
Merge pull request #1 from marscher/versioneer
Browse files Browse the repository at this point in the history
Added Versioneer
  • Loading branch information
gph82 authored Mar 3, 2017
2 parents ab8c09f + 8cc1a00 commit 25f72fe
Show file tree
Hide file tree
Showing 7 changed files with 2,359 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
projX/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include projX/_version.py
22 changes: 3 additions & 19 deletions projX/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,11 @@ def _impl():
# TODO add loggers

return threading.Thread(target=_impl if _report_status() else lambda: '')


# http://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package
from pkg_resources import get_distribution, DistributionNotFound
import os.path
try:
_dist = get_distribution('projX')
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, 'projX')):
# not installed, but there is another version that *is*
raise DistributionNotFound
except DistributionNotFound:
__version__ = 'Please install this project with setup.py'
else:
__version__ = _dist.version
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


# start check in background
_version_check(__version__).start()



Loading

0 comments on commit 25f72fe

Please sign in to comment.