Skip to content

pkgs/sagemath-standard: Move metadata from setup.cfg to pyproject.toml#36951

Merged
vbraun merged 12 commits intosagemath:developfrom
mkoeppe:sagemath_standard_pyproject_toml
Apr 12, 2024
Merged

pkgs/sagemath-standard: Move metadata from setup.cfg to pyproject.toml#36951
vbraun merged 12 commits intosagemath:developfrom
mkoeppe:sagemath_standard_pyproject_toml

Conversation

@mkoeppe
Copy link
Copy Markdown
Contributor

@mkoeppe mkoeppe commented Dec 23, 2023

Modernize the metadata.

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).

Also fixes the pyproject.toml build requirements of sagemath-standard, broken since 10.2, hence "critical".

📝 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

name = "sagemath-standard"
description = "Sage: Open Source Mathematics Software: Standard Python Library"
dependencies = [
SPKG_INSTALL_REQUIRES_sage_conf
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can simply use dynamic metadata and

dependencies = {file = ["build/pkgs/whatever/install-requires.txt", "build/pkgs/whatever2/install-requires.txt", ...]}

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.

Thanks, but that would not be an improvement.
It would make the sdist of this distribution depend on the monorepo / the Sage distribution.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

setuptools automatically includes the linked files (and only these) in the sdist.

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.

These file paths build/pkgs/... do not exist in this directory.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 30, 2023

Let's get it in.

@orlitzky
Copy link
Copy Markdown
Contributor

Rebase onto develop please?

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 31, 2023

Rebased.

@orlitzky
Copy link
Copy Markdown
Contributor

Both choices for the metadata (./bootstrap or file=[...]) reference the build tree from src and therefore look comparably bad to me w.r.t. maintaining library/distro separation. But we also don't need to redesign it right now. Does this cause problems for anyone? If not, this is standard python packaging churn and is fine with me.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 31, 2023

Both choices for the metadata (./bootstrap or file=[...]) reference the build tree from src

Yes, but bootstrap only runs at ... bootstrapping time, so it is a "repository concern" only and not a "distribution concern" if that makes sense. After running bootstrap, each subdirectory in pkgs is a self-contained source directory of a Python distribution.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 31, 2023

Also, in PRs such as the following, I make less code dependent on the file layout within build/pkgs. So poking into there directly from the pyproject.toml would run counter to this work.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Dec 31, 2023

Does this cause problems for anyone?

No, I wouldn't know how it could.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Jan 1, 2024

Let's get this in please.

Copy link
Copy Markdown
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

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

It works well. LGTM.

@tobiasdiez
Copy link
Copy Markdown
Contributor

Both choices for the metadata (./bootstrap or file=[...]) reference the build tree from src and therefore look comparably bad to me w.r.t. maintaining library/distro separation. But we also don't need to redesign it right now.

@kwankyu Sorry, forgot to mention that this suggestion was implemented in #36982.

To not hold up this PR here until #36982 is merged, I would be fine for now with putting the dynamically created information in file that is generated during bootstrap and included in pyproject.toml via the file tag.

@orlitzky
Copy link
Copy Markdown
Contributor

orlitzky commented Jan 2, 2024

It works well. LGTM.

There's now a conflicting proposal in #36982, both are probably headed to the dispute pile.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Jan 2, 2024

To not hold up this PR here until #36982 is merged, I would be fine for now with putting the dynamically created information in file that is generated during bootstrap and included in pyproject.toml via the file tag.

This PR does not have to wait for any such innovations.

@vbraun
Copy link
Copy Markdown
Member

vbraun commented Jan 5, 2024

Merge conflict

@jhpalmieri
Copy link
Copy Markdown
Member

On Thursday, assuming the vote on sage-devel continues the way it currently looks, you will be able to try to persuade other Sage developers of your perspective and use the disputed PR mechanism. You should view the setting of this back to "positive review" as correcting the mislabeling that occurred when that label was removed. (Once it received the original positive review, the undoing of that label was inappropriate in this case, so the Sage Code of Conduct Committee is restoring its status.)

What about

* [sagemath-standard: include sage_setup in sdist #37287 (comment)](https://github.com/sagemath/sage/pull/37287#issuecomment-1954881868)

* [Readd init files #36753 (comment)](https://github.com/sagemath/sage/pull/36753#issuecomment-1952569267)

* etc.

Once a ticket has a "disputed" label, its review status should not be changed. (This policy was communicated only to a few developers, not widely as it should have been.) On those PRs, the ticket was labeled as disputed, then the ticket was given a positive review, and then the positive review was undone to comply with the policy to keep the labels as they were when it was tagged as disputed.

@tornaria
Copy link
Copy Markdown
Member

Once a ticket has a "disputed" label, its review status should not be changed. (This policy was communicated only to a few developers, not widely as it should have been.) On those PRs, the ticket was labeled as disputed, then the ticket was given a positive review, and then the positive review was undone to comply with the policy to keep the labels as they were when it was tagged as disputed.

I added the disputed label myself (see #37287 (comment)) just to indicate a technical concern by someone else. I did not mean what you say above, in fact you'll see I added needs review at the same time I added the disputed label.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Mar 12, 2024

In this case, there's a competing PR at [...]

@orlitzky Elsewhere, I have explained how pointing to such so-called competing PRs presents a false dichotomy. There's nothing in this PR here that would preclude making design changes as a follow up. In the meantime, this PR is ready (and has been, for months) and is an obvious and clear improvement.

@orlitzky
Copy link
Copy Markdown
Contributor

In this case, there's a competing PR at [...]

@orlitzky Elsewhere, I have explained how pointing to such so-called competing PRs presents a false dichotomy. There's nothing in this PR here that would preclude making design changes as a follow up. In the meantime, this PR is ready (and has been, for months) and is an obvious and clear improvement.

Yes, but in certain cases you're asking for commit wars to replace the label wars and that will waste a lot more of everyone's time.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Mar 12, 2024

@orlitzky Yes, I can also imagine many more ways how bad actors can obstruct and disrupt development.

But this should not have a bearing on how we do Sage development. Our standard of review is clear: Is it an improvement? Is it ready? Then we merge it.

@jhpalmieri
Copy link
Copy Markdown
Member

I'm posting to record a vote of -1 on behalf of Tobias Diez.

@kiwifb
Copy link
Copy Markdown
Member

kiwifb commented Mar 14, 2024

+1 from me.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Mar 14, 2024

@kcrisman Responding to your suggestion in https://groups.google.com/g/sage-devel/c/IgBYUJl33SQ/m/ciVrZ7x0AQAJ

I am the main author of this PR. I confirm that I am +1 on merging its current version.

This is a properly focused PR which makes a routine change, modernizing the Python metadata format. It is consistent with what we already have in the Sage repository (#36951 (comment)).
And I have contributed similar changes to numerous other projects, including:

As explained in #36951 (comment) and before, opening a "competing PR" of vastly larger scope (#36982) and using it to argue that the present PR should not be merged is a deliberate use of a fallacious dichotomy -- and just one of several manipulation techniques on display here.

@kwankyu
Copy link
Copy Markdown
Collaborator

kwankyu commented Mar 14, 2024

Still +1 from me.

@roed314
Copy link
Copy Markdown
Contributor

roed314 commented Mar 15, 2024

Based on @kwankyu's suggestion and discussion by the new Code of Conduct Committee, I'm setting this ticket to Needs Review so that all the disputed tickets start with a clean slate prior to being update based on voting. Starting at midnight US/Pacific time tonight anyone involved should feel free to set the status to positive review or needs review in accordance with the new policy.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 7, 2024

I'm counting:

Thus setting to positive review.

@tornaria
Copy link
Copy Markdown
Member

tornaria commented Apr 8, 2024

You missed my concerns #36951 (comment)

I'm -1 on this for several reasons:

  • I think moving to pyproject.toml is a good idea, as it's the modern way python packages work; however, it should be pyproject.toml and not pyproject.toml.m4.
  • You need to fix build dependencies. Right now you require a lot of dependencies just to create a sdist.
  • This conflicts with other disputed PRs and I believe the way to move forward is to come together and figure out a reasonable compromise between all the different positions

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 8, 2024

You missed my concerns #36951 (comment)

No, I didn't.

I'm -1 on this for several reasons:

  • I think moving to pyproject.toml is a good idea, as it's the modern way python packages work; however, it should be pyproject.toml and not pyproject.toml.m4.

Scope, Gonzalo, scope. As explained in #36951 (comment)

  • You need to fix build dependencies. Right now you require a lot of dependencies just to create a sdist.

No, I don't to fix anything. I've explained it to you already. That's simply not how setuptools works.

  • This conflicts with other disputed PRs

No, it does not.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2024

Documentation preview for this PR (built with commit 18cb712; changes) is ready! 🎉

@jhpalmieri
Copy link
Copy Markdown
Member

+1 from me.

@mkoeppe
Copy link
Copy Markdown
Contributor Author

mkoeppe commented Apr 13, 2024

Thanks, John.

@saraedum
Copy link
Copy Markdown
Member

The changes from this PR are now at #37902 which reverts the revert from #37796.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants