forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
429 lines (396 loc) · 11.9 KB
/
pyproject.toml
File metadata and controls
429 lines (396 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
[build-system]
build-backend = 'mesonpy'
# Minimum requirements for the build system to execute.
requires = [
'cypari2 >=2.2.1; sys_platform != "win32"',
'meson-python',
# Exclude 1.12.0 because of https://github.com/sagemath/cysignals/issues/212
'cysignals >=1.12.1',
'cython >=3.1.0',
'gmpy2 >=2.1.5',
'jinja2',
'memory_allocator',
'numpy >=2.2.4',
]
[tool.meson-python.args]
# Prevent meson from trying to install the autoconf subprojects
# otherwise we hit https://github.com/mesonbuild/meson-python/issues/598
# The subprojects have to set the rpath to the build directory, which should work as long as
# we don't use build isolation.
# Also don't install subprojects providing static libraries as per https://mesonbuild.com/meson-python/how-to-guides/shared-libraries.html#static-library-from-subproject
# This actually covers all current subprojects; so just don't install any of them.
install = ['--skip-subprojects']
# Ensure that ``library`` targets are built as static, and nothing gets installed
setup = ['--default-library=static']
[project]
authors = [
{ email = "sage-support@googlegroups.com", name = "The Sage Developers" },
]
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
'conway-polynomials >=0.8',
'cypari2 >=2.2.1; sys_platform != "win32"',
'six >=1.15.0',
# Exclude 1.12.0 because of https://github.com/sagemath/cysignals/issues/212
'cysignals >=1.12.1',
'cython >=3.1.0',
'fpylll >=0.5.9; sys_platform != "win32"',
'gmpy2 >=2.1.5',
'ipykernel >=5.2.1',
'ipython >=8.9.0',
'ipywidgets >=7.5.1',
'jupyter-client',
'matplotlib >=3.7.0',
'memory_allocator',
'mpmath >=1.1.0',
'networkx >=3.1',
'numpy >=1.25',
'pexpect >=4.8.0',
'pillow >=7.2.0',
'platformdirs',
# Issue #30922: pplpy 0.8.4 and earlier do not declare dependencies correctly
'pplpy >=0.8.6; sys_platform != "win32"',
'primecountpy; sys_platform != "win32"',
'ptyprocess > 0.5',
'requests >=2.13.0',
'scipy >=1.11',
'sphinx >=6.2, <9',
'sympy >=1.6, <2.0',
# TODO: Remove this once the migration to meson is complete
'pkgconfig',
'traitlets',
]
description = "Sage: Open Source Mathematics Software: Standard Python Library"
dynamic = ["version"]
license = "GPL-2.0-or-later"
name = "sagemath"
requires-python = ">=3.12, <3.15"
urls = { Homepage = "https://www.sagemath.org" }
[project.optional-dependencies]
R = ['rpy2 >=3.3']
extra = [
'igraph',
'lrcalc ~=2.1; sys_platform != "win32"',
#'p_group_cohomology >=3.3', # Only used in tests, not available on PyPI
'pycosat >=0.6.3',
'pynormaliz >=2.18; platform_machine != "aarch64" and platform_machine != "arm64"', # Not yet available for Linux aarch64
'sage_numerical_backends_coin',
'symengine >= 0.6.1', # Only used in tests
]
#giac = ['sagemath_giac'] # Not yet available on PyPI (https://github.com/sagemath/sagemath-giac/issues/3)
[project.readme]
content-type = "text/markdown"
file = "README.md"
[project.scripts]
sage = "sage.cli.__main__:main"
[tool.conda-lock]
platforms = ['linux-64', 'linux-aarch64', 'osx-64', 'osx-arm64']
[tool.pytest.ini_options]
norecursedirs = "local prefix venv build builddir pkgs .git src/doc src/bin src/sage_setup/autogen/flint tools subprojects"
python_files = "*_test.py"
# The "no:warnings" is to stop pytest from capturing warnings so that they are printed to the output of the doctest
addopts = "--import-mode importlib -p no:warnings"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
# https://docs.pytest.org/en/stable/reference/reference.html#confval-consider_namespace_packages
consider_namespace_packages = true
# External dependencies in the format proposed by https://peps.python.org/pep-0725
[external]
build-requires = [
"pkg:generic/pkg-config",
"virtual:compiler/c",
"virtual:compiler/cpp",
]
host-requires = [
"pkg:generic/boost",
"pkg:generic/cddlib",
"pkg:generic/cliquer",
"pkg:generic/ecl",
"pkg:generic/ecm",
"pkg:generic/fflas-ffpack",
"pkg:generic/flint",
"pkg:generic/gap",
"pkg:generic/gfan",
"pkg:generic/givaro",
"pkg:generic/glpk",
"pkg:generic/gmp",
"pkg:generic/gsl",
"pkg:generic/iml",
"pkg:generic/lcalc",
"pkg:generic/libbraiding",
"pkg:generic/libgd",
"pkg:generic/libhomfly",
"pkg:generic/linbox",
"pkg:generic/lrcalc",
"pkg:generic/m4ri",
"pkg:generic/m4rie",
"pkg:generic/maxima",
"pkg:generic/mpc",
"pkg:generic/mpfi",
"pkg:generic/mpfr",
"pkg:generic/nauty",
"pkg:generic/ntl",
"pkg:generic/palp",
"pkg:generic/pari",
"pkg:generic/pari-elldata",
"pkg:generic/pari-galdata",
"pkg:generic/pari-seadata",
"pkg:generic/planarity",
"pkg:generic/primecount",
"pkg:generic/primesieve",
"pkg:generic/qhull",
"pkg:generic/rw",
"pkg:generic/singular",
"pkg:generic/symmetrica",
"pkg:generic/sympow",
"virtual:compiler/fortran",
"virtual:interface/blas",
]
dependencies = [
"pkg:generic/sagemath-elliptic-curves",
"pkg:generic/sagemath-graphs",
"pkg:generic/sagemath-polytopes-db",
"pkg:generic/tachyon",
]
[external.optional-host-requires]
extra = [
"pkg:generic/bliss",
"pkg:generic/brial",
"pkg:generic/coxeter3",
"pkg:generic/eclib",
"pkg:generic/mcqd",
"pkg:generic/meataxe",
"pkg:generic/sirocco",
"pkg:generic/tdlib",
]
[external.optional-dependencies]
R = ["pkg:generic/r-lattice"]
extra = [
"pkg:generic/4ti2",
"pkg:generic/benzene",
"pkg:generic/buckygen",
"pkg:generic/csdp",
"pkg:generic/frobby",
"pkg:generic/kenzo",
"pkg:generic/latte-integrale",
"pkg:generic/lrslib",
"pkg:generic/plantri",
"pkg:generic/qepcad",
"pkg:generic/tides",
]
# Uncommented for now as most devs probably don't need to run it locally
# docs-pdf = [
# "pkg:generic/latexmk",
# "pkg:generic/lualatex",
# "pkg:fonts/freefonts",
# "pkg:generic/xindy",
# ]
[dependency-groups]
dev = [
"cibuildwheel",
"conda-lock",
"grayskull",
"meson", # Duplicate build-system requirement to fix editable installs with uv
"meson-python", # Duplicate build-system requirement to fix editable installs with uv
"ninja", # Duplicate build-system requirement to fix editable installs with uv
"pygithub",
"pytest",
"python-build",
"ruff",
"tqdm",
"ty >=0.0.12",
"uv",
'cypari2 >=2.2.1; sys_platform != "win32"', # Duplicate build-system requirement to fix editable installs with uv
'cysignals >=1.12.1', # Duplicate build-system requirement to fix editable installs with uv
'cython >=3.1.0', # Duplicate build-system requirement to fix editable installs with uv
'gmpy2 >=2.1.5', # Duplicate build-system requirement to fix editable installs with uv
'jinja2', # Duplicate build-system requirement to fix editable installs with uv
'memory_allocator', # Duplicate build-system requirement to fix editable installs with uv
'meson-python', # Duplicate build-system requirement to fix editable installs with uv
'numpy >=2.2.4', # Duplicate build-system requirement to fix editable installs with uv
]
docs = [
"furo",
"jupyter-sphinx",
"python-dateutil",
"sphinx",
"sphinx-copybutton",
"sphinx-inline-tabs",
]
lint = ["flake8-rst-docstrings", "pycodestyle", "relint", "ruff"]
test = ["coverage", "pytest", "pytest-xdist"]
[tool.ruff]
# https://docs.astral.sh/ruff/configuration
# Python 3.12 is the minimum supported version
target-version = "py312"
exclude = [
# This directory is full of old autogenerated files.
# Linting it would just get in the way of adding stricter linter rules
# to our actual code.
"src/doc/",
# This directory handles the build process,
# and some parts allow Python versions as old as 2.6, so we don't both linting.
"build/",
]
[tool.ruff.lint]
# Rules that we deliberately do not attempt to follow, either because we
# disagree with them or because following them is not currently practical.
ignore = [
"E501", # Line too long - hard to avoid in doctests, and better handled by black.
# Variable/function names I, O, l - common in math, and not an issue for most monospace fonts
"E741",
"E743",
"PLC2401", # Non-ASCII variables - we deliberately use Greek letters (albeit sparingly)
# The following rules are good in spirit but require some common sense, better enforced through code review.
"PLR09", # Rules about code complexity - better enforced through code review process.
"PLR1714", # Repeated equality comparison - too picky when only doing a couple comparisons.
"PLR2004", # Comparison to magic values - better enforced through code review process.
"PLW1641", # __eq__ without __hash__ - implementations of equivalence classes may have a well-defined notion of equality without a well-defined canonical representation that can be used to compute a hash
# Module level import not at top of file.
# ruff is not aware of our lazy_imports, we may be able to remove this ignore after adopting PEP 810
"E402",
]
select = [
"F", # pyflakes -- https://docs.astral.sh/ruff/rules/#pyflakes-f
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
# ruff-specific rules -- https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF013",
"RUF036",
"TC", # flake8-type-checking - https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc
# pyupgrade -- https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP004",
"UP006",
"UP008",
"UP010",
"UP015",
"UP022",
"UP034",
"UP035",
# pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
# Ideally we would enable (almost) all of the E rules, but too
# many of these rules are in preview to trust that something won't change
# in ruff itself and cause us headaches.
"E101",
"E401",
"E701",
"E702",
"E703",
"E711",
"E712",
"E713",
"E714",
"E721",
"E722",
"E731",
"E742",
"E902",
# pylint - https://docs.astral.sh/ruff/rules/#pylint-pl
# Like with the E rules, this isn't stable enough yet to enable all of PL
# pylint convention - https://docs.astral.sh/ruff/rules/#convention-plc
"PLC0105",
"PLC0131",
"PLC0132",
"PLC0205",
"PLC0206",
"PLC0208",
"PLC0414",
"PLC1802",
"PLC2403",
"PLC3002",
# pylint errors - https://docs.astral.sh/ruff/rules/#error-ple
"PLE0100",
"PLE0101",
"PLE0115",
"PLE0116",
"PLE0117",
"PLE0118",
"PLE0237",
"PLE0241",
"PLE0302",
"PLE0303",
"PLE0305",
"PLE0307",
"PLE0308",
"PLE0309",
"PLE0604",
"PLE0605",
"PLE0643",
"PLE0704",
"PLE1132",
"PLE1142",
"PLE1205",
"PLE1206",
"PLE1300",
"PLE1307",
"PLE1310",
"PLE1507",
"PLE1519",
"PLE1520",
"PLE1700",
"PLE2502",
"PLE2510",
"PLE2512",
"PLE2513",
"PLE2514",
"PLE2515",
# pylint refactor - https://docs.astral.sh/ruff/rules/#refactor-plr
"PLR0124",
"PLR0133",
"PLR0206",
"PLR0402",
"PLR1704",
"PLR1711",
"PLR1716",
"PLR1722",
"PLR1730",
"PLR1733",
"PLR1736",
"PLR2044",
"PLR5501",
# pylint warning - https://docs.astral.sh/ruff/rules/#warning-plw
"PLW0120",
"PLW0127",
"PLW0128",
"PLW0129",
"PLW0131",
"PLW0133",
"PLW0177",
"PLW0211",
"PLW0245",
"PLW0406",
"PLW0602",
"PLW0603",
"PLW0604",
"PLW0642",
"PLW0711",
"PLW1501",
"PLW1507",
"PLW1508",
"PLW1509",
"PLW1510",
"PLW2101",
"PLW2901",
"PLW3301",
]
[tool.ruff.lint.per-file-ignores]
"all.py" = [
"F401", # Unused import - these files are by definition collections of imports.
]
"src/sage/algebras/lie_conformal_algebras/examples.py" = [
"F401", # Unused import - reexports for convenience.
]
[tool.uv]
# Don't use build isolation for sage (it's incompatible with meson-python's editable install)
no-build-isolation-package = ["sagemath"]