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

Add an initial specification doc for Dependency Groups #1623

Merged
merged 3 commits into from
Dec 23, 2024

Conversation

sirosen
Copy link
Contributor

@sirosen sirosen commented Oct 28, 2024

This is a first draft doc, based off of the original spec + reading the surrounding specs for examples of what's desirable.

I have in some cases reworded things from the original PEP document to try to simplify and clarify, but we can hew closer to the original spec text if that's preferable.
For example, I simplified the section which defines Dependency Group Includes: the spec defines Dependency Object Specifiers, the class of tables inside of dependency groups, and then defines one type of Dependency Object Specifier: a Dependency Group Include. I think that phrasing is good for the original PEP, which wants to lay out the idea that we could define other table types in the future, but not necessarily useful for someone who wants to just read and implement the spec as it currently stands.

In many cases, I very intentionally lifted-and-shifted original PEP text, since we worked hard on it and it's quite good.

Unlike the original PEP, there are not that many examples given here.
I also was uncertain if I should link out to the dependency-groups package instead of or in addition to the smaller and simpler reference implementation from the PEP.


📚 Documentation preview 📚: https://python-packaging-user-guide--1623.org.readthedocs.build/en/1623/

@webknjaz
Copy link
Member

webknjaz commented Nov 3, 2024

May I suggest adding the PEP "as is" first. In a separate PR. This would allow seeing the diff between that and simplification. Alternatively, put it in here in a separate commit, leaving the changes out so they'd only show up in the second commit.
I think this would be good for transparency.

@sirosen
Copy link
Contributor Author

sirosen commented Nov 5, 2024

Sure, that's a good idea to make the diff more readable! I'll have to come back to this and rewrite the commit history to be

  1. Add the PEP contents (probably with some omissions, e.g. appendices)
  2. Edit that down

I'm not able to do it right now, but maybe tomorrow.

@webknjaz
Copy link
Member

@sirosen ack

@sirosen
Copy link
Contributor Author

sirosen commented Nov 25, 2024

Oops! I forgot about this PR! I'll make an update this week. Thanks for the ping!

This content is copied from the PEP, with the following
characteristics:
- the initial overview and examples are new
- the "History" footer is new
- all of the other sections are copied from the PEP verbatim
This is a significant revision from the PEP content to make the
content appropriate for the packaging specs. In particular, the
following changes are made:

- references to "this PEP" are all removed
- "Dependency Object Specifiers" are a layer of indirection around
  includes, and are removed from the documentation -- instead, the doc
  jumps straight to the (only) specific case now: the includes
- the section on install UX and extras has been rewritten for brevity,
  removing the hypothetical example `pip` interface and folding
  together the install notes and the notes about extras
- the section on validation/linting has been reorganized around an
  example, and the note on linters has been moved to a `note`
  admonition block
@sirosen
Copy link
Contributor Author

sirosen commented Dec 16, 2024

It's slightly embarrassing to have forgotten again, but that's what happened. I just checked my open PRs and saw this. I got it done by grabbing PEP text, rewriting my commit, and then checking out my rewrite over the top of it.

Most of the edits are mild but I also see that some of the line break positions changed -- I can't recall the exact process by which I did the original work, but I may have been copying from a rendered copy of the PEP at times. As a result, there's some noise in the diff, but I hope it's still easier to review.

@ncoghlan ncoghlan added this pull request to the merge queue Dec 17, 2024
@ncoghlan
Copy link
Member

@sirosen Added to the merge queue. Once it's live, you can submit the changes over in the PEPs repo to link to the canonical spec location.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2024
@sirosen
Copy link
Contributor Author

sirosen commented Dec 17, 2024

I'm a little unclear if the merge-queue signal means that I should rebase, or just wait? (Sorry, not familiar with this GitHub feature!)

@webknjaz
Copy link
Member

webknjaz commented Dec 18, 2024

Urgh... It's #1744. It needs to be fixed before merging can succeed.

(merge queue failure https://github.com/pypa/packaging.python.org/actions/runs/12367078036/job/34514776165#step:5:849)

@webknjaz
Copy link
Member

@sirosen oh, and no, you don't need to rebase. Merge Queues make a temporary branch with your PR merged into main and then a GHA workflow runs against that. If it succeeds, then main is fast-forwarded to that merge commit. It didn't, so the PR was dropped as potentially breaking main.

When it doesn't fail because of some external circumstances (like in this case, with PyPI changing things), it is able to catch cases when two PRs have green CI but when they are merged together, it would fail (which isn't evident separately). Something like https://bors.tech/essay/2017/02/02/pitch/ but built-in (and more limited).

@ncoghlan
Copy link
Member

#1767 has been posted with the PyPI link check workaround

@ncoghlan ncoghlan enabled auto-merge December 23, 2024 04:03
@ncoghlan ncoghlan added this pull request to the merge queue Dec 23, 2024
Merged via the queue into pypa:main with commit e7acc02 Dec 23, 2024
5 checks passed
@sirosen sirosen deleted the dependency-groups branch December 23, 2024 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants