Switch to setuptools-scm

This commit is contained in:
Markus Unterwaditzer 2015-06-11 19:28:49 +02:00
parent a07c9bea44
commit 35c272dda2
4 changed files with 8 additions and 25 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ build
env
*.egg-info
.cache
.eggs
.xprocess
dist
tests/storage/dav/servers/*

View file

@ -2,9 +2,6 @@
import datetime
import os
import sys
import pkg_resources
from sphinx.ext import autodoc
@ -19,15 +16,8 @@ project = u'vdirsyncer'
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']

View file

@ -3,23 +3,13 @@
Vdirsyncer is a synchronization tool for vdir. See the README for more details.
'''
import ast
import re
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',

View file

@ -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'