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