Permalink
Browse files

Allow to install Pythoscope using bare distutils.

  • Loading branch information...
1 parent 75894b7 commit f109334f89883a136601f363bf0833550e647bb4 @mkwiatkowski committed with Oct 29, 2009
Showing with 21 additions and 14 deletions.
  1. +5 −0 scripts/pythoscope
  2. +16 −14 setup.py
View
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+
+from pythoscope import main
+
+main()
View
@@ -1,20 +1,28 @@
import sys
-# Order is relevant, as setuptools monkeypatches distutils.
-from setuptools import setup
-from distutils.core import Extension
-
-from pythoscope import __version__
+try:
+ from setuptools import setup
+ args = dict(
+ entry_points = {'console_scripts': ['pythoscope = pythoscope:main']},
+ install_requires = [],
+ test_suite = 'nose.collector',
+ tests_require = ['nose', 'mock', 'docutils'])
+except ImportError:
+ from distutils.core import setup
+ args = dict(scripts = ['scripts/pythoscope'])
# The C module doesn't need to be built for Python 2.5 and higher.
if sys.version_info < (2, 5):
+ from distutils.core import Extension
ext_modules = [Extension('pythoscope._util', sources=['pythoscope/_util.c'])]
else:
ext_modules = []
+from pythoscope import __version__ as VERSION
+
setup(
name='pythoscope',
- version=__version__,
+ version=VERSION,
author = 'Michal Kwiatkowski',
author_email = 'constant.beta@gmail.com',
@@ -28,14 +36,6 @@
packages = ['pythoscope', 'pythoscope.inspector', 'pythoscope.generator', 'lib2to3', 'lib2to3.pgen2'],
package_data = {'pythoscope': [],
'lib2to3': ['*.txt']},
- install_requires = [],
-
- entry_points = {
- 'console_scripts': ['pythoscope = pythoscope:main']
- },
-
- test_suite = 'nose.collector',
- tests_require = ['nose', 'mock', 'docutils'],
classifiers = [
'Development Status :: 2 - Pre-Alpha',
@@ -45,4 +45,6 @@
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Testing',
],
+
+ **args
)

0 comments on commit f109334

Please sign in to comment.