Skip to content

Commit

Permalink
Merge pull request #216 from jparise/setup-version
Browse files Browse the repository at this point in the history
Parse version directly from pymemcache/__init__.py
  • Loading branch information
jparise authored Jan 28, 2019
2 parents ef2cf23 + 3d820b2 commit 8d34a50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

New in version 2.1.1
--------------------
* Fix ``setup.py`` dependency on six already being installed.

New in version 2.1.0
--------------------
* Public classes and exceptions can now be imported from the top-level
Expand Down
2 changes: 1 addition & 1 deletion pymemcache/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.1.0'
__version__ = '2.1.1'

from pymemcache.client.base import Client # noqa
from pymemcache.client.base import PooledClient # noqa
Expand Down
8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[bumpversion]
current_version = 2.0.0
commit = False
tag = True

[bdist_wheel]
universal = true

Expand All @@ -27,6 +22,3 @@ markers =
show-source = True
max-line-length = 80
exclude = .tox/*,.venv/*,docs/*

[bumpversion:file:pymemcache/__init__.py]

17 changes: 13 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
#!/usr/bin/env python

import os
import re

from setuptools import setup, find_packages
from pymemcache import __version__


def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def read(path):
return open(os.path.join(os.path.dirname(__file__), path)).read()


def read_version(path):
match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", read(path), re.M)
if match:
return match.group(1)
raise RuntimeError("Unable to find __version__ in %s." % path)


readme = read('README.rst')
changelog = read('ChangeLog.rst')
version = read_version('pymemcache/__init__.py')

setup(
name='pymemcache',
version=__version__,
version=version,
author='Charles Gordon',
author_email='[email protected]',
packages=find_packages(),
Expand Down

0 comments on commit 8d34a50

Please sign in to comment.