Skip to content

Commit 6ecb1d8

Browse files
author
Release Manager
committed
sagemathgh-36964: Add `# sage_setup: distribution` directives to all files, remove remaining `# coding: utf-8` <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> These directives at the top of the file inform developers about the intended assignment of modules to pip-installable distributions. As of this PR, there should be no change to the existing distributions (sagemath-categories...) nor the monolithic build of the Sage library. <!-- Why is this change required? What problem does it solve? --> - Cherry-picked from sagemath#35095 <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - Depends on sagemath#36951 (merged here) - Depends on sagemath#36676 (merged here) - Depends on sagemath#37667 (merged here) URL: sagemath#36964 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe, Tobias Diez
2 parents 8ea5214 + 5ae0bc7 commit 6ecb1d8

File tree

3,548 files changed

+5666
-2061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,548 files changed

+5666
-2061
lines changed

bootstrap

+1-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ save () {
232232
src/environment-optional-3.[89].yml src/environment-optional-3.1[0-9].yml \
233233
src/Pipfile \
234234
src/pyproject.toml \
235-
src/requirements.txt \
236-
src/setup.cfg
235+
src/requirements.txt
237236

238237
# Update version
239238
echo "$NEWCONFVERSION" >$PKG/package-version.txt

build/bin/write-dockerfile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ $ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-
236236
$ADD config/config.rpath config/config.rpath
237237
$ADD src/doc/bootstrap src/doc/bootstrap
238238
$ADD src/bin src/bin
239-
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt src/
239+
$ADD src/Pipfile.m4 src/pyproject.toml.m4 src/requirements.txt.m4 src/VERSION.txt src/
240240
$ADD m4 ./m4
241241
$ADD pkgs pkgs
242242
$ADD build ./build
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# According to https://github.com/python/typing_extensions/blob/main/CHANGELOG.md,
22
# version 4.4.0 adds another Python 3.11 typing backport
3-
typing_extensions >= 4.4.0; python_version<'3.11'
3+
typing_extensions >= 4.4.0; python_version<"3.11"

pkgs/sagemath-categories/known-test-failures.json

+9-15
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"ntests": 28
2727
},
2828
"sage.categories.affine_weyl_groups": {
29-
"ntests": 14
29+
"ntests": 15
3030
},
3131
"sage.categories.algebra_ideals": {
3232
"failed": true,
@@ -148,7 +148,7 @@
148148
},
149149
"sage.categories.coxeter_groups": {
150150
"failed": true,
151-
"ntests": 362
151+
"ntests": 363
152152
},
153153
"sage.categories.cw_complexes": {
154154
"failed": true,
@@ -301,7 +301,7 @@
301301
},
302302
"sage.categories.finite_complex_reflection_groups": {
303303
"failed": true,
304-
"ntests": 178
304+
"ntests": 199
305305
},
306306
"sage.categories.finite_coxeter_groups": {
307307
"ntests": 6
@@ -493,10 +493,6 @@
493493
"failed": true,
494494
"ntests": 13
495495
},
496-
"sage.categories.inner_product_spaces": {
497-
"failed": true,
498-
"ntests": 9
499-
},
500496
"sage.categories.integral_domains": {
501497
"failed": true,
502498
"ntests": 22
@@ -783,7 +779,7 @@
783779
},
784780
"sage.cpython.debug": {
785781
"failed": true,
786-
"ntests": 14
782+
"ntests": 13
787783
},
788784
"sage.cpython.dict_del_by_value": {
789785
"failed": true,
@@ -826,7 +822,6 @@
826822
"ntests": 321
827823
},
828824
"sage.doctest.reporting": {
829-
"failed": true,
830825
"ntests": 124
831826
},
832827
"sage.doctest.sources": {
@@ -1091,7 +1086,7 @@
10911086
},
10921087
"sage.misc.sageinspect": {
10931088
"failed": true,
1094-
"ntests": 329
1089+
"ntests": 332
10951090
},
10961091
"sage.misc.superseded": {
10971092
"failed": true,
@@ -1124,6 +1119,7 @@
11241119
"ntests": 128
11251120
},
11261121
"sage.repl.configuration": {
1122+
"failed": true,
11271123
"ntests": 22
11281124
},
11291125
"sage.repl.display.fancy_repr": {
@@ -1149,6 +1145,7 @@
11491145
"ntests": 42
11501146
},
11511147
"sage.repl.inputhook": {
1148+
"failed": true,
11521149
"ntests": 7
11531150
},
11541151
"sage.repl.interface_magic": {
@@ -1157,7 +1154,7 @@
11571154
},
11581155
"sage.repl.interpreter": {
11591156
"failed": true,
1160-
"ntests": 118
1157+
"ntests": 114
11611158
},
11621159
"sage.repl.ipython_extension": {
11631160
"failed": true,
@@ -1188,7 +1185,7 @@
11881185
},
11891186
"sage.repl.load": {
11901187
"failed": true,
1191-
"ntests": 42
1188+
"ntests": 38
11921189
},
11931190
"sage.repl.preparse": {
11941191
"failed": true,
@@ -1315,9 +1312,6 @@
13151312
"sage.structure.global_options": {
13161313
"ntests": 145
13171314
},
1318-
"sage.structure.graphics_file": {
1319-
"ntests": 8
1320-
},
13211315
"sage.structure.indexed_generators": {
13221316
"failed": true,
13231317
"ntests": 90

pkgs/sagemath-standard/setup.cfg

-1
This file was deleted.

pkgs/sagemath-standard/setup.cfg.m4

-1
This file was deleted.

pkgs/sagemath-standard/setup.py

+54-19
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,60 @@
6969
from sage_setup.autogen import autogen_all
7070
autogen_all()
7171

72-
# TODO: This should be quiet by default
73-
print("Discovering Python/Cython source code....")
74-
t = time.time()
75-
from sage.misc.package import is_package_installed_and_updated
76-
distributions = ['']
77-
optional_packages_with_extensions = os.environ.get('SAGE_OPTIONAL_PACKAGES_WITH_EXTENSIONS', '').split(',')
78-
distributions += ['sagemath-{}'.format(pkg)
79-
for pkg in optional_packages_with_extensions
80-
if is_package_installed_and_updated(pkg)]
81-
log.warn('distributions = {0}'.format(distributions))
82-
from sage_setup.find import find_python_sources
83-
python_packages, python_modules, cython_modules = find_python_sources(
84-
SAGE_SRC, ['sage'], distributions=distributions)
85-
86-
log.debug('python_packages = {0}'.format(python_packages))
87-
log.debug('python_modules = {0}'.format(python_modules))
88-
log.debug('cython_modules = {0}'.format(cython_modules))
89-
90-
print("Discovered Python/Cython sources, time: %.2f seconds." % (time.time() - t))
72+
# TODO: This should be quiet by default
73+
print("Discovering Python/Cython source code....")
74+
t = time.time()
75+
from sage.misc.package import is_package_installed_and_updated
76+
77+
distributions = [
78+
'',
79+
"sagemath-brial",
80+
"sagemath-categories",
81+
"sagemath-combinat",
82+
"sagemath-eclib",
83+
"sagemath-environment",
84+
"sagemath-flint",
85+
"sagemath-gap",
86+
"sagemath-giac",
87+
"sagemath-glpk",
88+
"sagemath-graphs",
89+
"sagemath-groups",
90+
"sagemath-homfly",
91+
"sagemath-lcalc",
92+
"sagemath-libbraiding",
93+
"sagemath-libecm",
94+
"sagemath-linbox",
95+
"sagemath-modules",
96+
"sagemath-mpmath",
97+
"sagemath-ntl",
98+
"sagemath-objects",
99+
"sagemath-pari",
100+
"sagemath-plot",
101+
"sagemath-polyhedra",
102+
"sagemath-repl",
103+
"sagemath-schemes",
104+
"sagemath-singular",
105+
"sagemath-symbolics",
106+
]
107+
108+
optional_packages_with_extensions = os.environ.get('SAGE_OPTIONAL_PACKAGES_WITH_EXTENSIONS', '').split(',')
109+
distributions += ['sagemath-{}'.format(pkg)
110+
for pkg in optional_packages_with_extensions
111+
if is_package_installed_and_updated(pkg)]
112+
log.warn('distributions = {0}'.format(distributions))
113+
from sage_setup.find import find_python_sources
114+
python_packages, python_modules, cython_modules = find_python_sources(
115+
SAGE_SRC, ['sage'], distributions=distributions)
116+
117+
log.debug('python_packages = {0}'.format(python_packages))
118+
log.debug('python_modules = {0}'.format(python_modules))
119+
log.debug('cython_modules = {0}'.format(cython_modules))
120+
121+
print("Discovered Python/Cython sources, time: %.2f seconds." % (time.time() - t))
122+
else:
123+
# sdist, egg_info, dist_info
124+
python_packages = []
125+
cython_modules = []
91126

92127
#########################################################
93128
### Distutils

pkgs/sagemath-standard/tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
[tox]
1818
envlist =
1919
# Build and test without using the concrete dependencies specified by requirements.txt,
20-
# using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only:
20+
# using the dependencies declared in pyproject.toml (build-system requires, dependencies) only:
2121
# Still use ONLY the wheels built and stored by the Sage distribution (no PyPI).
2222
#
2323
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)'
@@ -45,7 +45,7 @@ envlist =
4545
#
4646
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-pipenv-dist)'
4747
#
48-
# Build using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only.
48+
# Build using the dependencies declared in pyproject.toml (build-system requires, dependencies) only:
4949
# Use the wheels built and stored by the Sage distribution,
5050
# and additionally allow packages from PyPI.
5151
#

