Skip to content

Commit

Permalink
determine version automatically from latest git tag
Browse files Browse the repository at this point in the history
using setuptools_scm
  • Loading branch information
anthrotype committed Oct 19, 2021
1 parent e100e66 commit a3473c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dist
*~
*.so
.tox/
# autogenerated from git tag by setuptools_scm
src/zopfli/_version.py
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def build_extensions(self):

setup(
name='zopfli',
version='0.1.8',
use_scm_version={"write_to": "src/zopfli/_version.py"},
author='Adam DePrince',
author_email='[email protected]',
maintainer='Cosimo Lupo',
Expand Down Expand Up @@ -87,4 +87,5 @@ def build_extensions(self):
cmdclass={
"build_ext": custom_build_ext,
},
setup_requires=["setuptools_scm"],
)
5 changes: 5 additions & 0 deletions src/zopfli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@
unlimited, but this can give extreme results that hurt compression
on some files). Default value: 15.
"""

try:
from ._version import version as __version__ # type: ignore
except ImportError:
__version__ = "0.0.0+unknown"

0 comments on commit a3473c7

Please sign in to comment.