From 3346499362d111158ae051a2bb17504f01344d58 Mon Sep 17 00:00:00 2001 From: micheles Date: Sat, 22 May 2010 09:08:40 +0200 Subject: Version 3.2 of the decorator module --- setup.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'setup.py') 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='%s
' % 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)
-
-- 
cgit v1.2.1