Skip to content

PEP 694: Address PEP Delegate's feedback - #4794

Merged
warsaw merged 30 commits into
python:mainfrom
warsaw:pep-694-di-feedback
Jun 27, 2026
Merged

warsaw merged 30 commits into
python:mainfrom
warsaw:pep-694-di-feedback

Conversation

@warsaw

@warsaw warsaw commented Jan 27, 2026 •

Copy link
Copy Markdown
Member

📚 Documentation preview 📚: https://pep-previews--4794.org.readthedocs.build/

* Remove the "action" keys in request bodies, and substitute for explicit end-points.  This feels much more
  REST-ish.  This is for both the publishing and file upload sessions.
* Add an `authentication` cross-reference anchor.
* Add a Recommendations for Client Implementers section for how clients like twine, uv, and GitHub
  actions *might* utilize the PEP 694 API.
* Update the Change Log accordingly.
@warsaw warsaw self-assigned this Jan 27, 2026
@warsaw
warsaw marked this pull request as ready for review January 27, 2026 21:11
@warsaw
warsaw requested a review from dstufft as a code owner January 27, 2026 21:11
@read-the-docs-community

read-the-docs-community Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #33331968 | 📁 Comparing 6df4e94 against latest (ddffeed)

  🔍 Preview build  

3 files changed
± pep-0694/index.html
± pep-0764/index.html
± pep-0790/index.html

@willingc willingc left a comment

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.

Thanks @warsaw.

warsaw added 9 commits June 23, 2026 17:03
* Fixed: some discrepancies about when an open publishing session is reused or when a new session is created.

* Added: some language about creating a new publishing session for a name-version pair even if such has
  already been published.  However the new session disallows uploading a file that has already been published,
  since those are immutable.

* Added some client recommendations about multiple sessions.
* The file's contents are always the authoritative source of truth
* PyPI is actively moving toward extracting metadata from the file.

Also, add a little clarifying text to the Security Implications section.
@warsaw
warsaw requested review from a team and CAM-Gerlach as code owners June 26, 2026 17:09
@warsaw
warsaw merged commit da7b68f into python:main Jun 27, 2026
5 checks passed
@warsaw
warsaw deleted the pep-694-di-feedback branch June 27, 2026 00:38
ethanfurman pushed a commit to ethanfurman/peps that referenced this pull request Oct 8, 2026
…on#4794)

  * Session actions now use dedicated endpoint links instead of an ``action`` key in request bodies.
    Publishing sessions add ``links.publish`` and ``links.extend``; file upload sessions add
    ``links.complete`` and ``links.extend``.  The ``links.session`` and ``links.file-upload-session``
    endpoints are now used only for ``GET`` (status) and ``DELETE`` (cancel) operations.
  * Add non-normative :ref:`Recommendations for Client Implementers <client-recommendations>` section
    with suggested UX patterns for tools like twine, uv, and GitHub Actions.
  * Add FAQ entries explaining why project name and version are required at session creation.
  * Add a :ref:`security-implications` section.
  * Specify that attempting to replace an in-progress file upload returns a ``409 Conflict``.
  * Specify that uploading a file matching one already published for an existing release returns a
    ``409 Conflict``, since published artifacts are immutable.
  * Clarify the wording of the **Multiple Sessions** client recommendation example.
  * Relax session access from the exact creating credentials to any principal authorized to upload to the
    project, evaluated contemporaneously on each request.  Adds an **Authentication and Authorization** model,
    handles permission changes mid-session, supports rotating Trusted Publishing tokens and multiple
    publishers contributing to one session, and notes the related security implications.
  * Remove the optional ``metadata`` key from the file upload session creation request.  The uploaded file is
    the authoritative source of metadata, which the index extracts from the file itself.
  * Define an explicit publishing-session state machine.  Rename the session-level ``pending``
    status to ``open``, add a transitional ``processing`` status for deferred (``202 Accepted``)
    publishing, and document the ``error`` status as a still-editable state that records a failed
    deferred publish (with the reason reported in ``notices``).  Add a **Publishing Session States**
    section with state descriptions and a transition table, specify that a synchronous publish
    failure leaves the session editable rather than entering ``error``, and require the server to
    reject cancellation with a ``409 Conflict`` while a session is ``processing``.  Key the
    **Multiple Session Creation Requests** rule off any non-terminal state rather than ``pending``.
  * Document the file upload session state machine with a **File Upload Session States** section and
    transition table.  Specify that any completion failure -- synchronous or deferred -- moves the
    session to ``error``, that an ``error`` file cannot be repaired in place (the client cancels or
    deletes it and starts a new file upload session), and that the server **MUST** reject a
    ``DELETE`` with a ``409 Conflict`` while a session is ``processing``.
  * Add state transition diagrams to the **Publishing Session States** and **File Upload Session States**
    sections, alongside the existing transition tables.
  * Make the suggested ``twine`` and ``uv`` command-line interfaces consistent: group the staged-session
    operations under a ``session`` subcommand (``session publish``/``session cancel``/``session status``),
    give ``uv`` the same staged-session follow-ups and session-id output as ``twine``, and align the GitHub
    Action's ``stage`` input with the ``--stage`` flag.
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