Skip to content

pkgs/sage-conf: Move metadata from setup.cfg to pyproject.toml#36561

Closed
mkoeppe wants to merge 11 commits intosagemath:developfrom
mkoeppe:sage_conf_pyproject_toml
Closed

pkgs/sage-conf: Move metadata from setup.cfg to pyproject.toml#36561
mkoeppe wants to merge 11 commits intosagemath:developfrom
mkoeppe:sage_conf_pyproject_toml

Conversation

@mkoeppe
Copy link
Copy Markdown
Contributor

@mkoeppe mkoeppe commented Oct 28, 2023

This is a trivial "chore" PR. It updates Python metadata to the latest format. No controversies about the current format are known about in the Python community. In a typical open source project, someone in a Maintainer role would open a PR and then immediately merge it, or when receiving such a PR from the outside, quickly review and merge it (examples: my PRs pytest-dev/pytest-mock#410 (merged in within 1 day), pyodide/pyodide#4472, pytest-dev/pytest-xdist#1020,
sagemath/cypari2#158, fplll/fpylll#258, polymake/JuPyMake#2, cvxpy/cvxpy#2276, sagemath/cysignals#177).

📝 Checklist

  • 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

@kiwifb
Copy link
Copy Markdown
Member

kiwifb commented Oct 29, 2023

There should be links for sage_conf_conda and sage_conf_pypi or do they not show up in github?

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Oct 29, 2023

These links are already in the repo and there's no change to them on this PR.

@kiwifb
Copy link
Copy Markdown
Member

kiwifb commented Oct 29, 2023

Scrap that, I thought the file was brand new. It is already linked. Too early on Monday for me to review properly.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Oct 29, 2023

Note that there was already pyproject.toml for the build-system information; here we're just adding more sections to the file.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Oct 29, 2023

Happy Monday!

@tobiasdiez
Copy link
Copy Markdown
Contributor

Please make sure that this change is compatible with the usage of pyproject.toml in #36489 (I think that PR uses the default config that you overwrite here).

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Oct 29, 2023

Sure, there's no reason for that implementation of sage-conf to be incompatible with this pyproject.toml.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 2, 2023

Let's get this in please

@tobiasdiez
Copy link
Copy Markdown
Contributor

Sure, there's no reason for that implementation of sage-conf to be incompatible with this pyproject.toml.

I've tried it with #36489 and its not working as there is no _sage_conf folder anymore. I think its better to stick with the defaults (i.e. either a src or sage_conf folder containing the sources).

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 2, 2023

That #36489 is not ready cannot be blamed on this PR.

Copy link
Copy Markdown
Member

@kiwifb kiwifb left a comment

Choose a reason for hiding this comment

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

LGTM, I do not have any unexpected issue with it in sage-on-gentoo.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 2, 2023

Thank you!

@tobiasdiez
Copy link
Copy Markdown
Contributor

As I've said before, these lines

packages = ["_sage_conf"]
py-modules = ["sage_conf"]

are not okay for me.

(I think its also not polite to cherry pick commits from a PR and to then introduce changes that lead to conflicts with that PR)

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 3, 2023

As I've said before, these lines

packages = ["_sage_conf"]
py-modules = ["sage_conf"]

are not okay for me.

Tobias, what Python packages and modules are part of the sage-conf distribution is not a matter of opinion or preference, or anything that makes sense to "negotiate". It is just a fact, which was previously declared in setup.cfg; and now it is declared in pyproject.toml.

I also know that you know that.

@tobiasdiez
Copy link
Copy Markdown
Contributor

Matthias, you are blocking #36489 and on top of that you try to enforce your conventions via this PR. This is not a nice approach.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 3, 2023

No, Tobias, as I have just explained, what is declared in pyproject.toml "is not a matter of opinion or preference", and certainly it is not "my convention". It is the standard. Do I need to point out that you opened #33577, which asks for exactly what is done in this PR?

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Nov 4, 2023

---> sage-abuse (again)

(Edit: I've referred this incident -- abusing of your privileges as a member of the Triage team, and making false and harmful accusations -- to the sage-abuse committee.)

@tobiasdiez
Copy link
Copy Markdown
Contributor

tobiasdiez commented Nov 4, 2023

Matthias, please don't add a positive review label when there is a negative review. Thanks!

I respect that you don't agree with me nor that you want to discuss things with me, but that doesn't imply that my review just disappears.

@vbraun vbraun force-pushed the develop branch 2 times, most recently from 883e05f to e349b00 Compare November 12, 2023 16:25
@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 6, 2023

Lint failure is unrelated, fixed in #36822.

@tornaria
Copy link
Copy Markdown
Member

tornaria commented Apr 8, 2024

Can you just set the version of setuptools in pyproject.toml?

@NathanDunfield
Copy link
Copy Markdown
Contributor

+1: Moving from setup.cfg to pyproject.toml is a good thing. There are a dozen other uses of pyproject.toml.m4 in the Sage repo, so this PR conforms to current practice.

@tornaria
Copy link
Copy Markdown
Member

tornaria commented Apr 8, 2024

+1: Moving from setup.cfg to pyproject.toml is a good thing. There are a dozen other uses of pyproject.toml.m4 in the Sage repo, so this PR conforms to current practice.

It's a regression, since we are moving from setup.cfg to pyproject.toml.m4.

There's no technical need to use m4 here. It's just a level of indirection and a build dependency that is not even stated in the build-system requires.

The solution is trivial: replace SPKG_INSTALL_REQUIRES_setuptools by the actual setuptools version constraint that is necessary for sage-conf. Why are we arguing about such a trivial review request?

"Topic :: Scientific/Engineering :: Mathematics",
]
urls = {Homepage = "https://www.sagemath.org"}
requires-python = ">=3.9, <3.13"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we get rid of the upper bound here? This package is relatively simple python that should not be tied to the version of python.

This allows more flexibility (e.g. to use a released sage-conf with a beta version of sagemath-standard when one is experimenting with an update of python).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. The version bound is set for uniformity.

@orlitzky
Copy link
Copy Markdown
Contributor

orlitzky commented Apr 8, 2024

-1

Sorry it took so long, I thought this was one of the ten other disputed tickets about the same thing. This makes sage-conf depend on sage-the-distribution. We should be going the other way.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 8, 2024

It's a regression, since we are moving from setup.cfg to pyproject.toml.m4.

It's not a "regression" because there's nothing wrong with the documented design.

There's no technical need to use m4 here.

Any other synchronization mechanism would also work. But m4 is what we use. It's outside of the scope of this PR to change what we use.

It's just a level of indirection

The indirection makes it more maintainable by centralizing constraints that are the same.

and a build dependency that is not even stated in the build-system requires.

By design, after the templating with m4, pkgs/ contains standard Python distribution package source trees; not before.

The solution is trivial: replace SPKG_INSTALL_REQUIRES_setuptools by the actual setuptools version constraint that is necessary for sage-conf. Why are we arguing about such a trivial review request?

We aren't "arguing". You are demanding a change that is outside of the scope of this PR.
Artificial friction.

@orlitzky
Copy link
Copy Markdown
Contributor

orlitzky commented Apr 8, 2024

It's a regression, since we are moving from setup.cfg to pyproject.toml.m4.

It's not a "regression" because there's nothing wrong with the documented design.

It's clear that some people disagree with this statement.

It's just a level of indirection

The indirection makes it more maintainable by centralizing constraints that are the same.

It also erroneously centralizes constraints that are not the same. But more importantly (to me), it ties sage-conf to sage-the-distribution, and is confusing as hell to the... basically everyone who is expecting a plain pyproject.toml file based on experience with other python projects.

We aren't "arguing". You are demanding a change that is outside of the scope of this PR. Artificial friction.

I think we are free to vote against this PR because it further entrenches a bad design, or because we are drunk, or for any other reason.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 8, 2024

I think we are free to vote against this PR because it further entrenches a bad design, or because we are drunk, or for any other reason.

Yes, that's how voting works. But that does not stop me from reminding community members about their duty to act responsibly.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2024

Documentation preview for this PR (built with commit 9977681; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 19, 2024

The current tally:

Please vote!

@saraedum
Copy link
Copy Markdown
Member

I vote -1 on this PR.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 27, 2024

I'll note that I am the developer who has been maintaining these distribution packages in pkgs/. I have built and maintain the templating facility (via m4) because synchronizing the version information and other metadata simplifies this maintenance work; it's a carefully thought out and executed part of my plan for the modularized distributions. I would ask reviewers here on the PR and similar PRs to take this into account.

@kcrisman

This comment was marked as off-topic.

@mkoeppe

This comment was marked as abuse.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Aug 3, 2024

9 months later, this PR is still open.

The current tally:

Please vote!

Copy link
Copy Markdown
Contributor

@culler culler left a comment

Choose a reason for hiding this comment

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

This PR seems to replace a pyproject.toml file by an m4 template that can be used to
automatically update version information when generating the pyproject.toml file for a new version. I don't see anything particularly controversial about that. There are surely alternatives to using m4, but Sage is already using m4, so this choice does not make a significant difference.

@orlitzky
Copy link
Copy Markdown
Contributor

orlitzky commented Feb 6, 2026

pkgs/sage_conf no longer exists (c8a83f50c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: distribution disputed PR is waiting for community vote, see https://groups.google.com/g/sage-devel/c/IgBYUJl33SQ p: critical / 2 v: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.