Skip to content

Commit

Permalink
setup: Simplify release process using "versioneer"
Browse files Browse the repository at this point in the history
Release process is now as simple as tagging a release, there
is no need to manually updates version in __init__.py

Most of the files enabling this process have been generated and/or
updated after:
1) pip install versioneer
2) adding "versioneer" section to setup.cfg
3) running "versioneer install"

For more details, see https://github.com/warner/python-versioneer/
  • Loading branch information
jcfr committed Jul 25, 2018
1 parent 107a5db commit 894eec6
Show file tree
Hide file tree
Showing 7 changed files with 2,360 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wordcloud/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include wordcloud/_version.py
9 changes: 8 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ show-source = True
# Maximum cyclomatic complexity allowed
max-complexity = 14
format = pylint
exclude = .git,.idea,.eggs,__pycache__,doc/_build,doc/auto_examples,doc/conf.py,build
exclude = .git,.idea,.eggs,__pycache__,doc/_build,doc/auto_examples,doc/conf.py,build,wordcloud/_version.py,versioneer.py

[tool:pytest]
addopts = -v --cov --cov-report xml --tb=short

[versioneer]
VCS = git
versionfile_source = wordcloud/_version.py
versionfile_build = wordcloud/_version.py
style = pep440-post
tag_prefix = ''
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import re
import io
from setuptools import setup
from setuptools.extension import Extension

__version__ = re.search(
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', # It excludes inline comment too
io.open('wordcloud/__init__.py', encoding='utf_8').read()
).group(1)

import versioneer

with io.open('README.md', encoding='utf_8') as fp:
readme = fp.read()
Expand All @@ -16,7 +10,8 @@
author="Andreas Mueller",
author_email="[email protected]",
name='wordcloud',
version=__version__,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
url='https://github.com/amueller/word_cloud',
description='A little word cloud generator',
long_description=readme,
Expand Down
Loading

0 comments on commit 894eec6

Please sign in to comment.