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 sphinx support #1385

Open
wants to merge 110 commits into
base: master
from
Open

Add sphinx support #1385

wants to merge 110 commits into from

Conversation

@AA-Turner
Copy link

@AA-Turner AA-Turner commented Apr 26, 2020

[potentially resolves #2]

This adds sphinx as a build process, potentially resolving issue #2. Note that there are a couple of hacks - on generating the title and contents elements for each PEP's HTML representation - I (personally) think that it would be clearer to have these directives in the source PEP files but I'm not sure if this would be allowed. (If it is I am of course happy to do this work!)

I haven't touched the bash.deploy script, and I endeavoured to ensure that the makefile still outputs a tarball of the files and the RSS file, retaining what was previously happening.

Sphinx generates two index files (contents and genindex) which I think are uncessary given PEP 0, but I think that if the relbars at the top and bottom are disabled then there will be minimal impact (I looked for a way to disable generation but couldn't find one).

Finally a few misc notes:

  • The theme is currently the default classic theme - I imagine that this will want changing but kept this just for ease at the moment
  • I wasn't sure what to put for copyright/author/release but I'm not sure they're needed given the right theme
  • I had to redefine PEPHeader and PEPContents from docutils.transforms.peps - I don't know if they should be updated there and then simply imported, or who the right person to ask on that would be, but happy to do the work once a answer is arrived at!

Thanks,
Adam

@the-knights-who-say-ni
Copy link

@the-knights-who-say-ni the-knights-who-say-ni commented Apr 26, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@AA-Turner

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Apr 26, 2020

Signed agreement

@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Apr 26, 2020

Also of note is that I wasn't sure what minimum version of Python I had to support so I went off of travis, which targets 3.7, and used newer features like f-strings etc. If there is a more formal minimum please let me know and I'll make the needed changes.

@AA-Turner AA-Turner force-pushed the AA-Turner:add-sphinx-support branch from 46d6f34 to ae206d1 Apr 26, 2020
@merwok merwok removed the CLA not signed label Apr 27, 2020
@merwok
Copy link
Member

@merwok merwok commented Apr 27, 2020

It’s nice to see your progress here!

The CLA check is based on bugs.python.org accounts: do you have one there, with your github username in your profile? Please check the steps detailed in the link in the bot’s message #1385 (comment)

The PEP pages repeat the PEP tile in the table of contents, which adds a level of nesting that’s not wanted. Could you address this?

@AA-Turner AA-Turner force-pushed the AA-Turner:add-sphinx-support branch from f9479a3 to 24b5d01 Apr 27, 2020
@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Apr 27, 2020

It’s nice to see your progress here!

Thanks!

The CLA check is based on bugs.python.org accounts: do you have one there, with your github username in your profile? Please check the steps detailed in the link in the bot’s message #1385 (comment)

I signed 2 days ago - my latest push seems to have triggered the Kight to say Ni!

The PEP pages repeat the PEP tile in the table of contents, which adds a level of nesting that’s not wanted. Could you address this?

Will do

.travis.yml Outdated Show resolved Hide resolved
@AA-Turner AA-Turner force-pushed the AA-Turner:add-sphinx-support branch from ace5688 to f5bc06e Apr 29, 2020
Makefile Outdated Show resolved Hide resolved
@AA-Turner AA-Turner force-pushed the AA-Turner:add-sphinx-support branch from 3a851b3 to 4f143ae May 16, 2020
Copy link
Member

@vstinner vstinner left a comment

I cannot review this PR, it's too big. Try maybe to split it into smaller parts, or try to only build a subset of PEPs.

docutils.conf Outdated Show resolved Hide resolved
@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Jun 17, 2020

I cannot review this PR, it's too big. Try maybe to split it into smaller parts, or try to only build a subset of PEPs.

Hi Victor -- thanks for the comment! I don't have much experience with breaking up PRs, especially as everything is interdependent but will have a go. I think the main themes / sub-areas I'd identify would be:

  • sphinx core support,
  • current pydotorg support,
  • custom docutils parsers,
  • PEP0 process changes,
  • theming.

If you have any suggestions on natural breakpoints they would be appreciated, otherwise I will have a go shortly.

@the-knights-who-say-ni
Copy link

@the-knights-who-say-ni the-knights-who-say-ni commented Aug 15, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@JimJJewett

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

AA-Turner added 6 commits Apr 24, 2020
- RFC2822 headers work
- Contents page generated
- Title autogeneration not working
- PEP 0 not started
Also add pep_parser as I missed it
@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Aug 15, 2020

I cannot review this PR, it's too big. Try maybe to split it into smaller parts, or try to only build a subset of PEPs.

Hi Victor (@vstinner) - I have now broken the PR into smaller chunks, apologies for the delay. Please let me know if smaller logical units would be useful and I will do so.

#1565 - core PR
#1566 - docutils core, transforms/parsing/writing
#1567 - PEP 0 generation & hooks
#1568 - theming (both CSS and templating)
#1569 - pythondotorg compatability - very much a temporary layer.

Thanks,
Adam

Co-authored-by: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com>
@hugovk
Copy link
Contributor

@hugovk hugovk commented Sep 6, 2020

Thanks for splitting them into logical blocks, but at least each one can't be merged independently as the CI fails, because they're still dependent on each other, so that may still be a review blocker.

Is it all possible to split out individual chunks that could be merged independently, and so the CI passes? They might be small, but would help reduce the size a bit.

I don't have merge rights, but perhaps a good approach would be to aim to have parallel deploys: the old, existing one, and also a new one to Read the Docs. Then once RTD has been verified, it could be set as the main location and the old one disabled.

It would be really great to move forward with this, especially as it's difficult to build python.org locally for testing things like #1577.

@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Sep 6, 2020

Hi Hugo,

The CI fails partially as all the PRs are using the 'final' state travis recipe - if I reverted to the current (and added the pep2html script back) then it'd pass. CI passing or not isn't really saying much as it isn't verifying the state of the PR currently (If CI passes are required to merge then I could revert .travis.yml etc of course).

To be honest I'm not sure what having parallel deploys would acheieve, or what that would look like. I could add the current build process back (pep2html etc) - that might enable merging with the Sphinx process 'dark' until switchover?

Also just for clarity - this currently builds to GitHub Pages not readthedocs, for flexibility. RE #1577, pygments is currently supported in this PR!

Sorry for the request for clarity but I don't want to do a lot more work for the PR to continue to stall - I'm also really keen to move forwards on this. However if doing something would help reduce burden on reviewers then I'm really keen to understand that and get it done!

Thanks,
Adam

@hugovk
Copy link
Contributor

@hugovk hugovk commented Sep 6, 2020

Parallel deploys may allow a quicker merge: the new deploy on GitHub Pages wouldn't yet be a live version, and further tweaks (in later, smaller PRs) can be made before committing to turning off the old deploy.

But as I say, I don't have merge rights here, and completely understand you don't want to do a lot more work for nothing, so we're probably best off waiting for guidance from a maintainer.

@AA-Turner
Copy link
Author

@AA-Turner AA-Turner commented Sep 6, 2020

That makes sense - I think that would be a useful thing to do, but will wait for guidance before going ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants