diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh
index 75737acf106..e3e0d5d170c 100755
--- a/.ci/write-dockerfile.sh
+++ b/.ci/write-dockerfile.sh
@@ -279,7 +279,7 @@ $ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
-$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
+$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/VERSION.txt /new/src/
$ADD m4 /new/m4
$ADD pkgs /new/pkgs
$ADD build /new/build
diff --git a/.gitignore b/.gitignore
index 70a6739c33b..754fb04cdf2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -185,19 +185,6 @@ __pycache__/
build/temp.*/
build/bin/sage-build-env-config
-# Generated files in build
-build/pkgs/cypari/version_requirements.txt
-build/pkgs/cysignals/version_requirements.txt
-build/pkgs/cython/version_requirements.txt
-build/pkgs/gmpy2/version_requirements.txt
-build/pkgs/jupyter_core/version_requirements.txt
-build/pkgs/memory_allocator/version_requirements.txt
-build/pkgs/numpy/version_requirements.txt
-build/pkgs/pkgconfig/version_requirements.txt
-build/pkgs/pplpy/version_requirements.txt
-build/pkgs/setuptools/version_requirements.txt
-build/pkgs/wheel/version_requirements.txt
-
# Generated files in the top-level source trees
/pkgs/*/build
/pkgs/*/dist
diff --git a/Makefile b/Makefile
index 53d2c689843..e7866190a63 100644
--- a/Makefile
+++ b/Makefile
@@ -178,17 +178,6 @@ bootstrap-clean:
rm -f src/Pipfile
rm -f src/requirements.txt
rm -f src/setup.cfg
- rm -f build/pkgs/cypari/version_requirements.txt
- rm -f build/pkgs/cysignals/version_requirements.txt
- rm -f build/pkgs/cython/version_requirements.txt
- rm -f build/pkgs/gmpy2/version_requirements.txt
- rm -f build/pkgs/jupyter_core/version_requirements.txt
- rm -f build/pkgs/memory_allocator/version_requirements.txt
- rm -f build/pkgs/numpy/version_requirements.txt
- rm -f build/pkgs/pkgconfig/version_requirements.txt
- rm -f build/pkgs/pplpy/version_requirements.txt
- rm -f build/pkgs/setuptools/version_requirements.txt
- rm -f build/pkgs/wheel/version_requirements.txt
# Remove absolutely everything which isn't part of the git repo
maintainer-clean: distclean bootstrap-clean
diff --git a/bootstrap b/bootstrap
index 5f04a1e208c..25a728de8d1 100755
--- a/bootstrap
+++ b/bootstrap
@@ -33,15 +33,6 @@ MAKE="${MAKE:-make}"
bootstrap () {
- for pkgname in cypari cysignals cython gmpy2 jupyter_core memory_allocator numpy pkgconfig pplpy setuptools wheel; do
- # Write the version_requirements.txt files for dependencies declared in pyproject.toml
- target=build/pkgs/${pkgname}/version_requirements.txt
- if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
- echo "bootstrap:$LINENO: installing '"$target"'"
- fi
- echo "# Generated by SAGE_ROOT/bootstrap based on src/pyproject.toml; do not edit directly" > $target
- sage-get-system-packages install-requires ${pkgname} >> $target
- done
for a in m4/sage_spkg_configures.m4 m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "bootstrap:$LINENO: installing '"$a"'"
@@ -232,19 +223,7 @@ save () {
src/environment-optional-3.[89].yml src/environment-optional-3.1[0-9].yml \
src/Pipfile \
src/pyproject.toml \
- src/requirements.txt \
- src/setup.cfg \
- build/pkgs/cypari/version_requirements.txt \
- build/pkgs/cysignals/version_requirements.txt \
- build/pkgs/cython/version_requirements.txt \
- build/pkgs/gmpy2/version_requirements.txt \
- build/pkgs/jupyter_core/version_requirements.txt \
- build/pkgs/memory_allocator/version_requirements.txt \
- build/pkgs/numpy/version_requirements.txt \
- build/pkgs/pkgconfig/version_requirements.txt \
- build/pkgs/pplpy/version_requirements.txt \
- build/pkgs/setuptools/version_requirements.txt \
- build/pkgs/wheel/version_requirements.txt
+ src/requirements.txt
# Update version; this re-computes the checksum
sage-package update configure "$NEWCONFVERSION"
diff --git a/build/bin/sage-get-system-packages b/build/bin/sage-get-system-packages
index f28e0356375..b65ab936ad7 100755
--- a/build/bin/sage-get-system-packages
+++ b/build/bin/sage-get-system-packages
@@ -101,9 +101,14 @@ for PKG_BASE in $SPKGS; do
*pyproject.toml)
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/$NAME
if [ -f "$SYSTEM_PACKAGES_FILE" ]; then
- # Extract from the "requires" block in src/pyproject.toml
+ # Extract from src/pyproject.toml:
+ # - from the "[build-system] requires" value
+ # - from "[project] dependencies",
+ # - from "[project.optional-dependencies]"
# Packages are in the format "'sage-conf ~= 10.3b3',"
- PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
+ # Accept dashes and underscores in package names as equivalent:
+ PKG_REGEX=$(echo $PKG_BASE | sed 's/[-_]/[-_]/g')
+ PACKAGE_INFO=$(sed -En '/(requires|dependencies|R) *= *\[/,/^\]/s/^ *'\''('$PKG_REGEX'.*)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml" | sort -u)
if [ -n "$PACKAGE_INFO" ]; then
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
[ $SYSTEM = versions ] || break
diff --git a/build/pkgs/conway_polynomials/version_requirements.txt b/build/pkgs/conway_polynomials/version_requirements.txt
index 308e934cef1..3283bb6c3ee 100644
--- a/build/pkgs/conway_polynomials/version_requirements.txt
+++ b/build/pkgs/conway_polynomials/version_requirements.txt
@@ -1 +1 @@
-conway-polynomials >=0.8
+conway-polynomials
diff --git a/build/pkgs/cypari/version_requirements.txt b/build/pkgs/cypari/version_requirements.txt
new file mode 100644
index 00000000000..dd37c156e1a
--- /dev/null
+++ b/build/pkgs/cypari/version_requirements.txt
@@ -0,0 +1 @@
+cypari2
diff --git a/build/pkgs/cysignals/version_requirements.txt b/build/pkgs/cysignals/version_requirements.txt
new file mode 100644
index 00000000000..3335306cb5b
--- /dev/null
+++ b/build/pkgs/cysignals/version_requirements.txt
@@ -0,0 +1 @@
+cysignals
diff --git a/build/pkgs/cython/version_requirements.txt b/build/pkgs/cython/version_requirements.txt
new file mode 100644
index 00000000000..f6629e02456
--- /dev/null
+++ b/build/pkgs/cython/version_requirements.txt
@@ -0,0 +1 @@
+cython
diff --git a/build/pkgs/fpylll/version_requirements.txt b/build/pkgs/fpylll/version_requirements.txt
index e040e7daa1e..8a3e3a7ecd0 100644
--- a/build/pkgs/fpylll/version_requirements.txt
+++ b/build/pkgs/fpylll/version_requirements.txt
@@ -1 +1 @@
-fpylll >=0.5.9
+fpylll
diff --git a/build/pkgs/gmpy2/version_requirements.txt b/build/pkgs/gmpy2/version_requirements.txt
new file mode 100644
index 00000000000..1777652f249
--- /dev/null
+++ b/build/pkgs/gmpy2/version_requirements.txt
@@ -0,0 +1 @@
+gmpy2
diff --git a/build/pkgs/importlib_metadata/version_requirements.txt b/build/pkgs/importlib_metadata/version_requirements.txt
index a093079f483..bbb07547a19 100644
--- a/build/pkgs/importlib_metadata/version_requirements.txt
+++ b/build/pkgs/importlib_metadata/version_requirements.txt
@@ -1,3 +1 @@
-# According to https://pypi.org/project/importlib-metadata/,
-# 4.13 provides the features of Python 3.11 importlib.metadata
-importlib_metadata >=4.13; python_version<"3.11"
+importlib_metadata
diff --git a/build/pkgs/importlib_resources/version_requirements.txt b/build/pkgs/importlib_resources/version_requirements.txt
index be3b17269df..58ad1bd3335 100644
--- a/build/pkgs/importlib_resources/version_requirements.txt
+++ b/build/pkgs/importlib_resources/version_requirements.txt
@@ -1,3 +1 @@
-# According to https://pypi.org/project/importlib-resources/,
-# version 5.7 provides the features of Python 3.11 importlib.resources
-importlib_resources >= 5.7; python_version<"3.11"
+importlib_resources
diff --git a/build/pkgs/ipykernel/version_requirements.txt b/build/pkgs/ipykernel/version_requirements.txt
index 5ceec358940..d919f6f3190 100644
--- a/build/pkgs/ipykernel/version_requirements.txt
+++ b/build/pkgs/ipykernel/version_requirements.txt
@@ -1 +1 @@
-ipykernel >=5.2.1
+ipykernel
diff --git a/build/pkgs/ipython/version_requirements.txt b/build/pkgs/ipython/version_requirements.txt
index a52df49c421..49a7ffe2a95 100644
--- a/build/pkgs/ipython/version_requirements.txt
+++ b/build/pkgs/ipython/version_requirements.txt
@@ -1 +1 @@
-ipython >=7.13.0
+ipython
diff --git a/build/pkgs/ipywidgets/version_requirements.txt b/build/pkgs/ipywidgets/version_requirements.txt
index 1e974c72842..f582a4a3283 100644
--- a/build/pkgs/ipywidgets/version_requirements.txt
+++ b/build/pkgs/ipywidgets/version_requirements.txt
@@ -1 +1 @@
-ipywidgets >=7.5.1
+ipywidgets
diff --git a/build/pkgs/jupyter_core/version_requirements.txt b/build/pkgs/jupyter_core/version_requirements.txt
new file mode 100644
index 00000000000..19df36408c9
--- /dev/null
+++ b/build/pkgs/jupyter_core/version_requirements.txt
@@ -0,0 +1 @@
+jupyter-core
diff --git a/build/pkgs/lrcalc_python/version_requirements.txt b/build/pkgs/lrcalc_python/version_requirements.txt
index 8b44d97f4b5..b854d5c73dd 100644
--- a/build/pkgs/lrcalc_python/version_requirements.txt
+++ b/build/pkgs/lrcalc_python/version_requirements.txt
@@ -1 +1 @@
-lrcalc ~=2.1
+lrcalc
diff --git a/build/pkgs/matplotlib/version_requirements.txt b/build/pkgs/matplotlib/version_requirements.txt
index 28e7a7d265b..6ccafc3f904 100644
--- a/build/pkgs/matplotlib/version_requirements.txt
+++ b/build/pkgs/matplotlib/version_requirements.txt
@@ -1,3 +1 @@
-# Issue #33642: Set lower bound for use of matplotlib color maps introduced in #33491,
-# and to suppress deprecation warnings (https://github.com/matplotlib/matplotlib/pull/21073)
-matplotlib >=3.5.1
+matplotlib
diff --git a/build/pkgs/memory_allocator/version_requirements.txt b/build/pkgs/memory_allocator/version_requirements.txt
new file mode 100644
index 00000000000..fad07b22ebe
--- /dev/null
+++ b/build/pkgs/memory_allocator/version_requirements.txt
@@ -0,0 +1 @@
+memory_allocator
diff --git a/build/pkgs/mpmath/version_requirements.txt b/build/pkgs/mpmath/version_requirements.txt
index 8c3f379fbd4..dda7c273a8d 100644
--- a/build/pkgs/mpmath/version_requirements.txt
+++ b/build/pkgs/mpmath/version_requirements.txt
@@ -1 +1 @@
-mpmath >=1.1.0, <1.4
+mpmath
diff --git a/build/pkgs/networkx/version_requirements.txt b/build/pkgs/networkx/version_requirements.txt
index 2ff86e7c737..4d07dfe2f85 100644
--- a/build/pkgs/networkx/version_requirements.txt
+++ b/build/pkgs/networkx/version_requirements.txt
@@ -1 +1 @@
-networkx >=2.4
+networkx
diff --git a/build/pkgs/numpy/version_requirements.txt b/build/pkgs/numpy/version_requirements.txt
new file mode 100644
index 00000000000..24ce15ab7ea
--- /dev/null
+++ b/build/pkgs/numpy/version_requirements.txt
@@ -0,0 +1 @@
+numpy
diff --git a/build/pkgs/pexpect/version_requirements.txt b/build/pkgs/pexpect/version_requirements.txt
index e89d50d66c3..808fb07afdc 100644
--- a/build/pkgs/pexpect/version_requirements.txt
+++ b/build/pkgs/pexpect/version_requirements.txt
@@ -1 +1 @@
-pexpect >=4.8.0
+pexpect
diff --git a/build/pkgs/pillow/version_requirements.txt b/build/pkgs/pillow/version_requirements.txt
index 7dbe09f5f5c..3868fb16b89 100644
--- a/build/pkgs/pillow/version_requirements.txt
+++ b/build/pkgs/pillow/version_requirements.txt
@@ -1 +1 @@
-pillow >=7.2.0
+pillow
diff --git a/build/pkgs/pkgconfig/version_requirements.txt b/build/pkgs/pkgconfig/version_requirements.txt
new file mode 100644
index 00000000000..549fd1bf164
--- /dev/null
+++ b/build/pkgs/pkgconfig/version_requirements.txt
@@ -0,0 +1 @@
+pkgconfig
diff --git a/build/pkgs/pplpy/version_requirements.txt b/build/pkgs/pplpy/version_requirements.txt
new file mode 100644
index 00000000000..a03a50a38f5
--- /dev/null
+++ b/build/pkgs/pplpy/version_requirements.txt
@@ -0,0 +1 @@
+pplpy
diff --git a/build/pkgs/ptyprocess/version_requirements.txt b/build/pkgs/ptyprocess/version_requirements.txt
index 4527bfdd3d1..57ebb2d6bdd 100644
--- a/build/pkgs/ptyprocess/version_requirements.txt
+++ b/build/pkgs/ptyprocess/version_requirements.txt
@@ -1 +1 @@
-ptyprocess > 0.5
+ptyprocess
diff --git a/build/pkgs/requests/version_requirements.txt b/build/pkgs/requests/version_requirements.txt
index 00427be38f3..f2293605cf1 100644
--- a/build/pkgs/requests/version_requirements.txt
+++ b/build/pkgs/requests/version_requirements.txt
@@ -1 +1 @@
-requests >=2.13.0
+requests
diff --git a/build/pkgs/rpy2/version_requirements.txt b/build/pkgs/rpy2/version_requirements.txt
index 769d7e61e92..8f389862688 100644
--- a/build/pkgs/rpy2/version_requirements.txt
+++ b/build/pkgs/rpy2/version_requirements.txt
@@ -1 +1 @@
-rpy2 >=3.3
+rpy2
diff --git a/build/pkgs/scipy/version_requirements.txt b/build/pkgs/scipy/version_requirements.txt
index 8f07730e208..9a635b910d9 100644
--- a/build/pkgs/scipy/version_requirements.txt
+++ b/build/pkgs/scipy/version_requirements.txt
@@ -1,7 +1 @@
-# 1.8 is known good version.
-# Per https://docs.scipy.org/doc/scipy/dev/core-dev/index.html#version-numbering
-# and https://docs.scipy.org/doc/scipy/dev/core-dev/index.html#deprecations,
-# deprecations cannot be introduced in micro releases.
-# SciPy devs wait "at least 6 months", "in practice two (minor) releases"
-# from deprecation to removal of a feature.
-scipy >=1.5
+scipy
diff --git a/build/pkgs/setuptools/version_requirements.txt b/build/pkgs/setuptools/version_requirements.txt
new file mode 100644
index 00000000000..49fe098d9e6
--- /dev/null
+++ b/build/pkgs/setuptools/version_requirements.txt
@@ -0,0 +1 @@
+setuptools
diff --git a/build/pkgs/six/version_requirements.txt b/build/pkgs/six/version_requirements.txt
index b5ddf568c87..ffe2fce4989 100644
--- a/build/pkgs/six/version_requirements.txt
+++ b/build/pkgs/six/version_requirements.txt
@@ -1 +1 @@
-six >=1.15.0
+six
diff --git a/build/pkgs/sympy/version_requirements.txt b/build/pkgs/sympy/version_requirements.txt
index 207de33a893..ded0ee75202 100644
--- a/build/pkgs/sympy/version_requirements.txt
+++ b/build/pkgs/sympy/version_requirements.txt
@@ -1 +1 @@
-sympy >=1.6, <2.0
+sympy
diff --git a/build/pkgs/typing_extensions/version_requirements.txt b/build/pkgs/typing_extensions/version_requirements.txt
index e1a912109ed..5fd4f05f341 100644
--- a/build/pkgs/typing_extensions/version_requirements.txt
+++ b/build/pkgs/typing_extensions/version_requirements.txt
@@ -1,3 +1 @@
-# According to https://github.com/python/typing_extensions/blob/main/CHANGELOG.md,
-# version 4.4.0 adds another Python 3.11 typing backport
-typing_extensions >= 4.4.0; python_version<'3.11'
+typing_extensions
diff --git a/build/pkgs/wheel/version_requirements.txt b/build/pkgs/wheel/version_requirements.txt
new file mode 100644
index 00000000000..2309722a93d
--- /dev/null
+++ b/build/pkgs/wheel/version_requirements.txt
@@ -0,0 +1 @@
+wheel
diff --git a/pkgs/sagemath-standard/setup.cfg b/pkgs/sagemath-standard/setup.cfg
deleted file mode 120000
index ba9b315730a..00000000000
--- a/pkgs/sagemath-standard/setup.cfg
+++ /dev/null
@@ -1 +0,0 @@
-../../src/setup.cfg
\ No newline at end of file
diff --git a/pkgs/sagemath-standard/setup.cfg.m4 b/pkgs/sagemath-standard/setup.cfg.m4
deleted file mode 120000
index 8934d7b5955..00000000000
--- a/pkgs/sagemath-standard/setup.cfg.m4
+++ /dev/null
@@ -1 +0,0 @@
-../../src/setup.cfg.m4
\ No newline at end of file
diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini
index 0ac97f8a021..da403c17dc2 100644
--- a/pkgs/sagemath-standard/tox.ini
+++ b/pkgs/sagemath-standard/tox.ini
@@ -17,7 +17,7 @@
[tox]
envlist =
# Build and test without using the concrete dependencies specified by requirements.txt,
- # using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only:
+ # using the dependencies declared in pyproject.toml (build-system requires, dependencies) only:
# Still use ONLY the wheels built and stored by the Sage distribution (no PyPI).
#
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)'
@@ -58,7 +58,7 @@ envlist =
#
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-pipenv-dist)'
#
- # Build using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only.
+ # Build using the dependencies declared in pyproject.toml (build-system requires, dependencies) only:
# Use the wheels built and stored by the Sage distribution,
# and additionally allow packages from PyPI.
#
diff --git a/src/Pipfile.m4 b/src/Pipfile.m4
index feca57f7de9..d03a2a12814 100644
--- a/src/Pipfile.m4
+++ b/src/Pipfile.m4
@@ -6,8 +6,8 @@ url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
-## We do not list packages that are already declared as install_requires
-## in setup.cfg
+## We do not list packages that are already declared as dependencies (install_requires)
+## in pyproject.toml
pycodestyle = "*"
tox = "*"
pytest = "*"
@@ -15,8 +15,8 @@ rope = "*"
six = "*"
[packages]
-## We do not list packages that are already declared as install_requires
-## in setup.cfg
+## We do not list packages that are already declared as dependencies (install_requires)
+## in pyproject.toml
[packages.e1839a8]
path = "."
diff --git a/src/doc/en/developer/coding_basics.rst b/src/doc/en/developer/coding_basics.rst
index 5e15c4b2455..32193f83e57 100644
--- a/src/doc/en/developer/coding_basics.rst
+++ b/src/doc/en/developer/coding_basics.rst
@@ -193,8 +193,8 @@ included in one of the following places:
This practice is deprecated, see :issue:`33037`.
In all cases, the files must be listed (explicitly or via wildcards) in
-the section ``options.package_data`` of the file
-:sage_root:`pkgs/sagemath-standard/setup.cfg.m4` (or the corresponding
+the section ``[tool.setuptools.package-data]`` of the file
+:sage_root:`SAGE_ROOT/pkgs/sagemath-standard/pyproject.toml` (or the corresponding
file of another distribution).
Large data files should not be added to the Sage source tree. Instead, it
diff --git a/src/doc/en/developer/coding_in_python.rst b/src/doc/en/developer/coding_in_python.rst
index bb08408777b..07a4ed4be26 100644
--- a/src/doc/en/developer/coding_in_python.rst
+++ b/src/doc/en/developer/coding_in_python.rst
@@ -14,8 +14,10 @@ Python language standard
Sage library code needs to be compatible with all versions of Python
that Sage supports. The information regarding the supported versions
-can be found in the files ``build/pkgs/python3/spkg-configure.m4`` and
-``src/setup.cfg.m4``.
+can be found in the files ``build/pkgs/python3/spkg-configure.m4``
+(for the Sage distribution), ``src/pyproject.toml`` (for the Sage
+library), and ``m4/pyproject_toml_metadata.m4`` (for most other
+distribution packages in ``pkgs/``).
Python 3.9 is the oldest supported version. Hence,
all language and library features that are available in Python 3.9 can
diff --git a/src/doc/en/developer/packaging_sage_library.rst b/src/doc/en/developer/packaging_sage_library.rst
index 9fbb4271727..a88e33b93ca 100644
--- a/src/doc/en/developer/packaging_sage_library.rst
+++ b/src/doc/en/developer/packaging_sage_library.rst
@@ -174,8 +174,7 @@ The source directory of a distribution package, such as
$ ./sage --fixdistributions --set all --from-egg-info
-- `pyproject.toml `_,
- `setup.cfg `_,
+- `pyproject.toml `_
and `requirements.txt `_ --
standard Python packaging metadata, declaring the distribution name, dependencies,
etc.
@@ -288,8 +287,9 @@ modules must be part of the distribution, or provided by another
distribution -- which then must be declared as a run-time dependency.
*Declaring run-time dependencies:* These dependencies are declared in
-``setup.cfg`` (generated from ``setup.cfg.m4``) as
-`install_requires `_.
+``pyproject.toml`` (generated from ``pyproject.toml.m4``) as
+`[project] dependencies `_ (in the older terminology of ``setup.cfg`` and ``setup.py``,
+these dependencies were known as ``install_requires``).
*Reducing module-level run-time dependencies:*
@@ -467,14 +467,17 @@ features, which will only be working if the user also has installed
**sagemath-symbolics**.
*Declaring optional run-time dependencies:* It is possible to declare
-such optional dependencies as `extras_require `_ in ``setup.cfg``
-(generated from ``setup.cfg.m4``). This is a very limited mechanism
+such dependencies as `[project.optional-dependencies] `_ in ``pyproject.toml``
+(generated from ``pyproject.toml.m4``).
+(In the older terminology of ``setup.cfg`` and ``setup.py``,
+these optional dependencies were known as ``extras_require``.)
+This is a very limited mechanism
-- in particular it does not affect the build phase of the
distribution in any way. It basically only provides a way to give a
nickname to a distribution that can be installed as an add-on.
-In our example, we could declare an ``extras_require`` so that users
-could use ``pip install sagemath-coding[symbolics]``.
+In our example, we could declare an optional dependency so that users
+could use ``pip install "sagemath-coding[symbolics]"``.
Doctest-only dependencies
@@ -516,7 +519,7 @@ The version information for dependencies comes from the files
``build/pkgs/*/package-version.txt``. We use the
`m4 `_
macro processor to insert the version information in the generated files
-``pyproject.toml``, ``setup.cfg``, ``requirements.txt``.
+``pyproject.toml`` and ``requirements.txt``.
Hierarchy of distribution packages
@@ -546,8 +549,8 @@ Hierarchy of distribution packages
sphinx_plot(g, figsize=(8, 4), axes=False)
-Solid arrows indicate ``install_requires``, i.e., a declared runtime dependency.
-Dashed arrows indicate ``extras_require``, i.e., a declared optional runtime dependency.
+Solid arrows indicate declared runtime dependencies (``install_requires``).
+Dashed arrows indicate declared optional runtime dependencies (``extras_require``).
Not shown in the diagram are build dependencies and optional dependencies for testing.
- `sage_conf `_ is a configuration
diff --git a/src/pyproject.toml b/src/pyproject.toml
index 4b70dc133d1..47b4808e86f 100644
--- a/src/pyproject.toml
+++ b/src/pyproject.toml
@@ -18,11 +18,192 @@ requires = [
]
build-backend = "setuptools.build_meta"
+[project]
+name = "sagemath-standard"
+description = "Sage: Open Source Mathematics Software: Standard Python Library"
+dependencies = [
+ 'six >=1.15.0',
+ # From build/pkgs/sagelib/dependencies
+ 'conway-polynomials >=0.8',
+ 'cypari2 >=2.1.1',
+ 'cysignals >=1.10.2',
+ 'cython >=3.0, != 3.0.3, <4.0',
+ 'gmpy2 ~=2.1.b999',
+ # According to https://pypi.org/project/importlib-metadata/,
+ # 4.13 provides the features of Python 3.11 importlib.metadata
+ 'importlib_metadata >=4.13; python_version<"3.11"',
+ # According to https://pypi.org/project/importlib-resources/,
+ # version 5.7 provides the features of Python 3.11 importlib.resources
+ 'importlib_resources >= 5.7; python_version<"3.11"',
+ 'lrcalc ~=2.1',
+ 'memory_allocator',
+ 'numpy >=1.19',
+ 'pkgconfig',
+ # Issue #30922: pplpy 0.8.4 and earlier do not declare dependencies correctly
+ 'pplpy >=0.8.6',
+ 'primecountpy',
+ 'requests >=2.13.0',
+ # According to https://github.com/python/typing_extensions/blob/main/CHANGELOG.md,
+ # version 4.4.0 adds another Python 3.11 typing backport
+ 'typing_extensions >= 4.4.0; python_version<"3.11"',
+ # From Makefile.in: SAGERUNTIME
+ 'ipython >=7.13.0',
+ 'pexpect >=4.8.0',
+ # From Makefile.in: DOC_DEPENDENCIES
+ 'sphinx >=5.2, <9',
+ 'networkx >=2.4',
+ # 1.8 is known good version.
+ # Per https://docs.scipy.org/doc/scipy/dev/core-dev/index.html#version-numbering
+ # and https://docs.scipy.org/doc/scipy/dev/core-dev/index.html#deprecations,
+ # deprecations cannot be introduced in micro releases.
+ # SciPy devs wait "at least 6 months", "in practice two (minor) releases"
+ # from deprecation to removal of a feature.
+ 'scipy >=1.5',
+ 'sympy >=1.6, <2.0',
+ # Issue #33642: Set lower bound for use of matplotlib color maps introduced in #33491,
+ # and to suppress deprecation warnings (https://github.com/matplotlib/matplotlib/pull/21073)
+ 'matplotlib >=3.5.1',
+ 'pillow >=7.2.0',
+ 'mpmath >=1.1.0, <1.4',
+ 'ipykernel >=5.2.1',
+ 'jupyter-client',
+ 'ipywidgets >=7.5.1',
+ 'fpylll >=0.5.9',
+ 'ptyprocess > 0.5',
+]
+dynamic = ["version"]
+# duplicated from m4/pyproject_toml_metadata.m4
+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 :: 3.12",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Topic :: Scientific/Engineering :: Mathematics",
+]
+urls = {Homepage = "https://www.sagemath.org"}
+requires-python = ">=3.9, <3.13"
+
+[project.optional-dependencies]
+R = [
+ 'rpy2 >=3.3',
+]
+bliss = [
+ 'sagemath-bliss',
+]
+coxeter3 = [
+ 'sagemath-coxeter3',
+]
+mcqd = [
+ 'sagemath-mcqd',
+]
+meataxe = [
+ 'sagemath-meataxe',
+]
+sirocco = [
+ 'sagemath-sirocco',
+]
+tdlib = [
+ 'sagemath-tdlib',
+]
+
+[project.readme]
+file = "README.rst"
+content-type = "text/x-rst"
+
[tool.conda-lock]
platforms = [
'osx-64', 'linux-64', 'linux-aarch64', 'osx-arm64'
]
+[tool.setuptools]
+script-files = [
+ # The sage script
+ "bin/sage",
+ # 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",
+ # The following is deprecated but might still be used in user package install scripts
+ "bin/sage-cython",
+ # 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-venv-config",
+ "bin/sage-version.sh",
+ "bin/sage-cleaner",
+ # Only makes sense in sage-the-distribution. TODO: Move to another installation script.
+ "bin/sage-list-packages",
+ # Uncategorized scripts in alphabetical order
+ "bin/math-readline",
+ "bin/sage-env",
+ # sage-env-config -- installed by sage_conf
+ # sage-env-config.in -- not to be installed
+ "bin/sage-grep",
+ "bin/sage-grepdoc",
+ "bin/sage-inline-fortran",
+ "bin/sage-ipynb2rst",
+ "bin/sage-ipython",
+ "bin/sage-notebook",
+ "bin/sage-num-threads.py",
+ "bin/sage-preparse",
+ "bin/sage-python",
+ "bin/sage-run",
+ "bin/sage-run-cython",
+ "bin/sage-startuptime.py",
+ "bin/sage-update-version",
+]
+license-files = ["LICENSE.txt"]
+include-package-data = false
+
+[tool.setuptools.package-data]
+"sage.libs.gap" = ["sage.gaprc"]
+"sage.interfaces" = ["sage-maxima.lisp"]
+"sage.doctest" = ["tests/*"]
+"sage.repl.rich_output" = ["example*"]
+sage = [
+ "ext_data/*",
+ "ext_data/kenzo/*",
+ "ext_data/singular/*",
+ "ext_data/singular/function_field/*",
+ "ext_data/images/*",
+ "ext_data/doctest/*",
+ "ext_data/doctest/invalid/*",
+ "ext_data/gap/*",
+ "ext_data/gap/joyner/*",
+ "ext_data/mwrank/*",
+ "ext_data/notebook-ipython/*",
+ "ext_data/nbconvert/*",
+ "ext_data/graphs/*",
+ "ext_data/pari/*",
+ "ext_data/pari/dokchitser/*",
+ "ext_data/pari/buzzard/*",
+ "ext_data/pari/simon/*",
+ "ext_data/magma/*",
+ "ext_data/magma/latex/*",
+ "ext_data/magma/sage/*",
+ "ext_data/valgrind/*",
+ "ext_data/threejs/*",
+]
+
+[tool.setuptools.dynamic]
+version = {file = ["VERSION.txt"]}
+
[external]
# External dependencies in the format proposed by https://peps.python.org/pep-0725
# In the future, sage-the-distribution can read this information
diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4
deleted file mode 100644
index 969793209c8..00000000000
--- a/src/setup.cfg.m4
+++ /dev/null
@@ -1,138 +0,0 @@
-include(`sage_spkg_versions.m4')dnl' -*- conf-unix -*-
-[metadata]
-name = sagemath-standard
-version = file: VERSION.txt
-description = Sage: Open Source Mathematics Software: Standard Python Library
-long_description = file: README.rst
-long_description_content_type = text/x-rst
-license_files = LICENSE.txt
-include(`setup_cfg_metadata.m4')dnl'
-
-[options]
-python_requires = >=3.9, <3.13
-install_requires =
- SPKG_INSTALL_REQUIRES_six
-dnl From build/pkgs/sagelib/dependencies
- SPKG_INSTALL_REQUIRES_conway_polynomials
- SPKG_INSTALL_REQUIRES_cypari
- SPKG_INSTALL_REQUIRES_cysignals
- SPKG_INSTALL_REQUIRES_cython
- SPKG_INSTALL_REQUIRES_gmpy2
- SPKG_INSTALL_REQUIRES_importlib_metadata
- SPKG_INSTALL_REQUIRES_importlib_resources
- SPKG_INSTALL_REQUIRES_jupyter_core
- SPKG_INSTALL_REQUIRES_lrcalc_python
- SPKG_INSTALL_REQUIRES_memory_allocator
- SPKG_INSTALL_REQUIRES_numpy
- SPKG_INSTALL_REQUIRES_pkgconfig
- SPKG_INSTALL_REQUIRES_pplpy
- SPKG_INSTALL_REQUIRES_primecountpy
- SPKG_INSTALL_REQUIRES_requests
- SPKG_INSTALL_REQUIRES_typing_extensions
-dnl From Makefile.in: SAGERUNTIME
- SPKG_INSTALL_REQUIRES_ipython
- SPKG_INSTALL_REQUIRES_pexpect
-dnl From Makefile.in: DOC_DEPENDENCIES
- sphinx >=5.2, <9
- SPKG_INSTALL_REQUIRES_networkx
- SPKG_INSTALL_REQUIRES_scipy
- SPKG_INSTALL_REQUIRES_sympy
- SPKG_INSTALL_REQUIRES_matplotlib
- SPKG_INSTALL_REQUIRES_pillow
- SPKG_INSTALL_REQUIRES_mpmath
- SPKG_INSTALL_REQUIRES_ipykernel
- SPKG_INSTALL_REQUIRES_jupyter_client
- SPKG_INSTALL_REQUIRES_ipywidgets
- SPKG_INSTALL_REQUIRES_fpylll
-dnl pycryptosat # Sage distribution installs it as part of cryptominisat. According to its README on https://pypi.org/project/pycryptosat/: "The pycryptosat python package compiles while compiling CryptoMiniSat. It cannot be compiled on its own, it must be compiled at the same time as CryptoMiniSat."
-dnl Packages with important upper version bounds
- SPKG_INSTALL_REQUIRES_ptyprocess
-
-scripts =
- # The sage script
- bin/sage
- # 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
- # The following is deprecated but might still be used in user package install scripts
- bin/sage-cython
- # 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-venv-config
- bin/sage-version.sh
- bin/sage-cleaner
- # Only makes sense in sage-the-distribution. TODO: Move to another installation script.
- bin/sage-list-packages
- # Uncategorized scripts in alphabetical order
- bin/math-readline
- bin/sage-env
- # sage-env-config -- installed by sage_conf
- # sage-env-config.in -- not to be installed
- bin/sage-grep
- bin/sage-grepdoc
- bin/sage-inline-fortran
- bin/sage-ipynb2rst
- bin/sage-ipython
- bin/sage-notebook
- bin/sage-num-threads.py
- bin/sage-preparse
- bin/sage-python
- bin/sage-run
- bin/sage-run-cython
- bin/sage-startuptime.py
- bin/sage-update-version
-
-[options.package_data]
-
-sage.libs.gap =
- sage.gaprc
-
-sage.interfaces =
- sage-maxima.lisp
-
-sage.doctest =
- tests/*
-
-sage.repl.rich_output =
- example*
-
-sage =
- ext_data/*
- ext_data/kenzo/*
- ext_data/singular/*
- ext_data/singular/function_field/*
- ext_data/images/*
- ext_data/doctest/*
- ext_data/doctest/invalid/*
- ext_data/gap/*
- ext_data/gap/joyner/*
- ext_data/mwrank/*
- ext_data/notebook-ipython/*
- ext_data/nbconvert/*
- ext_data/graphs/*
- ext_data/pari/*
- ext_data/pari/dokchitser/*
- ext_data/pari/buzzard/*
- ext_data/pari/simon/*
- ext_data/magma/*
- ext_data/magma/latex/*
- ext_data/magma/sage/*
- ext_data/valgrind/*
- ext_data/threejs/*
-
-[options.extras_require]
-R = SPKG_INSTALL_REQUIRES_rpy2
-bliss = SPKG_INSTALL_REQUIRES_sagemath_bliss
-coxeter3 = SPKG_INSTALL_REQUIRES_sagemath_coxeter3
-mcqd = SPKG_INSTALL_REQUIRES_sagemath_mcqd
-meataxe = SPKG_INSTALL_REQUIRES_sagemath_meataxe
-sirocco = SPKG_INSTALL_REQUIRES_sagemath_sirocco
-tdlib = SPKG_INSTALL_REQUIRES_sagemath_tdlib