aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorThomas Kemmer <tkemmer@computer.org>2014-11-24 05:48:07 +0100
committerThomas Kemmer <tkemmer@computer.org>2014-11-24 06:27:16 +0100
commitf240afdd5bbb7b34e901f1b0a4bacf59c8de2919 (patch)
tree7ae4d56ff429513d180b9ddc93433fdf285b57f7 /setup.py
parent8c1f8c74320b3927dc194e8fb9f89b8ab2b5e240 (diff)
downloadcachetools-f240afdd5bbb7b34e901f1b0a4bacf59c8de2919.tar.gz
Package cleanup.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/setup.py b/setup.py
index 07fef3f..22ce031 100644
--- a/setup.py
+++ b/setup.py
@@ -1,20 +1,21 @@
+import os.path, codecs, re
+
from setuptools import setup
-def get_version(filename):
- import re
- content = open(filename).read()
- metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
- return metadata['version']
+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()))
+
setup(
name='cachetools',
- version=get_version('cachetools/__init__.py'),
+ version=metadata['version'],
author='Thomas Kemmer',
author_email='tkemmer@computer.org',
url='https://github.com/tkem/cachetools',
license='MIT',
- description='Extensible memoizing collections and decorators', # noqa
+ description='Extensible memoizing collections and decorators',
long_description=open('README.rst').read(),
keywords='cache caching LRU LFU TTL',
classifiers=[