Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgs/sage-{docbuild,setup,sws2rst}: Migrate from setup.cfg to pyproject.toml #36562

Merged
merged 10 commits into from
Dec 6, 2023
Merged
40 changes: 40 additions & 0 deletions pkgs/sage-docbuild/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "sage-docbuild"
description = "Sage: Open Source Mathematics Software: Build system of the Sage documentation"
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 :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Mathematics",
]
urls = {Homepage = "https://www.sagemath.org"}
dependencies = ["sphinx"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't sage_docbuild also depend on jupyter-sphinx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are treating the dependencies on Sphinx extensions (declared in sage_docbuild/conf.py) as belonging to sagemath_doc_html

Copy link
Member

@kiwifb kiwifb Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the logic but I am not very comfortable with it. Part of me feels that if you are going that route, sphinx should be treated the same way. It is not needed at install either, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A difference is that sphinx is imported by sage_docbuild.sphinxbuild.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think I will argue with that one. Where to declare runtime dependency seems to be a bit unsettled.

dynamic = ["version"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[tool.setuptools]
packages = [
"sage_docbuild",
"sage_docbuild.ext",
]
include-package-data = false

[tool.setuptools.dynamic]
version = {file = ["VERSION.txt"]}
32 changes: 0 additions & 32 deletions pkgs/sage-docbuild/setup.cfg

This file was deleted.

47 changes: 47 additions & 0 deletions pkgs/sage-setup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "sage-setup"
description = "Sage: Open Source Mathematics Software: Build system of the Sage library"
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 :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Mathematics",
]
urls = {Homepage = "https://www.sagemath.org"}
requires-python = ">=3.9, <3.12"
dependencies = [
"pkgconfig",
"jinja2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about cython? I believe both jinja2 and cython are runtime dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distributions that use Cython declare that in their build-system requires. I don't think we need it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an argument for distribution to declare their use of jinja2 as well. And there is actually no call to pkgconfig in sage_setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably jinja2 should actually be an optional dependency (formerly known as extras-require) because only the packages that you sage_setup.autogen use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about pkgconfig.

This comment was marked as duplicate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After modularization, there will be more uses, but I've made the change now.

]
dynamic = ["version"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[tool.setuptools]
packages = [
"sage_setup",
"sage_setup.autogen",
"sage_setup.autogen.interpreters",
"sage_setup.autogen.interpreters.specs",
"sage_setup.command",
]
include-package-data = false

[tool.setuptools.dynamic]
version = {file = ["VERSION.txt"]}
39 changes: 0 additions & 39 deletions pkgs/sage-setup/setup.cfg

This file was deleted.

25 changes: 25 additions & 0 deletions pkgs/sage-sws2rst/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "sage-sws2rst"
description = "Sage: Open Source Mathematics Software: SageNB worksheet converter"
license = {text = "GNU General Public License (GPL) v3 or later"}
authors = [{name = "The Sage Developers", email = "sage-support@googlegroups.com"}]
urls = {Homepage = "https://www.sagemath.org"}
dynamic = ["version"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[tool.setuptools]
script-files = ["bin/sage-sws2rst"]
include-package-data = false

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.dynamic]
version = {file = ["VERSION.txt"]}
16 changes: 0 additions & 16 deletions pkgs/sage-sws2rst/setup.cfg

This file was deleted.

Loading