Skip to content

Commit

Permalink
Single source the package version via Git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlim-hs committed Sep 21, 2019
1 parent 5b88f5d commit 3510756
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/
_version.py
10 changes: 8 additions & 2 deletions minpair/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
__version__ = '0.1.0'

from .minpair import *

__all__ = ['__version__']
try:
from ._version import version as __version__
except ImportError:
# broken installation, we don't even try
# unknown only works because we do poor mans version compare
__version__ = 'unknown'
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import find_packages, setup
from io import open
from minpair import __version__
from setuptools import find_packages, setup
import os

with open("README.md") as readme_file:
long_description = readme_file.read()
Expand All @@ -28,5 +28,8 @@
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
],
install_requires=install_requires
install_requires=install_requires,
use_scm_version={"version_scheme": "post-release",
"write_to": "minpair/_version.py", },
setup_requires=["setuptools_scm"],
)

0 comments on commit 3510756

Please sign in to comment.