Commits

Ronald Oussoren committed 0d8bee9

Ensure that pyobjc-core is pip installable

Without this patch you cannot install pyobjc-core using pip because
pip assumes that 'egg_info' in setup.py refers to the setuptools command
module, before this patch 'egg_info' was a local class in setup.py.

Patch by Marc Abramowitz

Comments (0)

Files changed (2)

pyobjc-core/NEWS.txt

 Version 2.4  (or 3.0)
 ---------------------
 
+- Workaround for bug in pip that resulted in pyobjc-core not being pip
+  installable.  Patch by Marc Abramowitz.
+
 - Creating new formal protocols now uses the new runtime API that was
   introduced in OSX 10.7. Because of this it is now possible to create
   new formal protocols in 64-bit code (when running on OSX 10.7 or later)

pyobjc-core/setup.py

         finally:
             self.remove_from_sys_path()
 
-from setuptools.command import egg_info as orig_egg_info
+from setuptools.command import egg_info
 
 def write_header(cmd, basename, filename):
     data = open(os.path.join('Modules/objc/', os.path.basename(basename)), 'rU').read()
 # call, but those don't work when also using a package_base
 # argument as we do.
 # (issue 123 in the distribute tracker)
-class egg_info (orig_egg_info.egg_info):
+class my_egg_info (egg_info.egg_info):
     def run(self):
-        orig_egg_info.egg_info.run(self)
+        egg_info.egg_info.run(self)
 
         for hdr in ("pyobjc-compat.h", "pyobjc-api.h"):
             fn = os.path.join("include", hdr)
     namespace_packages = ['PyObjCTools'],
     package_dir = { '': 'Lib', 'PyObjCTest': 'PyObjCTest' },
     extra_path = "PyObjC",
-    cmdclass = {'build_ext': pyobjc_build_ext, 'install_lib': pyobjc_install_lib, 'build_py': oc_build_py, 'test': oc_test, 'egg_info':egg_info },
+    cmdclass = {'build_ext': pyobjc_build_ext, 'install_lib': pyobjc_install_lib, 'build_py': oc_build_py, 'test': oc_test, 'egg_info':my_egg_info },
     options = {'egg_info': {'egg_base': 'Lib'}},
     classifiers = CLASSIFIERS,
     license = 'MIT License',