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