-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from jparise/setup-version
Parse version directly from pymemcache/__init__.py
- Loading branch information
Showing
4 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | ||
|