Skip to content

Commit

Permalink
use setuptool_scm plugin to main version
Browse files Browse the repository at this point in the history
Get the version from the git tag and the last commit sha.
  • Loading branch information
goneri committed Feb 20, 2019
1 parent d12f518 commit eddb233
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -62,3 +62,6 @@ target/

#Ipython Notebook
.ipynb_checkpoints

# maintain by setuptools-scm
virt_lightning/version.py
6 changes: 6 additions & 0 deletions setup.py
Expand Up @@ -45,16 +45,21 @@ def _get_readme():
author_email="goneri@lebouder.net",
description="Deploy your testing VM in a couple of sections",
long_description=_get_readme(),
long_description_content_type="text/markdown",
install_requires=_get_requirements(),
url="https://github.com/virt-lightning/virt-lightning",
use_scm_version={"write_to": "virt_lightning/version.py"},
license="Apache v2.0",
platforms=["linux"],
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: System :: Distributed Computing",
],
entry_points={
Expand All @@ -63,4 +68,5 @@ def _get_readme():
"vl = virt_lightning.shell:main",
]
},
setup_requires=["setuptools_scm"],
)
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -26,11 +26,11 @@ deps = flake8
flake8-type-annotations
flake8-broken-line
# flake8-print
commands = flake8 setup.py virt_lightning
commands = flake8 --exclude=version.py setup.py virt_lightning

[testenv:black]
commands =
black --diff --check setup.py virt_lightning
black --diff --check --exclude=version.py setup.py virt_lightning

[isort]
line_length=90
Expand Down
4 changes: 4 additions & 0 deletions virt_lightning/__init__.py
@@ -0,0 +1,4 @@
try:
from .version import __version__
except ImportError:
__version__ = None

0 comments on commit eddb233

Please sign in to comment.