src/Pipfile.m4

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ url = "https://pypi.org/simple"
66
verify_ssl = true
77

88
[dev-packages]
9-
## We do not list packages that are already declared as install_requires
10-
## in setup.cfg
9+
## We do not list packages that are already declared as dependencies (install_requires)
10+
## in pyproject.toml
1111
pycodestyle = "*"
1212
tox = "*"
1313
pytest = "*"
1414
rope = "*"
1515
six = "*"
1616

1717
[packages]
18-
## We do not list packages that are already declared as install_requires
19-
## in setup.cfg
18+
## We do not list packages that are already declared as dependencies (install_requires)
19+
## in pyproject.toml
2020

2121
[packages.e1839a8]
2222
path = "."

src/doc/en/developer/coding_basics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ included in one of the following places:
193193
This practice is deprecated, see :issue:`33037`.
194194

195195
In all cases, the files must be listed (explicitly or via wildcards) in
196-
the section ``options.package_data`` of the file
197-
:sage_root:`pkgs/sagemath-standard/setup.cfg.m4` (or the corresponding
196+
the section ``[tool.setuptools.package-data]`` of the file
197+
:sage_root:`SAGE_ROOT/pkgs/sagemath-standard/pyproject.toml.m4` (or the corresponding
198198
file of another distribution).
199199

200200
Large data files should not be added to the Sage source tree. Instead, it

src/doc/en/developer/coding_in_python.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Python language standard
1414

1515
Sage library code needs to be compatible with all versions of Python
1616
that Sage supports. The information regarding the supported versions
17-
can be found in the files ``build/pkgs/python3/spkg-configure.m4`` and
18-
``src/setup.cfg.m4``.
17+
can be found in the files ``build/pkgs/python3/spkg-configure.m4``
18+
(for the Sage distribution), ``m4/pyproject_toml_metadata.m4`` (for
19+
the Sage library and most other distribution packages in ``pkgs/``).
1920

2021
Python 3.9 is the oldest supported version. Hence,
2122
all language and library features that are available in Python 3.9 can

src/doc/en/developer/packaging_sage_library.rst

+14-11
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ The source directory of a distribution package, such as
174174

175175
$ ./sage --fixdistributions --set all --from-egg-info
176176

177-
- `pyproject.toml <https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/>`_,
178-
`setup.cfg <https://setuptools.pypa.io/en/latest/userguide/declarative_config.html>`_,
177+
- `pyproject.toml <https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/>`_
179178
and `requirements.txt <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_ --
180179
standard Python packaging metadata, declaring the distribution name, dependencies,
181180
etc.
@@ -288,8 +287,9 @@ modules must be part of the distribution, or provided by another
288287
distribution -- which then must be declared as a run-time dependency.
289288

290289
*Declaring run-time dependencies:* These dependencies are declared in
291-
``setup.cfg`` (generated from ``setup.cfg.m4``) as
292-
`install_requires <https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#declaring-required-dependency>`_.
290+
``pyproject.toml`` (generated from ``pyproject.toml.m4``) as
291+
`[project] dependencies <https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#declaring-required-dependency>`_ (in the older terminology of ``setup.cfg`` and ``setup.py``,
292+
these dependencies were known as ``install_requires``).
293293

294294
*Reducing module-level run-time dependencies:*
295295

@@ -467,14 +467,17 @@ features, which will only be working if the user also has installed
467467
**sagemath-symbolics**.
468468

469469
*Declaring optional run-time dependencies:* It is possible to declare
470-
such optional dependencies as `extras_require <https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies>`_ in ``setup.cfg``
471-
(generated from ``setup.cfg.m4``). This is a very limited mechanism
470+
such dependencies as `[project.optional-dependencies] <https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies>`_ in ``pyproject.toml``
471+
(generated from ``pyproject.toml.m4``).
472+
(In the older terminology of ``setup.cfg`` and ``setup.py``,
473+
these optional dependencies were known as ``extras_require``.)
474+
This is a very limited mechanism
472475
-- in particular it does not affect the build phase of the
473476
distribution in any way. It basically only provides a way to give a
474477
nickname to a distribution that can be installed as an add-on.
475478

476-
In our example, we could declare an ``extras_require`` so that users
477-
could use ``pip install sagemath-coding[symbolics]``.
479+
In our example, we could declare an optional dependency so that users
480+
could use ``pip install "sagemath-coding[symbolics]"``.
478481

479482

480483
Doctest-only dependencies
@@ -516,7 +519,7 @@ The version information for dependencies comes from the files
516519
``build/pkgs/*/package-version.txt``. We use the
517520
`m4 <https://www.gnu.org/software/m4/manual/html_node/index.html>`_
518521
macro processor to insert the version information in the generated files
519-
``pyproject.toml``, ``setup.cfg``, ``requirements.txt``.
522+
``pyproject.toml`` and ``requirements.txt``.
520523

521524

522525
Hierarchy of distribution packages
@@ -546,8 +549,8 @@ Hierarchy of distribution packages
546549
sphinx_plot(g, figsize=(8, 4), axes=False)
547550
548551

549-
Solid arrows indicate ``install_requires``, i.e., a declared runtime dependency.
550-
Dashed arrows indicate ``extras_require``, i.e., a declared optional runtime dependency.
552+
Solid arrows indicate declared runtime dependencies (``install_requires``).
553+
Dashed arrows indicate declared optional runtime dependencies (``extras_require``).
551554
Not shown in the diagram are build dependencies and optional dependencies for testing.
552555

553556
- `sage_conf <https://pypi.org/project/sage-conf/>`_ is a configuration

src/doc/en/reference/calculus/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Using calculus
2323

2424
- :doc:`More about symbolic variables and functions <sage/calculus/var>`
2525
- :doc:`Main operations on symbolic expressions <sage/symbolic/expression>`
26+
- :doc:`sage/calculus/expr`
2627
- :doc:`Assumptions about symbols and functions <sage/symbolic/assumptions>`
2728
- :doc:`sage/symbolic/relation`
2829
- :doc:`sage/symbolic/integration/integral`
@@ -65,6 +66,7 @@ Internal functionality supporting calculus
6566

6667
sage/symbolic/expression
6768
sage/symbolic/callable
69+
sage/calculus/expr
6870
sage/symbolic/assumptions
6971
sage/symbolic/relation
7072
sage/calculus/calculus

0 commit comments

Comments
 (0)