Skip to content

Commit

Permalink
Switch to setuptools-scm
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Jun 11, 2015
1 parent a07c9be commit 335f1d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build
env
*.egg-info
.cache
.eggs
.xprocess
dist
tests/storage/dav/servers/*
Expand Down
11 changes: 2 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@
copyright = (u'2014-{}, Markus Unterwaditzer & contributors'
.format(datetime.date.today().strftime('%Y')))

try:
# The full version, including alpha/beta/rc tags.
release = pkg_resources.require('vdirsyncer')[0].version
except pkg_resources.DistributionNotFound:
print('To build the documentation, the distribution information of '
'vdirsyncer has to be available. Run "setup.py develop" to do '
'this.')
sys.exit(1)

import vdirsyncer
release = vdirsyncer.__version__
version = '.'.join(release.split('.')[:2]) # The short X.Y version.

exclude_patterns = ['_build']
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@
from setuptools import find_packages, setup


_version_re = re.compile(r'__version__\s+=\s+(.*)')


with open('vdirsyncer/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))


setup(
name='vdirsyncer',
version=version,
use_scm_version=True,
setup_requires=['setuptools_scm'],
author='Markus Unterwaditzer',
author_email='markus@unterwaditzer.net',
url='https://github.com/untitaker/vdirsyncer',
Expand Down
4 changes: 3 additions & 1 deletion vdirsyncer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
'''
vdirsyncer is a synchronization tool for vdir. See the README for more details.
'''
__version__ = '0.5.1'

import pkg_resources
__version__ = pkg_resources.get_distribution('vdirsyncer').version

PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer'
DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/latest'

0 comments on commit 335f1d8

Please sign in to comment.