Skip to content

reSTify PEP 0 #463

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

Closed
wants to merge 1 commit into from
Closed

reSTify PEP 0 #463

wants to merge 1 commit into from

Conversation

mozillazg
Copy link
Contributor

@mozillazg mozillazg commented Nov 11, 2017

  • reSTify PEP 0
  • test via make -j
  • PR to pythondotorg
  • test via pythondotorg(./manage.py generate_pep_pages)
  • wait for pythondotorg update

@Mariatta
Copy link
Member

Thanks for the PR!
I tried checking out your PR locally and build the PEP, but getting an error while rendering PEP 0 in pythondotorg.

My steps are:

  • checked out your PR
  • delete my copy of pep-0000.txt
  • make -j
  • in my local pythondotorg directory: ./manage.py generate_pep_pages.

Problem is at https://github.com/python/pythondotorg/blob/master/peps/converters.py#L40:

body_children = list(soup.body.children)

The new PEP 0 does not have the <body> tag in the HTML output, so the above line errored out.

We'll need to coordinate and update pythondotorg before merging this PR.

@mozillazg mozillazg changed the title reSTify PEP 0 [WIP] reSTify PEP 0 Nov 11, 2017
@mozillazg
Copy link
Contributor Author

@Mariatta Thanks for your review. I'll submit a PR to pythondotorg for fixing this.

@mozillazg
Copy link
Contributor Author

mozillazg commented Nov 12, 2017

@Mariatta The PR to pythondotorg is here: python/pythondotorg#1192

mozillazg added a commit to mozillazg/pythondotorg that referenced this pull request Jun 7, 2018
mozillazg added a commit to mozillazg/pythondotorg that referenced this pull request Jun 7, 2018
berkerpeksag pushed a commit to python/pythondotorg that referenced this pull request Jun 7, 2018
berkerpeksag pushed a commit to python/pythondotorg that referenced this pull request Jun 7, 2018
The new PEP 0 pull request can be found at python/peps#463.

Conflicts:

	peps/converters.py
@berkerpeksag
Copy link
Member

FYI, I've just merged and deployed python/pythondotorg#1192.

@berkerpeksag
Copy link
Member

Is it possible to add a "Type" column to the table in "Index by Category" section?

screenshot from 2018-06-07 20 58 56

@mozillazg
Copy link
Contributor Author

@berkerpeksag Done.

image

@mozillazg mozillazg changed the title [WIP] reSTify PEP 0 reSTify PEP 0 Jun 8, 2018
@mozillazg
Copy link
Contributor Author

@Mariatta This PR is ready for review.

@gvanrossum
Copy link
Member

@Mariatta Is anything holding this up?

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

Some suggestions based on what I learned writing #705 (I forgot this PR already existed, sorry), as well as a proposed adjustment for a misleading name on some variables.

Feel free to mine #705 for ideas as well - while I prefer this PR in general, one item I still like from #705 is adding explicitly named anchors for each of the section titles (along with some helper functions to make them easier to emit).

.gitignore Outdated
@@ -1,4 +1,4 @@
pep-0000.txt
pep-0000.rst
Copy link
Contributor

Choose a reason for hiding this comment

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

Old checkouts may still have the text file around, so best to keep both files here for now.

Makefile Outdated
@@ -31,7 +31,7 @@ install:
echo "Installing is not necessary anymore. It will be done in post-commit."

clean:
-rm pep-0000.txt
-rm pep-0000.rst
Copy link
Contributor

Choose a reason for hiding this comment

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

Old checkouts may still have the text file around, so best to remove both files here for now.

Copy link
Member

@pradyunsg pradyunsg Jul 8, 2018

Choose a reason for hiding this comment

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

rm non-existent-file would result in an exit code of 1, which would make make abort the build. Adding a - before the command would make make ignore these errors:

clean:
        -rm pep-0000.txt
        -rm pep-0000.rst

(see also https://www.gnu.org/software/make/manual/html_node/Errors.html)

genpepindex.py Outdated
@@ -36,7 +36,7 @@ def main(argv):
peps = []
if os.path.isdir(path):
for file_path in os.listdir(path):
if file_path == 'pep-0000.txt':
if file_path == 'pep-0000.rst':
Copy link
Contributor

Choose a reason for hiding this comment

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

Best to switch this to file_path.startswith('pep-0000.') so old text files also get ignored.

pep0/output.py Outdated
print(markup_line, file=output)


def write_table(columns, output, include_header=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

The parameter here is a sequence of rows, rather than a sequence of columns

pep0/output.py Outdated
return

lengths = [[] for x in columns[0]]
for column in columns:
Copy link
Contributor

Choose a reason for hiding this comment

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

for row in rows: (I won't make any further comments that relate to the name change)

@berkerpeksag
Copy link
Member

FWIW, I find Nick's PR a bit simpler than this one. The downside is that it requires Python 3.6 and I don't think we have Python 3.6 installed on python.org servers (but it might not that hard to create a separate venv for the peps repository)

@mozillazg
Copy link
Contributor Author

mozillazg commented Jul 8, 2018

@berkerpeksag I also think Nick's PR is better. IHMO we should accept #705 instead of this PR 😄 .

@mozillazg mozillazg closed this Jul 8, 2018
Nathanator pushed a commit to Nathanator/pythondotorg that referenced this pull request Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants