Skip to content

Commit cd04e30

Browse files
PEP 676: Update prose
Co-authored-by: C.A.M. Gerlach <[email protected]>
1 parent 9ffe4d3 commit cd04e30

File tree

1 file changed

+52
-41
lines changed

1 file changed

+52
-41
lines changed

pep-0676.rst

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ would:
4141
* save volunteer maintainers' time
4242

4343
We propose that PEPs are accessed through `peps.python.org`_ at the top-level
44-
namespace (for example `peps.python.org/pep-0008`_), and that all custom
45-
tooling to support rendering PEPs is hosted in the `python/peps`_ repository.
44+
(for example `peps.python.org/pep-0008`_), and that all custom tooling to
45+
support rendering PEPs is hosted in the `python/peps`_ repository.
4646

4747

4848
Rationale
@@ -56,9 +56,9 @@ to create a full local instance of the `python.org`_ website and run a number
5656
of disparate scripts, following `documentation`_ that lives outside of the
5757
`python/peps`_ repository.
5858

59-
The proposed implementation provides a single `Makefile`_ and a Python script
60-
to render all PEP files, with options to target a web server or local
61-
filesystem environment.
59+
By contrast, the proposed implementation provides a single `Makefile`_ and a
60+
Python script to render all PEP files, with options to target a web-server or
61+
the local filesystem.
6262

6363
Using a single repository to host all tooling will clarify where to raise
6464
issues, reducing volunteer time spent in triage.
@@ -81,18 +81,20 @@ There are several requests for additional features in reading PEPs, such as:
8181
* intersphinx functionality [6]_
8282

8383
These are "easy wins" from this proposal, and would serve to improve the
84-
quality-of-life for consumers of PEPs (including reviewers and writers). For
85-
example, the reference implementation no longer requires a scheduled render
86-
process to run, instead initiating rendering on every commit to the
87-
`python/peps`_ repository.
84+
quality-of-life for consumers of PEPs (including reviewers and writers).
85+
86+
For example, the current (as of November 2021) system runs periodically on a
87+
schedule. This means that updates to PEPs cannot be circulated immediately,
88+
reducing productivity. The reference implementation renders and publishes all
89+
PEPs on every commit to the repository, solving the issue by design.
8890

89-
Equally, there are a small number of broken items, for example list styles not
90-
being respected or support for updating images being challenging with the
91-
system [7]_. These would be solved by default in the proposal.
91+
The reference implementation fixes several issues [7]_. For example:
9292

93-
Commercial providers such as `Read the Docs`_ can additionally enhance this
94-
experience, for example by providing rendered previews of changes in pull
95-
requests.
93+
* list styles are currently not respected by `python.org`_'s stylesheets
94+
* support for updating images in PEPs is challenging in `python.org`_
95+
96+
Third-party providers such as `Read the Docs`_ or `Netlify`_ can enhance this
97+
experience with features such as automatic rendering of pull requests.
9698

9799

98100
Specification
@@ -101,17 +103,18 @@ Specification
101103
The proposed specification for rendering the PEP files to HTML is as per the
102104
`reference implementation`_.
103105

104-
That the HTML files should be made available under `peps.python.org`_. The
105-
rendered files may be hosted just as static files, and behind a content
106-
delivery network (CDN).
106+
The rendered PEPs MUST be available at `peps.python.org`_. These SHOULD be
107+
hosted as static files, and MAY be behind a content delivery network (CDN).
107108

108-
The following redirect rules must be created from the `python.org`_ domain:
109+
The following redirect rules MUST be created for the `python.org`_ domain:
109110

110111
* ``/peps/`` -> https://peps.python.org/
111112
* ``/dev/peps/`` -> https://peps.python.org/
112113
* ``/peps/(.*)\.html`` -> https://peps.python.org/$1
113114
* ``/dev/peps/(.*)`` -> https://peps.python.org/$1
114115

116+
The following nginx configuration would achieve this:
117+
115118
.. code-block:: nginx
116119
117120
location ~ ^/dev/peps/?(.*)$ {
@@ -126,66 +129,71 @@ The following redirect rules must be created from the `python.org`_ domain:
126129
return 308 https://peps.python.org/;
127130
}
128131
129-
Redirects must be implemented to preserve `URL fragments`_ for backward
132+
Redirects MUST be implemented to preserve `URL fragments`_ for backward
130133
compatibility purposes.
131134

