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)