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: Use Docutils' list-table syntax for PEP 0 #2616

Merged
merged 5 commits into from
Jun 8, 2022

Conversation

AA-Turner
Copy link
Member

Change in support of subindices.

A

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented May 21, 2022

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@AA-Turner
Copy link
Member Author

Save for the CLA check, this is now done -- identical output in PEP 0, and a nice reduction in complexity as (almost) all of the custom PEP 0 transform is now gone (only the email address masking logic remains).

A

@AA-Turner
Copy link
Member Author

*Not quite identical output to PEP 0, PEP titles are no longer truncated, and PEP 604's title now links correctly.

A

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

It would be nice to have some tests for the changed emit_* functions in writer.py.

(Testing just emit_pep_category would also cover emit_column_headers and emit_pep_row.)

https://codecov.io/gh/python/peps/compare/278070ac9765efbd34e325d6080d8162bd529e99...b3a603d2fede03f207a26eaec584d13e6f8ebb13/src/pep_sphinx_extensions/pep_zero_generator/writer.py?before=pep_sphinx_extensions/pep_zero_generator/writer.py

Comment on lines +90 to +92
self.emit_text(" - PEP")
self.emit_text(" - PEP Title")
self.emit_text(" - PEP Author(s)")
Copy link
Member

Choose a reason for hiding this comment

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

"Author(s)" is a bit ugly, for a table heading can we just put "Authors" or "Author"?

Also I think it's clear that the title is the PEP title, and the authors are the PEP authors, in a list of PEPs on the PEP index page on https://peps.python.org/ :)

Suggested change
self.emit_text(" - PEP")
self.emit_text(" - PEP Title")
self.emit_text(" - PEP Author(s)")
self.emit_text(" - PEP")
self.emit_text(" - Title")
self.emit_text(" - Authors")

@hugovk hugovk added the infra Core infrastructure for building and rendering PEPs label May 29, 2022
@hugovk hugovk changed the title Use Docutils' list-table syntax for PEP 0 Infra: Use Docutils' list-table syntax for PEP 0 May 29, 2022
@AA-Turner
Copy link
Member Author

It would be nice to have some tests

I'm not sure what these would look like -- there's no real point to unit tests of just the function here, as what matters is that the entire list is a valid input to the list-table directive (a two-level list where the length of every second level list is uniform).

I'd then argue that the integration test part is handled by if it is parsed correctly as reST!

A

@AA-Turner
Copy link
Member Author

(Also, the CLA is still not working -- just tried again)

@hugovk
Copy link
Member

hugovk commented May 29, 2022

Yeah, tests not so valuable here. If nothing else, a test would show the code is at least running without exceptions, although we should probably notice it (but if not a super simple test would have helped ;)

CLA: I've pinged @ambv again.

@AA-Turner AA-Turner self-assigned this May 29, 2022
@AA-Turner AA-Turner closed this May 30, 2022
@AA-Turner AA-Turner reopened this May 30, 2022
@JelleZijlstra JelleZijlstra merged commit f7c9e62 into python:main Jun 8, 2022
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.

3 participants