summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authormicheles <micheles@micheles-mac>2010-05-22 09:08:40 +0200
committermicheles <micheles@micheles-mac>2010-05-22 09:08:40 +0200
commit3346499362d111158ae051a2bb17504f01344d58 (patch)
tree1de31cfbde75976252ed6df924ec6beeae7f4e81 /setup.py
parent4452ad10bcf032717f561bc825538e6daecd4c8a (diff)
downloadpython-decorator-git-3346499362d111158ae051a2bb17504f01344d58.tar.gz
Version 3.2 of the decorator module
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 7269d1f..87f4568 100644
--- a/setup.py
+++ b/setup.py
@@ -2,24 +2,29 @@ try:
from setuptools import setup
except ImportError:
from distutils.core import setup
+import os.path
-from decorator import __version__ as VERSION
+def getversion(fname):
+ """Get the __version__ reading the file: works both in Python 2.X and 3.X,
+ whereas direct importing would break in Python 3.X with a syntax error"""
+ for line in open(fname):
+ if line.startswith('__version__'):
+ return eval(line[13:])
+ raise NameError('Missing __version__ in decorator.py')
+
+VERSION = getversion(
+ os.path.join(os.path.dirname(__file__), 'src/decorator.py'))
if __name__ == '__main__':
- try:
- docfile = file('/tmp/documentation.html')
- except IOError: # file not found, ignore
- doc = ''
- else:
- doc = docfile.read()
setup(name='decorator',
version=VERSION,
description='Better living through Python with decorators',
- long_description='</pre>%s<pre>' % doc,
+ long_description=open('README.txt').read(),
author='Michele Simionato',
author_email='michele.simionato@gmail.com',
url='http://pypi.python.org/pypi/decorator',
license="BSD License",
+ package_dir = {'': 'src'},
py_modules = ['decorator'],
keywords="decorators generic utility",
platforms=["All"],
@@ -31,5 +36,5 @@ if __name__ == '__main__':
'Programming Language :: Python',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities'],
+ use_2to3=True,
zip_safe=False)
-