From d811ba566fa703874509a4cbc2e7f835c0938d58 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Oct 2023 12:33:27 -0700 Subject: [PATCH 1/5] pkgs/sagemath-objects/pyproject.toml.m4: Move metadata here from setup.cfg.m4 --- m4/pyproject_toml_metadata.m4 | 20 +++++++++++++++ pkgs/sagemath-objects/pyproject.toml.m4 | 34 +++++++++++++++++++++++++ pkgs/sagemath-objects/setup.cfg.m4 | 31 ---------------------- 3 files changed, 54 insertions(+), 31 deletions(-) create mode 100644 m4/pyproject_toml_metadata.m4 delete mode 100644 pkgs/sagemath-objects/setup.cfg.m4 diff --git a/m4/pyproject_toml_metadata.m4 b/m4/pyproject_toml_metadata.m4 new file mode 100644 index 00000000000..2511fac45f7 --- /dev/null +++ b/m4/pyproject_toml_metadata.m4 @@ -0,0 +1,20 @@ +dnl Standard metadata of SageMath distribution packages +dnl +license = {text = "GNU General Public License (GPL) v2 or later"} +authors = [{name = "The Sage Developers", email = "sage-support@googlegroups.com"}] +classifiers = [ + "Development Status :: 6 - Mature", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: POSIX", + "Operating System :: MacOS :: MacOS X", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering :: Mathematics", +] +urls = {Homepage = "https://www.sagemath.org"} +requires-python = ">=3.9, <3.12" diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index d8fda57a8f8..1db2cee5257 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -11,3 +11,37 @@ requires = [ SPKG_INSTALL_REQUIRES_cysignals ] build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-objects" +description = "Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses" +dependencies = [ + SPKG_INSTALL_REQUIRES_gmpy2 + SPKG_INSTALL_REQUIRES_cysignals +] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4`) + +[project.optional-dependencies] +# Currently we do not use the sage doctester to test sagemath-objects, +# so we do not list sagemath-repl here. +test = [] + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} + +[tool.setuptools.package-data] +"sage.cpython" = [ + "pyx_visit.h", + "string_impl.h", + "cython_metaclass.h", + "python_debug.h", +] +"sage.rings" = ["integer_fake.h"] diff --git a/pkgs/sagemath-objects/setup.cfg.m4 b/pkgs/sagemath-objects/setup.cfg.m4 deleted file mode 100644 index 894c07b5bbf..00000000000 --- a/pkgs/sagemath-objects/setup.cfg.m4 +++ /dev/null @@ -1,31 +0,0 @@ -# -*- conf-unix -*- -[metadata] -name = sagemath-objects -version = file: VERSION.txt -description = Sage: Open Source Mathematics Software: Sage objects, elements, parents, categories, coercion, metaclasses -long_description = file: README.rst -long_description_content_type = text/x-rst -include(`setup_cfg_metadata.m4')dnl' - -[options] -include(`sage_spkg_versions.m4')dnl' -python_requires = >=3.9, <3.12 -install_requires = - SPKG_INSTALL_REQUIRES_gmpy2 - SPKG_INSTALL_REQUIRES_cysignals - -[options.extras_require] -# Currently we do not use the sage doctester to test sagemath-objects, -# so we do not list sagemath-repl here. -test = - - -[options.package_data] -sage.cpython = - pyx_visit.h - string_impl.h - cython_metaclass.h - python_debug.h - -sage.rings = - integer_fake.h From 24d2da2451a7017fef312461a0b93ac3ef0d93d2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Oct 2023 12:39:29 -0700 Subject: [PATCH 2/5] pkgs/sagemath-categories/pyproject.toml.m4: Move metadata here from setup.cfg.m4 --- pkgs/sagemath-categories/pyproject.toml.m4 | 24 ++++++++++++++++++++++ pkgs/sagemath-categories/setup.cfg.m4 | 16 --------------- 2 files changed, 24 insertions(+), 16 deletions(-) delete mode 100644 pkgs/sagemath-categories/setup.cfg.m4 diff --git a/pkgs/sagemath-categories/pyproject.toml.m4 b/pkgs/sagemath-categories/pyproject.toml.m4 index cf4c97f1fd1..4e4b8582516 100644 --- a/pkgs/sagemath-categories/pyproject.toml.m4 +++ b/pkgs/sagemath-categories/pyproject.toml.m4 @@ -12,3 +12,27 @@ requires = [ SPKG_INSTALL_REQUIRES_cysignals ] build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-categories" +description = "Sage: Open Source Mathematics Software: Sage categories and basic rings" +dependencies = [ + SPKG_INSTALL_REQUIRES_sagemath_objects +] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4`) + +[project.optional-dependencies] +test = [ + SPKG_INSTALL_REQUIRES_sagemath_repl +] + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} diff --git a/pkgs/sagemath-categories/setup.cfg.m4 b/pkgs/sagemath-categories/setup.cfg.m4 deleted file mode 100644 index f5eb7c72968..00000000000 --- a/pkgs/sagemath-categories/setup.cfg.m4 +++ /dev/null @@ -1,16 +0,0 @@ -include(`sage_spkg_versions.m4')dnl' -*- conf-unix -*- -[metadata] -name = sagemath-categories -version = file: VERSION.txt -description = Sage: Open Source Mathematics Software: Sage categories and basic rings -long_description = file: README.rst -long_description_content_type = text/x-rst -include(`setup_cfg_metadata.m4')dnl' - -[options] -python_requires = >=3.9, <3.12 -install_requires = - SPKG_INSTALL_REQUIRES_sagemath_objects - -[options.extras_require] -test = SPKG_INSTALL_REQUIRES_sagemath_repl From be9f37de7fbb7fe1e048c1c98bf64abf8137ca95 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Oct 2023 13:17:22 -0700 Subject: [PATCH 3/5] pkgs/sagemath-environment/pyproject.toml.m4: Move metadata here from setup.cfg.m4 --- pkgs/sagemath-environment/pyproject.toml.m4 | 54 +++++++++++++++++ pkgs/sagemath-environment/setup.cfg.m4 | 66 --------------------- 2 files changed, 54 insertions(+), 66 deletions(-) delete mode 100644 pkgs/sagemath-environment/setup.cfg.m4 diff --git a/pkgs/sagemath-environment/pyproject.toml.m4 b/pkgs/sagemath-environment/pyproject.toml.m4 index fb2db955ed5..b2afd2277b5 100644 --- a/pkgs/sagemath-environment/pyproject.toml.m4 +++ b/pkgs/sagemath-environment/pyproject.toml.m4 @@ -6,3 +6,57 @@ requires = [ SPKG_INSTALL_REQUIRES_wheel ] build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-environment" +description = "Sage: Open Source Mathematics Software: System and software environment" +dependencies = [] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4`) + +[project.optional-dependencies] +conf = [SPKG_INSTALL_REQUIRES_sage_conf] # sage.env can optionally use sage_conf +docbuild = [SPKG_INSTALL_REQUIRES_sage_docbuild] # For "sage --docbuild" +sage = [SPKG_INSTALL_REQUIRES_sagelib] # For "sage", "sage -t", ... +cython = [SPKG_INSTALL_REQUIRES_cython] # For "sage --cython" +pytest = [SPKG_INSTALL_REQUIRES_pytest] # For "sage --pytest" +rst2ipynb = [SPKG_INSTALL_REQUIRES_rst2ipynb] # For "sage --rst2ipynb" +tox = [SPKG_INSTALL_REQUIRES_tox] # For "sage --tox" +sws2rst = [SPKG_INSTALL_REQUIRES_sage_sws2rst] # For "sage --sws2rst" + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[tool.setuptools] +py-modules = [ + "sage.all__sagemath_environment", + "sage.env", + "sage.version", + "sage.misc.all__sagemath_environment", + "sage.misc.package", + "sage.misc.package_dir", + "sage.misc.temporary_file", + "sage.misc.viewer", +] +packages = ["sage.features"] +script-files = [ + # The sage script + "bin/sage", + # Auxiliary scripts for setting up the environment + "bin/sage-env", + "bin/sage-num-threads.py", + "bin/sage-venv-config", + "bin/sage-version.sh", + # Auxiliary script for invoking Python in the Sage environment + "bin/sage-python", + # Not included: + # - bin/sage-env-config -- installed by sage_conf + # - bin/sage-env-config.in -- not to be installed + # - bin/sage-run, bin/sage-runtests, ... -- installed by sagemath-repl + # - bin/sage-ipython -- uses sage.repl, so installed by sagemath-repl +] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} diff --git a/pkgs/sagemath-environment/setup.cfg.m4 b/pkgs/sagemath-environment/setup.cfg.m4 deleted file mode 100644 index 9e5bb31eeb7..00000000000 --- a/pkgs/sagemath-environment/setup.cfg.m4 +++ /dev/null @@ -1,66 +0,0 @@ -include(`sage_spkg_versions.m4')dnl' -*- conf-unix -*- -[metadata] -name = sagemath-environment -version = file: VERSION.txt -description = Sage: Open Source Mathematics Software: System and software environment -long_description = file: README.rst -long_description_content_type = text/x-rst -include(`setup_cfg_metadata.m4')dnl' - -[options] -python_requires = >=3.9, <3.12 -install_requires = - -py_modules = - sage.all__sagemath_environment - sage.env - sage.version - sage.misc.all__sagemath_environment - sage.misc.package - sage.misc.package_dir - sage.misc.temporary_file - sage.misc.viewer - -packages = - sage.features - -scripts = - # The sage script - bin/sage - # Auxiliary scripts for setting up the environment - bin/sage-env - bin/sage-num-threads.py - bin/sage-venv-config - bin/sage-version.sh - # Auxiliary script for invoking Python in the Sage environment - bin/sage-python - # Not included: - # - bin/sage-env-config -- installed by sage_conf - # - bin/sage-env-config.in -- not to be installed - # - bin/sage-run, bin/sage-runtests, ... -- installed by sagemath-repl - # - bin/sage-ipython -- uses sage.repl, so installed by sagemath-repl - -[options.extras_require] -# sage.env can optionally use sage_conf -conf = SPKG_INSTALL_REQUIRES_sage_conf - -# For "sage --docbuild" -docbuild = SPKG_INSTALL_REQUIRES_sage_docbuild - -# For "sage", "sage -t", ... -sage = SPKG_INSTALL_REQUIRES_sagelib - -# For "sage --cython" -cython = SPKG_INSTALL_REQUIRES_cython - -# For "sage --pytest" -pytest = SPKG_INSTALL_REQUIRES_pytest - -# For "sage --rst2ipynb" -rst2ipynb = SPKG_INSTALL_REQUIRES_rst2ipynb - -# For "sage --tox" -tox = SPKG_INSTALL_REQUIRES_tox - -# For "sage --sws2rst" -sws2rst = SPKG_INSTALL_REQUIRES_sage_sws2rst From 48d7ff9c1e76a801eb809807132b163cc8d87891 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Oct 2023 13:28:35 -0700 Subject: [PATCH 4/5] pkgs/sagemath-repl/pyproject.toml.m4: Move metadata here from setup.cfg.m4 --- pkgs/sagemath-repl/pyproject.toml.m4 | 66 ++++++++++++++++++++++++++++ pkgs/sagemath-repl/setup.cfg.m4 | 64 --------------------------- 2 files changed, 66 insertions(+), 64 deletions(-) delete mode 100644 pkgs/sagemath-repl/setup.cfg.m4 diff --git a/pkgs/sagemath-repl/pyproject.toml.m4 b/pkgs/sagemath-repl/pyproject.toml.m4 index fb2db955ed5..1abe5ec0465 100644 --- a/pkgs/sagemath-repl/pyproject.toml.m4 +++ b/pkgs/sagemath-repl/pyproject.toml.m4 @@ -6,3 +6,69 @@ requires = [ SPKG_INSTALL_REQUIRES_wheel ] build-backend = "setuptools.build_meta" + +[project] +name = "sagemath-repl" +description = "Sage: Open Source Mathematics Software: IPython kernel, Sage preparser, doctester" +dependencies = [ + SPKG_INSTALL_REQUIRES_sagemath_objects + SPKG_INSTALL_REQUIRES_sagemath_environment + SPKG_INSTALL_REQUIRES_ipython + SPKG_INSTALL_REQUIRES_ipywidgets +] +dynamic = ["version"] +include(`pyproject_toml_metadata.m4`) + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[tool.setuptools] +py-modules = [ + "sage.all__sagemath_repl", + "sage.misc.all__sagemath_repl", + "sage.misc.banner", + "sage.misc.sagedoc", + "sage.misc.sage_input", + "sage.misc.sage_eval", +] +packages = [ + "sage.doctest", + "sage.repl", + "sage.repl.display", + "sage.repl.ipython_kernel", + "sage.repl.rich_output", +] +script-files = [ + # Other scripts that should be in the path also for OS packaging of sage: + "bin/sage-eval", + # Included because it is useful for doctesting/coverage testing user scripts too: + "bin/sage-runtests", + "bin/sage-fixdoctests", + "bin/sage-coverage", + # Helper scripts invoked by sage script + # (they would actually belong to something like libexec) + "bin/sage-cachegrind", + "bin/sage-callgrind", + "bin/sage-massif", + "bin/sage-omega", + "bin/sage-valgrind", + "bin/sage-cleaner", + # Uncategorized scripts in alphabetical order + "bin/sage-inline-fortran", + "bin/sage-ipynb2rst", + "bin/sage-ipython", + "bin/sage-notebook", + "bin/sage-preparse", + "bin/sage-run", + "bin/sage-run-cython", + "bin/sage-startuptime.py", +] +include-package-data = false + +[tool.setuptools.dynamic] +version = {file = ["VERSION.txt"]} + +[tool.setuptools.package-data] +"sage.doctest" = ["tests/*"] +"sage.repl.rich_output" = ["example*"] diff --git a/pkgs/sagemath-repl/setup.cfg.m4 b/pkgs/sagemath-repl/setup.cfg.m4 deleted file mode 100644 index f71d7bf6c2a..00000000000 --- a/pkgs/sagemath-repl/setup.cfg.m4 +++ /dev/null @@ -1,64 +0,0 @@ -include(`sage_spkg_versions.m4')dnl' -*- conf-unix -*- -[metadata] -name = sagemath-repl -version = file: VERSION.txt -description = Sage: Open Source Mathematics Software: System and software environment -long_description = file: README.rst -long_description_content_type = text/x-rst -include(`setup_cfg_metadata.m4')dnl' - -[options] -python_requires = >=3.9, <3.12 -install_requires = - SPKG_INSTALL_REQUIRES_sagemath_objects - SPKG_INSTALL_REQUIRES_sagemath_environment - SPKG_INSTALL_REQUIRES_ipython - SPKG_INSTALL_REQUIRES_ipywidgets - -py_modules = - sage.all__sagemath_repl - sage.misc.all__sagemath_repl - sage.misc.banner - sage.misc.sagedoc - sage.misc.sage_input - sage.misc.sage_eval - -packages = - sage.doctest - sage.repl - sage.repl.display - sage.repl.ipython_kernel - sage.repl.rich_output - -scripts = - # Other scripts that should be in the path also for OS packaging of sage: - bin/sage-eval - # Included because it is useful for doctesting/coverage testing user scripts too: - bin/sage-runtests - bin/sage-fixdoctests - bin/sage-coverage - # Helper scripts invoked by sage script - # (they would actually belong to something like libexec) - bin/sage-cachegrind - bin/sage-callgrind - bin/sage-massif - bin/sage-omega - bin/sage-valgrind - bin/sage-cleaner - # Uncategorized scripts in alphabetical order - bin/sage-inline-fortran - bin/sage-ipynb2rst - bin/sage-ipython - bin/sage-notebook - bin/sage-preparse - bin/sage-run - bin/sage-run-cython - bin/sage-startuptime.py - -[options.package_data] - -sage.doctest = - tests/* - -sage.repl.rich_output = - example* From 3f236fea961bf2bf9b4276909e7432f661ef3f80 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 28 Oct 2023 14:23:04 -0700 Subject: [PATCH 5/5] Fix m4 syntax --- pkgs/sagemath-categories/pyproject.toml.m4 | 2 +- pkgs/sagemath-environment/pyproject.toml.m4 | 2 +- pkgs/sagemath-objects/pyproject.toml.m4 | 2 +- pkgs/sagemath-repl/pyproject.toml.m4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/sagemath-categories/pyproject.toml.m4 b/pkgs/sagemath-categories/pyproject.toml.m4 index 4e4b8582516..94277dccc0e 100644 --- a/pkgs/sagemath-categories/pyproject.toml.m4 +++ b/pkgs/sagemath-categories/pyproject.toml.m4 @@ -20,7 +20,7 @@ dependencies = [ SPKG_INSTALL_REQUIRES_sagemath_objects ] dynamic = ["version"] -include(`pyproject_toml_metadata.m4`) +include(`pyproject_toml_metadata.m4')dnl' [project.optional-dependencies] test = [ diff --git a/pkgs/sagemath-environment/pyproject.toml.m4 b/pkgs/sagemath-environment/pyproject.toml.m4 index b2afd2277b5..4061c8c46eb 100644 --- a/pkgs/sagemath-environment/pyproject.toml.m4 +++ b/pkgs/sagemath-environment/pyproject.toml.m4 @@ -12,7 +12,7 @@ name = "sagemath-environment" description = "Sage: Open Source Mathematics Software: System and software environment" dependencies = [] dynamic = ["version"] -include(`pyproject_toml_metadata.m4`) +include(`pyproject_toml_metadata.m4')dnl' [project.optional-dependencies] conf = [SPKG_INSTALL_REQUIRES_sage_conf] # sage.env can optionally use sage_conf diff --git a/pkgs/sagemath-objects/pyproject.toml.m4 b/pkgs/sagemath-objects/pyproject.toml.m4 index 1db2cee5257..ce80e0fea5d 100644 --- a/pkgs/sagemath-objects/pyproject.toml.m4 +++ b/pkgs/sagemath-objects/pyproject.toml.m4 @@ -20,7 +20,7 @@ dependencies = [ SPKG_INSTALL_REQUIRES_cysignals ] dynamic = ["version"] -include(`pyproject_toml_metadata.m4`) +include(`pyproject_toml_metadata.m4')dnl' [project.optional-dependencies] # Currently we do not use the sage doctester to test sagemath-objects, diff --git a/pkgs/sagemath-repl/pyproject.toml.m4 b/pkgs/sagemath-repl/pyproject.toml.m4 index 1abe5ec0465..dfdfb692c9b 100644 --- a/pkgs/sagemath-repl/pyproject.toml.m4 +++ b/pkgs/sagemath-repl/pyproject.toml.m4 @@ -17,7 +17,7 @@ dependencies = [ SPKG_INSTALL_REQUIRES_ipywidgets ] dynamic = ["version"] -include(`pyproject_toml_metadata.m4`) +include(`pyproject_toml_metadata.m4')dnl' [project.readme] file = "README.rst"