[PyObjC-svn] r2538 - trunk/pyobjc/pyobjc-core
[email protected] Sat, 03 Jul 2010 04:10:37 -0500
| Newsgroups | gmane.comp.python.pyobjc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: ronaldoussoren
Date: Sat Jul 3 04:10:36 2010
New Revision: 2538
Log:
Tweak setup.py to ensure that PyObjCTest doesn't get installed. Needed due
to changes in setuptools/distribute.
Modified:
trunk/pyobjc/pyobjc-core/setup.py
Modified: trunk/pyobjc/pyobjc-core/setup.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/setup.py (original)
+++ trunk/pyobjc/pyobjc-core/setup.py Sat Jul 3 04:10:36 2010
@@ -29,52 +29,50 @@
raise SystemExit('PyObjC: Need at least Python ' + vstr)
-if sys.version_info[:2] < (3, 0):
- import ez_setup
- ez_setup.use_setuptools()
-
- extra_args=dict()
- from setuptools.command.build_py import build_py as oc_build_py
- from setuptools.command.test import test as oc_test
+try:
+ import setuptools
-else:
+except ImportError:
import distribute_setup
distribute_setup.use_setuptools()
- extra_args=dict(
- use_2to3 = True,
- )
-
- from setuptools.command import build_py
- from setuptools.command import test
- from distutils import log
- class oc_build_py (build_py.build_py):
- def run_2to3(self, files, doctests=True):
- files = [ fn for fn in files if not os.path.basename(fn).startswith('test3_') ]
- super(oc_build_py, self).run_2to3(files, doctests)
-
- def build_packages(self):
- log.info("Overriding build_packages to copy PyObjCTest")
- p = self.packages
- self.packages = list(self.packages) + ['PyObjCTest']
- try:
- build_py.build_py.build_packages(self)
- finally:
- self.packages = p
-
- from pkg_resources import working_set, normalize_path, add_activation_listener, require
-
- class oc_test (test.test):
- def run_tests(self):
- import sys, os
+extra_args=dict(
+ use_2to3 = True,
+)
+
+from setuptools.command import build_py
+from setuptools.command import test
+from distutils import log
+class oc_build_py (build_py.build_py):
+ def run_2to3(self, files, doctests=True):
+ files = [ fn for fn in files if not os.path.basename(fn).startswith('test3_') ]
+ build_py.build_py.run_2to3(self, files, doctests)
+
+ def build_packages(self):
+ log.info("Overriding build_packages to copy PyObjCTest")
+ p = self.packages
+ self.packages = list(self.packages) + ['PyObjCTest']
+ try:
+ build_py.build_py.build_packages(self)
+ finally:
+ self.packages = p
+
+from pkg_resources import working_set, normalize_path, add_activation_listener, require
+
+class oc_test (test.test):
+ def run_tests(self):
+ import sys, os
+
+ if sys.version_info[0] == 3:
rootdir = os.path.dirname(os.path.abspath(__file__))
if rootdir in sys.path:
sys.path.remove(rootdir)
- from PyObjCTest.loader import makeTestSuite
- import unittest
-
- unittest.main(None, None, [unittest.__file__]+self.test_args)
+
+ from PyObjCTest.loader import makeTestSuite
+ import unittest
+
+ unittest.main(None, None, [unittest.__file__]+self.test_args)
from setuptools.command import egg_info as orig_egg_info
@@ -157,12 +155,23 @@
import os
class pyobjc_install_lib (install_lib.install_lib):
+ def run(self):
+ print "===== install_lib"
+ install_lib.install_lib.run(self)
+ print "----- install_lib"
+
+
def get_exclusions(self):
result = install_lib.install_lib.get_exclusions(self)
for fn in install_lib._install_lib.get_outputs(self):
if 'PyObjCTest' in fn:
result[fn] = 1
+ for fn in os.listdir('PyObjCTest'):
+ result[os.path.join('PyObjCTest', fn)] = 1
+ result[os.path.join(self.install_dir, 'PyObjCTest', fn)] = 1
+
+
return result
class pyobjc_build_ext (build_ext.build_ext):
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first