GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Generate digital attestations for PyPI (PEP 740) by hugovk · Pull Request #198 · python/python-docs-theme

Conversation

@hugovk

@hugovk hugovk commented Sep 27, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PEP 740 ("Index support for digital attestations") introduces signatures which links the PyPI package to the GitHub repo, and helps users verify the source and authenticity of packages.

PyPI is still implementing support, but we can already start using it, which should also help them test out.

  • https://peps.python.org/pep-0740/
  • https://github.com/pypa/gh-action-pypi-publish#generating-and-uploading-attestations
  • [Roadmap] Implement PEP 740 pypi/warehouse#15871

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hugovk added 2 commits September 27, 2024 14:26
@hugovk
Generate digital attestations for PyPI (PEP 740)
beb9aab
@hugovk
Update pre-commit
7d634de
@hugovk hugovk mentioned this pull request Sep 27, 2024
Generate digital attestations for PyPI (PEP 740) python/blurb#28
Merged
ezio-melotti
ezio-melotti approved these changes Oct 6, 2024
View reviewed changes
Comment thread .github/workflows/pypi-package.yml
Comment on lines +51 to +52
with:
attestations: true

@ezio-melotti ezio-melotti Oct 6, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

So this is what actually generates the attestations, and even though the feature is still experimental we can still enable it here (and in the other repos) and let gh-action-pypi-publish deal with potential API changes, right?

I guess the other changes are unrelated, but it was convenient to bundle them together.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk Oct 6, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yes, pretty much. There's a chance we may need to change config here too, but gh-action-pypi-publish should deal with most of it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ezio-melotti reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread pyproject.toml

@ezio-melotti ezio-melotti Oct 6, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Just out of curiosity, do you know what caused the changes below?
Some of them seem backward, at least coming from Python (e.g. removing the double space before # and adding spaces within [] and {}), at least coming from Python.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk Oct 6, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

They nearly all came from the pyproject-fmt upgrade from 1.x to 2.x.

We needed to bump actionlint so it wouldn't fail on the new attestations config, then I updated the other pre-commit at the same time.

One pyproject-fmt change is to align all the comments. Before, we just so happened to manually align them. Now, it automatically does it. I'm not sure why pyproject-fmt chose a single space, but it's a TOML file, not a Python file.

(Looks like it's using this TOML formatter which has align_comments but no option for how many spaces.)


I manually adjusted this into a single line:

include = [
    "python_docs_theme/",
]

to:

include = [ "python_docs_theme/" ]

The extra spaces are also from pyproject-fmt, and common in examples in the spec: https://toml.io/en/v1.0.0

Again, this TOML not Python. I guess I might slightly prefer more a Python-y style, but having an autoformatter keep things consistent, and easier to compare across projects, is much more valuable for me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ezio-melotti reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@ezio-melotti ezio-melotti Oct 6, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yep, I figured that TOML might be following different conventions, and it makes sense to be consistent with those.
Thanks for looking into this!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@hugovk
hugovk merged commit 3e81cef into python:main Oct 6, 2024
@hugovk
hugovk deleted the attest branch October 6, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ezio-melotti ezio-melotti ezio-melotti approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hugovk @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.