Commits

Ronald Oussoren  committed cd6d756

Generic setup.py; don't hardcode setuptools/distribute versions

  • Participants
  • Parent commits 9c291a8
  • Branches pyobjc-ancient

Comments (0)

Files changed (2)

File pyobjc-framework-ScreenSaver/Lib/ScreenSaver/PyObjC.bridgesupport

   <depends_on path='/System/Library/Frameworks/AppKit.framework/AppKit' />
   <depends_on path='/System/Library/Frameworks/Foundation.framework/Foundation' />
   <function inline='true' name='SSCenteredRectInRect'>
-    <retval type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{_NSRect={_NSPoint=dd}{_NSSize=dd}}' />
-    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' />
-    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' />
+    <retval type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{CGRect={CGPoint=dd}{CGSize=dd}}' />
+    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{CGRect={CGPoint=dd}{CGSize=dd}}' />
+    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{CGRect={CGPoint=dd}{CGSize=dd}}' />
   </function>
   <function inline='true' name='SSRandomFloatBetween'>
     <retval type='f' />
     <arg type='i' />
   </function>
   <function inline='true' name='SSRandomPointForSizeWithinRect'>
-    <retval type='{_NSPoint=ff}' type64='{_NSPoint=dd}' />
-    <arg type='{_NSSize=ff}' type64='{_NSSize=ff}' />
-    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' />
+    <retval type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
+    <arg type='{_NSSize=ff}' type64='{CGSize=ff}' />
+    <arg type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{CGRect={CGPoint=dd}{CGSize=dd}}' />
   </function>
   <class name='ScreenSaverView'>
     <method selector='hasConfigureSheet'>

File pyobjc-framework-ScreenSaver/pyobjc_setup.py

 __all__ = ('setup', 'Extension', 'Command')
 
 import sys
-if sys.version_info[:2] < (3, 0):
-    import ez_setup
-    ez_setup.use_setuptools()
 
-    from setuptools.command.test import test as oc_test
-    from setuptools.command.build_py import build_py as oc_build_py
+try:
+    import setuptools
 
-    extra_args = {}
-
-
-else:
+except ImportError:
     import distribute_setup
     distribute_setup.use_setuptools()
 
-    from setuptools.command import test
-    from setuptools.command import build_py
+from setuptools.command import test
+from setuptools.command import build_py
 
-    from distutils import log
+from distutils import log
 
-    extra_args=dict(
-        use_2to3 = True,
-    )
+extra_args=dict(
+    use_2to3 = True,
+)
 
 
-    class oc_build_py (build_py.build_py):
-        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
+class oc_build_py (build_py.build_py):
+    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
 
 
 
-    class oc_test (test.test):
-        def run_tests(self):
-            import sys, os
+class oc_test (test.test):
+    def run_tests(self):
+        import sys, os
 
-            rootdir =  os.path.dirname(os.path.abspath(__file__))
-            if rootdir in sys.path:
-                sys.path.remove(rootdir)
+        rootdir =  os.path.dirname(os.path.abspath(__file__))
+        if rootdir in sys.path:
+            sys.path.remove(rootdir)
 
-            import PyObjCTest
-            import unittest
-            from pkg_resources import EntryPoint
-            loader_ep = EntryPoint.parse("x="+self.test_loader)
-            loader_class = loader_ep.load(require=False)
+        import PyObjCTest
+        import unittest
+        from pkg_resources import EntryPoint
+        loader_ep = EntryPoint.parse("x="+self.test_loader)
+        loader_class = loader_ep.load(require=False)
 
-            unittest.main(None, None, [unittest.__file__]+self.test_args, testLoader=loader_class())
+        unittest.main(None, None, [unittest.__file__]+self.test_args, testLoader=loader_class())