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

Infra: only create peps.json at /api/peps.json #4231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Jan 25, 2025

Re: #2584 (comment)

The API should only be available at https://peps.python.org/api/peps.json and not the root https://peps.python.org/peps.json.

We advertise https://peps.python.org/api/peps.json at https://peps.python.org/#api and https://peps.python.org/api/, and a GitHub code search only shows this one in use and not the incorrect one.


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

@hugovk hugovk added bug infra Core infrastructure for building and rendering PEPs labels Jan 25, 2025
@hugovk hugovk requested a review from AA-Turner as a code owner January 25, 2025 11:25
@AA-Turner
Copy link
Member

'Fixed a bug by removing the feature', you might say!

I think the converse is true here, peps.json isn't really an 'API', but just a document listing the metadata from the PEP headers in a slightly easier to use format than RFC (2)822 email headers. As such I think it has better symmetry with peps.rss, which is also at the root. It does no harm to keep both, and I think we should resolve the fact that one isn't documented.

A

@AA-Turner AA-Turner removed the bug label Jan 26, 2025
@hugovk
Copy link
Member Author

hugovk commented Jan 26, 2025

'Fixed a bug by removing the feature', you might say!

:)

Well, this bug/feature was added in a large-ish refactoring PR (#3417) which made no mention of the addition in the description, and was merged 10 minutes later with no review.

I only realised this duplicate endpoint existed when #4226 was opened yesterday, and would have objected to the addition at the time, as we had a long discussion at #2584 about whether to move it to the root, and in the end decided not to.

I think the converse is true here, peps.json isn't really an 'API', but just a document listing the metadata from the PEP headers in a slightly easier to use format than RFC (2)822 email headers. As such I think it has better symmetry with peps.rss, which is also at the root.

I see it as a simple read-only JSON API, much like https://endoflife.date/docs/api, https://swapi.dev and https://open-meteo.com.

It does no harm to keep both, and I think we should resolve the fact that one isn't documented.

I think it can cause confusion to have two copies. Are they different? Will one go away? If we change one, will the other also change? If we start versioning it, do we need to add another duplicate to the root? Or if we expose JSON for each individual PEP, do they all go to the root?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure for building and rendering PEPs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants