Skip to content

Commit

Permalink
Use bumpversion for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjschultz committed Apr 23, 2014
1 parent 01ab8d0 commit 9b5f1b9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[bumpversion]
files = setup.py radix/__init__.py
commit = True
tag = True
current_version = 0.5.0
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bumpversion:
pip install bumpversion

major minor patch: bumpversion
bumpversion $@
@echo "push via \`git push origin master --tags\`"

clean:
find . -name '*.py[co]' -delete
find . -name '__pycache__' -delete
find . -name '*.so' -delete
rm -rf build/ dist/ *.egg *.egg-info/
20 changes: 1 addition & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import codecs
import re
import sys
import os

Expand All @@ -15,23 +14,6 @@
RADIX_NO_EXT = os.environ.get('RADIX_NO_EXT', '0')
RADIX_NO_EXT = True if RADIX_NO_EXT not in ('0', 'false', 'False') else False


# Read the version number from a source file.
def find_version(*file_paths):
# Open in Latin-1 so that we avoid encoding errors.
# Use codecs.open for Python 2 compatibility
with codecs.open(join(here, *file_paths), 'r', 'latin1') as f:
version_file = f.read()

# The version line must have the form
# __version__ = 'ver'
version_re = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.M)
version_match = version_re.search(version_file)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


with codecs.open(join(here, 'README.rst'), encoding='utf-8') as f:
README = f.read()

Expand All @@ -45,7 +27,7 @@ def find_version(*file_paths):

setup(
name='py-radix',
version=find_version('radix', '__init__.py'),
version='0.5.0',
maintainer='Michael J. Schultz',
maintainer_email='[email protected]',
url='https://github.com/mjschultz/py-radix',
Expand Down

0 comments on commit 9b5f1b9

Please sign in to comment.