Skip to content

Commit

Permalink
Use setuptools_scm.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Jan 28, 2018
1 parent 9a0d4ab commit 5d466ac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions authority/__init__.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -46,11 +47,10 @@
# |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.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -35,6 +35,7 @@ def read(fname):
'Framework :: Django',
],
install_requires=['django'],
setup_requires=['setuptools_scm'],
package_data={
'authority': [
'fixtures/*.json',
Expand Down

0 comments on commit 5d466ac

Please sign in to comment.