diff options
author | Thomas Kemmer <tkemmer@computer.org> | 2016-03-29 13:03:40 +0200 |
---|---|---|
committer | Thomas Kemmer <tkemmer@computer.org> | 2016-04-01 09:06:38 +0200 |
commit | 775c51da45db486627365697faf4082b7982d56c (patch) | |
tree | 8d4d0e7a8b0258294844189b48eb29562d5a4361 /setup.py | |
parent | 7efef5cbc2a7ece83b2e1fa88afbad6c5038a335 (diff) | |
download | cachetools-775c51da45db486627365697faf4082b7982d56c.tar.gz |
Code/build cleanups.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -1,23 +1,25 @@ -import os.path, codecs, re +from __future__ import unicode_literals -from setuptools import setup +from setuptools import find_packages, setup -with codecs.open(os.path.join(os.path.dirname(__file__), 'cachetools', '__init__.py'), - encoding='utf8') as f: - metadata = dict(re.findall(r"__([a-z]+)__ = '([^']+)", f.read())) - +def get_version(filename): + from re import findall + with open(filename) as f: + metadata = dict(findall("__([a-z]+)__ = '([^']+)'", f.read())) + return metadata['version'] setup( name='cachetools', - version=metadata['version'], - author='Thomas Kemmer', - author_email='tkemmer@computer.org', + version=get_version('cachetools/__init__.py'), url='https://github.com/tkem/cachetools', license='MIT', + author='Thomas Kemmer', + author_email='tkemmer@computer.org', description='Extensible memoizing collections and decorators', long_description=open('README.rst').read(), keywords='cache caching memoize memoizing memoization LRU LFU TTL', + packages=find_packages(exclude=['tests', 'tests.*']), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Other Environment', @@ -33,7 +35,5 @@ setup( 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Software Development :: Libraries :: Python Modules' - ], - packages=['cachetools'], - test_suite='tests' + ] ) |