aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorThomas Kemmer <tkemmer@computer.org>2016-03-29 13:03:40 +0200
committerThomas Kemmer <tkemmer@computer.org>2016-04-01 09:06:38 +0200
commit775c51da45db486627365697faf4082b7982d56c (patch)
tree8d4d0e7a8b0258294844189b48eb29562d5a4361 /setup.py
parent7efef5cbc2a7ece83b2e1fa88afbad6c5038a335 (diff)
downloadcachetools-775c51da45db486627365697faf4082b7982d56c.tar.gz
Code/build cleanups.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index a683e67..b065d87 100644
--- a/setup.py
+++ b/setup.py
@@ -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'
+ ]
)