diff --git a/pkgs/sagemath-objects/setup.py b/pkgs/sagemath-objects/setup.py index 907cabef839..ad114fa0de1 100644 --- a/pkgs/sagemath-objects/setup.py +++ b/pkgs/sagemath-objects/setup.py @@ -14,41 +14,28 @@ import sys sys.path.insert(0, os.path.dirname(__file__)) -if len(sys.argv) > 1 and (sys.argv[1] == "sdist" or sys.argv[1] == "egg_info"): - sdist = True -else: - sdist = False - -if sdist: - cmdclass = {} -else: - from sage_setup.excepthook import excepthook - sys.excepthook = excepthook - - from sage_setup.setenv import setenv - setenv() - - import sage.env - sage.env.default_required_modules = sage.env.default_optional_modules = () - - from sage_setup.command.sage_build_cython import sage_build_cython - from sage_setup.command.sage_build_ext import sage_build_ext - - cmdclass = dict(build_cython=sage_build_cython, - build_ext=sage_build_ext) - -if sdist: - python_packages = [] - python_modules = [] - cython_modules = [] -else: - from sage_setup.find import find_python_sources - python_packages, python_modules, cython_modules = find_python_sources( - '.', ['sage']) # for now, we do the filtering using MANIFEST - - log.warn('python_packages = {0}'.format(python_packages)) - log.warn('python_modules = {0}'.format(python_modules)) - log.warn('cython_modules = {0}'.format(cython_modules)) +from sage_setup.excepthook import excepthook +sys.excepthook = excepthook + +from sage_setup.setenv import setenv +setenv() + +import sage.env +sage.env.default_required_modules = sage.env.default_optional_modules = () + +from sage_setup.command.sage_build_cython import sage_build_cython +from sage_setup.command.sage_build_ext import sage_build_ext + +cmdclass = dict(build_cython=sage_build_cython, + build_ext=sage_build_ext) + +from sage_setup.find import find_python_sources +python_packages, python_modules, cython_modules = find_python_sources( + '.', ['sage']) # for now, we do the filtering using MANIFEST + +log.warn('python_packages = {0}'.format(python_packages)) +log.warn('python_modules = {0}'.format(python_modules)) +log.warn('cython_modules = {0}'.format(cython_modules)) setup( cmdclass = cmdclass, diff --git a/pkgs/sagemath-standard/setup.py b/pkgs/sagemath-standard/setup.py index d03b63400f6..975f89b5905 100755 --- a/pkgs/sagemath-standard/setup.py +++ b/pkgs/sagemath-standard/setup.py @@ -39,28 +39,20 @@ ### Configuration ######################################################### -if len(sys.argv) > 1 and (sys.argv[1] in ["sdist", "egg_info", "dist_info"]): - sdist = True -else: - sdist = False +from sage_setup.excepthook import excepthook +sys.excepthook = excepthook -if sdist: - cmdclass = {} -else: - from sage_setup.excepthook import excepthook - sys.excepthook = excepthook +from sage_setup.setenv import setenv +setenv() - from sage_setup.setenv import setenv - setenv() +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 - 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_cython=sage_build_cython, - build_ext=sage_build_ext, - develop=sage_develop, - install=sage_install_and_clean) +cmdclass = dict(build_cython=sage_build_cython, + build_ext=sage_build_ext, + develop=sage_develop, + install=sage_install_and_clean) ######################################################### ### Testing related stuff @@ -75,41 +67,39 @@ ### Discovering Sources ######################################################### -if sdist: - # No need to compute distributions. This avoids a dependency on Cython - # just to make an sdist. - distributions = None - python_packages = [] - python_modules = [] - cython_modules = [] -else: +if any(x in sys.argv + for x in ['build', 'bdist_wheel', 'install']): 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() - from sage.misc.package import is_package_installed_and_updated - distributions = [''] - optional_packages_with_extensions = ['mcqd', 'bliss', 'tdlib', - 'coxeter3', 'sirocco', 'meataxe'] - distributions += ['sagemath-{}'.format(pkg) - for pkg in optional_packages_with_extensions - if is_package_installed_and_updated(pkg)] - log.warn('distributions = {0}'.format(distributions)) - from sage_setup.find import find_python_sources - python_packages, python_modules, cython_modules = find_python_sources( - SAGE_SRC, ['sage'], distributions=distributions) - - log.debug('python_packages = {0}'.format(python_packages)) - print("Discovered Python/Cython sources, time: %.2f seconds." % (time.time() - t)) +# TODO: This should be quiet by default +print("Discovering Python/Cython source code....") +t = time.time() +distributions = [''] +from sage.misc.package import is_package_installed_and_updated +optional_packages_with_extensions = ['mcqd', 'bliss', 'tdlib', + 'coxeter3', 'sirocco', 'meataxe'] +distributions += ['sagemath-{}'.format(pkg) + for pkg in optional_packages_with_extensions + if is_package_installed_and_updated(pkg)] +log.warn('distributions = {0}'.format(distributions)) +from sage_setup.find import find_python_sources, find_extra_files +python_packages, python_modules, cython_modules = find_python_sources( + SAGE_SRC, ['sage'], distributions=distributions) + +log.debug('python_packages = {0}'.format(python_packages)) +log.debug('python_modules = {0}'.format(python_modules)) +log.debug('cython_modules = {0}'.format(cython_modules)) + +print("Discovered Python/Cython sources, time: %.2f seconds." % (time.time() - t)) ######################################################### ### Distutils ######################################################### code = setup( - packages = python_packages, - cmdclass = cmdclass, - ext_modules = cython_modules) + packages=python_packages, + cmdclass=cmdclass, + ext_modules=cython_modules, +) diff --git a/src/MANIFEST.in b/src/MANIFEST.in index 3a63d07fc32..cf90162a5ef 100644 --- a/src/MANIFEST.in +++ b/src/MANIFEST.in @@ -1,3 +1,7 @@ +include VERSION.txt + +global-include *.pxi *.pxd *.h *.hpp + prune sage/ext/interpreters # In particular, __init__.py must not be present in the distribution; or sage_setup.autogen.interpreters.rebuild will not generate the code prune sage_setup prune sage_docbuild @@ -36,6 +40,10 @@ include sage/stats/distributions/dgs_bern.c include sage/stats/distributions/dgs_gauss_dp.c include sage/stats/distributions/dgs_gauss_mp.c include sage/symbolic/ginac/*.cpp +# Also actual C++ source files. +include sage/geometry/triangulation/triangulations.cc +include sage/geometry/triangulation/data.cc +include sage/geometry/triangulation/functions.cc global-exclude __pycache__ global-exclude *.py[co] diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py index 79a4b06ebd6..a163383ebb1 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py @@ -52,7 +52,6 @@ class initialization directly. # https://www.gnu.org/licenses/ # **************************************************************************** -from typing_extensions import final from sage.arith.misc import is_prime from sage.calculus.functions import jacobian from sage.categories.fields import Fields