132135

133136
Backwards Compatibility
134137
=======================
135138

136-
Due to server-side redirects to new canonical URLs, there are no backwards
137-
compatibility concerns. Links in previously published materials referring to
138-
any old URL scheme will be guaranteed to work.
139+
Due to server-side redirects to the new canonical URLs, links in previously
140+
published materials referring to the old URL schemes will be guaranteed to work.
141+
All PEPs will continue to render correctly, and a custom stylesheet in the
142+
reference implementation improves presentation for some elements (most notably
143+
code blocks and block quotes). Therefore, this PEP presents no backwards
144+
compatibility issues.
139145

140146

141147
Security Implications
142148
=====================
143149

144-
No security implications, and the main `python.org`_ website will no longer
145-
take raw HTML uploads, closing a potential threat vector.
150+
The main `python.org`_ website will no longer process raw HTML uploads,
151+
closing a potential threat vector. PEP rendering and deployment processes will
152+
use modern, well-maintained code and secure automated platforms, further
153+
reducing the potential attack surface. Therefore, we see no negative security
154+
impact.
146155

147156

148157
How to Teach This
149158
=================
150159

151160
The new canonical URLs will be publicised in the documentation. However, this
152161
is mainly a backend infrastructure change, and there should be minimal
153-
end-user impact.
162+
end-user impact. PEP 1 and PEP 12 will be updated as needed.
154163

155164

156165
Reference Implementation
157166
========================
158167

159168
The proposed implementation has been merged into the `python/peps`_ repository
160-
in a series of pull requests [8]_. This automatically renders all PEPs on every
161-
commit.
169+
in a series of pull requests [8]_. It uses the `Sphinx`_ documentation system
170+
with a custom theme and extensions.
171+
172+
This already automatically renders all PEPs on every commit, and publishes them
173+
to `python.github.io/peps`_.
162174

163175

164176
Rejected Ideas
165177
==============
166178

167179
It would likely be possible to amend the current (as of November 2021)
168-
rendering process to include a lot of the quality-of-life improvements and
180+
rendering process to include a subset of the quality-of-life improvements and
169181
issue mitigations mentioned above. However, we do not believe that this would
170182
solve the distributed tooling issue.
171183

172184
It would be possible to use the output from the proposed rendering system and
173-
import it into `python.org`_. We would argue however that this would be the
174-
worst of both worlds, as a great deal of complexity is added, and none is
175-
removed.
176-
177-
178-
Open Issues
179-
===========
180-
181-
None.
185+
import it into `python.org`_. We would argue that this would be the worst of
186+
both worlds, as a great deal of complexity is added whilst none is removed.
182187

183188

184189
Acknowledgements
185190
================
186191

187-
Thanks to Hugo van Kemenade, Pablo Galindo Salgado, and Éric Araujo for support
188-
since April 2020.
192+
- Hugo van Kemenade
193+
- Pablo Galindo Salgado
194+
- Éric Araujo
195+
- Mariatta
196+
- C.A.M. Gerlach
189197

190198

191199
Footnotes
@@ -194,12 +202,15 @@ Footnotes
194202
.. _documentation: https://pythondotorg.readthedocs.io/pep_generation.html
195203
.. _docutils: https://docutils.sourceforge.io
196204
.. _Makefile: https://www.gnu.org/software/make/manual/make.html#Introduction
205+
.. _Netlify: https://www.netlify.com/
197206
.. _peps.python.org: https://peps.python.org/
198-
.. _peps.python.org/pep-0008/: https://peps.python.org/pep-0008/
207+
.. _peps.python.org/pep-0008: https://peps.python.org/pep-0008/
208+
.. _python.github.io/peps: https://python.github.io/peps
199209
.. _python.org: https://www.python.org
200210
.. _python/peps: https://github.com/python/peps
201211
.. _Read the Docs: https://readthedocs.org
202212
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
213+
.. _Sphinx: https://www.sphinx-doc.org/en/master/
203214
.. _URL fragments: https://url.spec.whatwg.org/#concept-url-fragment
204215

205216
.. [1] For example,

0 commit comments

Comments
 (0)