Re: python module not installed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 13, 2014 at 07:03:19PM -0300, "Germán A. Racca" wrote:
> On 03/13/2014 06:57 PM, Toshio Kuratomi wrote:
>
> >I got busy but I started taking a look.  It seems like the build scripts for
> >that package (it's setup.py) are overriding some of the standard distutils
> >commands with ones from astropy.  I need to look at those and see if they're
> >what's causing this issue.
> >
> >-Toshio
> 
> Thanks for your time. If you prefer, you can contact me via IRC in
> Fedora channels, my nick is skytux.
> 
Okay, it looks like it is a bug in astropy.

I'm attaching a patch that I applied to astropy that got the build working.
I don't have a deep understanding of setuptools and distutils internals, so
I'm not sure if the patch is correct or just is a good starting point for
getting the code fixed.

-Toshio
Index: astropy-0.3/astropy/setup_helpers.py
===================================================================
--- astropy-0.3.orig/astropy/setup_helpers.py
+++ astropy-0.3/astropy/setup_helpers.py
@@ -28,6 +28,8 @@ from distutils.core import Command
 from distutils.command.sdist import sdist as DistutilsSdist
 from setuptools.command.build_ext import build_ext as SetuptoolsBuildExt
 from setuptools.command.build_py import build_py as SetuptoolsBuildPy
+from setuptools.command.install import install as SetuptoolsInstall
+from setuptools.command.install_lib import install_lib as SetuptoolsInstallLib
 
 from setuptools.command.register import register as SetuptoolsRegister
 from setuptools import find_packages
@@ -373,6 +375,8 @@ def register_commands(package, version,
 
          # We have a custom build_py to generate the default configuration file
          'build_py': AstropyBuildPy,
+         'install': AstropyInstall,
+         'install_lib': AstropyInstallLib,
 
          'register': AstropyRegister
     }
@@ -542,6 +546,19 @@ def generate_build_ext_command(packagena
     return type('build_ext', (basecls, object), attrs)
 
 
+class AstropyInstall(SetuptoolsInstall):
+
+    def finalize_options(self):
+        self.build_lib = 'build/lib.linux-x86_64-2.7/'
+        SetuptoolsInstall.finalize_options(self)
+
+
+class AstropyInstallLib(SetuptoolsInstallLib):
+
+    def finalize_options(self):
+        self.build_dir = 'build/lib.linux-x86_64-2.7/'
+        SetuptoolsInstallLib.finalize_options(self)
+
 class AstropyBuildPy(SetuptoolsBuildPy):
 
     def finalize_options(self):
@@ -558,13 +575,6 @@ class AstropyBuildPy(SetuptoolsBuildPy):
         build_cmd.build_purelib = build_purelib
         build_cmd.build_lib = build_purelib
 
-        # Ugly hack: We also need to 'fix' the build_lib option on the
-        # install command--it would be better just to override that command
-        # entirely, but we can get around that extra effort by doing it here
-        install_cmd = self.get_finalized_command('install')
-        install_cmd.build_lib = build_purelib
-        install_lib_cmd = self.get_finalized_command('install_lib')
-        install_lib_cmd.build_dir = build_purelib
         self.build_lib = build_purelib
         SetuptoolsBuildPy.finalize_options(self)
 

Attachment: pgpiukRj_Qv3Q.pgp
Description: PGP signature

--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux