Commits

Jason R. Coombs committed 36d2030

Added Python 3 build support. Had to remove the import of the poster lib for version determination, so load the version more directly

Comments (0)

Files changed (1)

+import re
 from setuptools import setup, find_packages
-import poster
+
+try:
+    from distutils.command.build_py import build_py_2to3 as build_py
+except ImportError:
+    from distutils.command.build_py import build_py
 
 # To update version number, edit:
 # poster/__init__.py
 # docs/index.rst
-version = ".".join(str(x) for x in poster.version)
+with open('poster/__init__.py') as f:
+    is_version = lambda line: line.startswith('version =')
+    line = next(filter(is_version, f))
+    exec(line)
+version = ".".join(str(x) for x in version)
 
 setup(name='poster',
       version=version,
       extras_require = {'poster': ["buildutils", "sphinx"]},
       tests_require = ["nose", "webob", "paste"],
       test_suite = 'nose.collector',
+      cmdclass=dict(build_py=build_py),
       #entry_points="",
       )