diff --git a/pkgs/sagemath-standard/setup.py b/pkgs/sagemath-standard/setup.py index 7ac2294b609..368fad8b037 100755 --- a/pkgs/sagemath-standard/setup.py +++ b/pkgs/sagemath-standard/setup.py @@ -44,13 +44,11 @@ from sage_setup.setenv import setenv setenv() - from sage_setup.command.sage_build import sage_build from sage_setup.command.sage_build_cython import sage_build_cython from sage_setup.command.sage_build_ext import sage_build_ext from sage_setup.command.sage_install import sage_develop, sage_install_and_clean - cmdclass = dict(build=sage_build, - build_cython=sage_build_cython, + cmdclass = dict(build_cython=sage_build_cython, build_ext=sage_build_ext, develop=sage_develop, install=sage_install_and_clean) @@ -76,6 +74,10 @@ python_modules = [] cython_modules = [] else: + log.info("Generating auto-generated sources") + from sage_setup.autogen import autogen_all + autogen_all() + # TODO: This should be quiet by default print("Discovering Python/Cython source code....") t = time.time() diff --git a/src/sage_setup/command/sage_build.py b/src/sage_setup/command/sage_build.py deleted file mode 100644 index 229af4292fb..00000000000 --- a/src/sage_setup/command/sage_build.py +++ /dev/null @@ -1,37 +0,0 @@ -# Import setuptools before importing distutils, so that setuptools -# can replace distutils by its own vendored copy. -import setuptools - -from distutils import log -from distutils.command.build import build - -class sage_build(build): - sub_commands = [('build_cython', lambda *args: True)] + build.sub_commands - - def run_autogen(self): - """ - Generate auto-generated sources. - - This must be done before building the python modules, - see :trac:`22106`. - """ - from sage_setup.autogen import autogen_all - from sage_setup.find import find_python_sources - from sage.env import SAGE_SRC - - log.info("Generating auto-generated sources") - - pkgs = autogen_all() - python_packages, python_modules, cython_modules = find_python_sources( - SAGE_SRC, [ pkg.replace('.', '/') for pkg in pkgs]) - - for pkg in python_packages: - if pkg not in self.distribution.packages: - self.distribution.packages.append(pkg) - - for cython_module in cython_modules: - self.distribution.ext_modules.append(cython_module) - - def run(self): - self.run_autogen() - build.run(self)