Use setuptools_scm.

This commit is contained in:
Jannis Leidel 2018-01-28 14:17:11 +01:00
parent 9a0d4ab678
commit 5d466ac318
No known key found for this signature in database
GPG key ID: C795956FB489DCA9
3 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,11 @@
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution('authority').version
except DistributionNotFound:
# package is not installed
pass
LOADING = False

View file

@ -13,6 +13,7 @@
import os
import sys
from pkg_resources import get_distribution
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@ -46,11 +47,10 @@ copyright = u'2009, the django-authority team'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.9'
# The full version, including alpha/beta/rc tags.
release = '0.9dev'
release = get_distribution('authority').version
# The short X.Y version.
version = '.'.join(release.split('.')[:2])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -8,7 +8,7 @@ def read(fname):
setup(
name='django-authority',
version='0.12',
use_scm_version=True,
description=(
"A Django app that provides generic per-object-permissions "
"for Django's auth app."
@ -35,6 +35,7 @@ setup(
'Framework :: Django',
],
install_requires=['django'],
setup_requires=['setuptools_scm'],
package_data={
'authority': [
'fixtures/*.json',