Skip to content

The PEP Rendering System is dead; long live the PEP Rendering System #2399

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

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
Makefile @AA-Turner
requirements.txt @AA-Turner

pep0/ @AA-Turner
docutils.conf @AA-Turner
genpepindex.py @AA-Turner
pep2html.py @AA-Turner
pep2rss.py @AA-Turner

pep_sphinx_extensions/ @AA-Turner
AUTHOR_OVERRIDES.csv @AA-Turner
build.py @AA-Turner
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/build.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Sphinx Build
name: Render PEPs

on: [push, pull_request, workflow_dispatch]

jobs:
deploy-to-pages:
name: Build & deploy to GitHub Pages
render-peps:
name: Render PEPs
runs-on: ubuntu-latest

steps:
Expand All @@ -24,7 +24,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt

- name: 🔧 Build PEPs
- name: 🔧 Render PEPs
run: make pages -j$(nproc)

# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Contributing Guidelines
=======================

To learn more about the purpose of PEPs and how to go about writing one, please
start reading at `PEP 1 <https://www.python.org/dev/peps/pep-0001/>`_.
start reading at `PEP 1 <https://peps.python.org/pep-0001/>`_.
Also, make sure to check the `README <./README.rst>`_ for information
on how to render the PEPs in this repository.
Thanks again for your contributions, and we look forward to reviewing them!
Expand All @@ -12,7 +12,7 @@ Before writing a new PEP
------------------------

Prior to submitting a pull request here with your draft PEP, see `PEP 1
<https://www.python.org/dev/peps/pep-0001/#start-with-an-idea-for-python>`_
<https://peps.python.org/pep-0001/#start-with-an-idea-for-python>`_
for some important steps to consider, including proposing and discussing it
first in an appropriate venue, drafting a PEP and gathering feedback, and
developing at least a prototype reference implementation of your idea.
Expand Down
69 changes: 12 additions & 57 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,81 +1,36 @@
# Builds PEP files to HTML using docutils or sphinx
# Also contains testing targets

PEP2HTML=pep2html.py
# Builds PEP files to HTML using sphinx

PYTHON=python3

VENV_DIR=venv
JOBS=8
RENDER_COMMAND=$(PYTHON) build.py -j $(JOBS)

.SUFFIXES: .txt .html .rst

.txt.html:
@$(PYTHON) $(PEP2HTML) $<
render:
$(RENDER_COMMAND)

.rst.html:
@$(PYTHON) $(PEP2HTML) $<
pages: rss
$(RENDER_COMMAND) --build-dirs

TARGETS= $(patsubst %.rst,%.html,$(wildcard pep-????.rst)) $(patsubst %.txt,%.html,$(wildcard pep-????.txt)) pep-0000.html

all: pep-0000.rst $(TARGETS)

$(TARGETS): pep2html.py
fail-warning:
$(RENDER_COMMAND) --fail-on-warning

pep-0000.rst: $(wildcard pep-????.txt) $(wildcard pep-????.rst) $(wildcard pep0/*.py) genpepindex.py
$(PYTHON) genpepindex.py .
check-links:
$(RENDER_COMMAND) --check-links

rss:
$(PYTHON) pep2rss.py .

install:
echo "Installing is not necessary anymore. It will be done in post-commit."
$(PYTHON) generate_rss.py

clean:
-rm pep-0000.rst
-rm *.html
-rm -rf build

update:
git pull https://github.com/python/peps.git

venv:
$(PYTHON) -m venv $(VENV_DIR)
./$(VENV_DIR)/bin/python -m pip install -r requirements.txt

package: all rss
mkdir -p build/peps
cp pep-*.txt build/peps/
cp pep-*.rst build/peps/
cp *.html build/peps/
cp *.png build/peps/
cp *.rss build/peps/
tar -C build -czf build/peps.tar.gz peps

lint:
pre-commit --version > /dev/null || $(PYTHON) -m pip install pre-commit
pre-commit run --all-files

spellcheck:
pre-commit --version > /dev/null || $(PYTHON) -m pip install pre-commit
pre-commit run --all-files --hook-stage manual codespell

# New Sphinx targets:

SPHINX_JOBS=8
SPHINX_BUILD=$(PYTHON) build.py -j $(SPHINX_JOBS)

# TODO replace `rss:` with this when merged & tested
pep_rss:
$(PYTHON) generate_rss.py

pages: pep_rss
$(SPHINX_BUILD) --build-dirs

sphinx:
$(SPHINX_BUILD)

fail-warning:
$(SPHINX_BUILD) --fail-on-warning

check-links:
$(SPHINX_BUILD) --check-links
Loading