@@ -55,9 +55,9 @@ to create a full local instance of the `python.org`_ website and run a number
55
55
of disparate scripts, following `documentation `_ that lives outside of the
56
56
`python/peps `_ repository.
57
57
58
- The proposed implementation provides a single `Makefile `_ and a Python script
59
- to render all PEP files, with options to target a web server or local
60
- filesystem environment.
58
+ By contrast, the proposed implementation provides a single `Makefile `_ and a
59
+ Python script to render all PEP files, with options to target a web server or
60
+ the local filesystem environment.
61
61
62
62
Using a single repository to host all tooling will clarify where to raise
63
63
issues, reducing volunteer time spent in triage.
@@ -81,16 +81,17 @@ There are several requests for additional features in reading PEPs, such as:
81
81
82
82
These are "easy wins" from this proposal, and would serve to improve the
83
83
quality-of-life for consumers of PEPs (including reviewers and writers). For
84
- example, the reference implementation no longer requires a scheduled render
84
+ example, the new reference implementation no longer requires a scheduled render
85
85
process to run, instead initiating rendering on every commit to the
86
86
`python/peps `_ repository.
87
87
88
- Equally, there are a small number of broken items, for example list styles not
89
- being respected or support for updating images being challenging with the
90
- system [7 ]_. These would be solved by default in the proposal.
88
+ Equally, there are a number of broken items currently; for example, list styles
89
+ are not respected, and support for updating images is challenging with the
90
+ current system [7 ]_. These are solved by the reference implementation of
91
+ this proposal.
91
92
92
- Commercial providers such as `Read the Docs `_ can additionally enhance this
93
- experience, for example by providing rendered previews of changes in pull
93
+ Third-party providers such as `Read the Docs `_ can additionally enhance this
94
+ experience; for example, by providing rendered previews of changes in pull
94
95
requests.
95
96
96
97
@@ -100,17 +101,19 @@ Specification
100
101
The proposed specification for rendering the PEP files to HTML is as per the
101
102
`reference implementation `_.
102
103
103
- That the HTML files should be made available under ``peps.python.org ``. The
104
- rendered files may be hosted just as static files, and behind a content
105
- delivery network (CDN).
104
+ The HTML files SHOULD be made available under the ``peps.python.org `` domain.
105
+ The rendered output SHOULD be hosted as static files, and MAY be behind a
106
+ content delivery network (CDN).
106
107
107
- The following redirect rules must be created from the `python.org `_ domain:
108
+ The following redirect rules MUST be created from the `python.org `_ domain:
108
109
109
110
* ``/peps/ `` -> https://peps.python.org/
110
111
* ``/dev/peps/ `` -> https://peps.python.org/
111
112
* ``/peps/(.*)\.html `` -> https://peps.python.org/$1
112
113
* ``/dev/peps/(.*) `` -> https://peps.python.org/$1
113
114
115
+ The following Nginx configuration would achieve this:
116
+
114
117
.. code-block :: nginx
115
118
116
119
location ~ ^/dev/peps/?(.*)$ {
@@ -125,53 +128,60 @@ The following redirect rules must be created from the `python.org`_ domain:
125
128
return 308 https://peps.python.org/;
126
129
}
127
130
128
- Redirects must be implemented to preserve `URL fragments `_ for backward
131
+ Redirects MUST be implemented to preserve `URL fragments `_ for backward
129
132
compatibility purposes.
130
133
131
134
132
135
Backwards Compatibility
133
136
=======================
134
137
135
- Due to server-side redirects to new canonical URLs, there are no backwards
136
- compatibility concerns. Links in previously published materials referring to
137
- any old URL scheme will be guaranteed to work.
138
+ Due to server-side redirects to new canonical URLs, links in previously
139
+ published materials referring to the old URL scheme will be guaranteed to work.
140
+ Furthermore, aside from the resolved bugs and new implemented features, all
141
+ existing PEPs will still render as they did before with the new backend.
142
+ Therefore, this poses no major backwards compatibility concerns.
138
143
139
144
140
145
Security Implications
141
146
=====================
142
147
143
- No security implications, and the main `python.org `_ website will no longer
144
- take raw HTML uploads, closing a potential threat vector.
148
+ The main `python.org `_ website will no longer need to process raw HTML
149
+ uploads, closing a potential threat vector, and the PEP building and
150
+ deployment process will use modern, well maintained code and secure
151
+ automated platforms, reducing likely potential attack surface. Therefore,
152
+ there is no forseen negative security impact.
145
153
146
154
147
155
How to Teach This
148
156
=================
149
157
150
158
The new canonical URLs will be publicised in the documentation. However, this
151
159
is mainly a backend infrastructure change, and there should be minimal
152
- end-user impact.
160
+ end-user impact. PEP 1 and PEP 12 will be updated as needed to include and
161
+ document any relevant new roles, directive, syntax and other constructs enabled
162
+ by this change.
153
163
154
164
155
165
Reference Implementation
156
166
========================
157
167
158
168
The proposed implementation has been merged into the `python/peps `_ repository
159
- in a series of pull requests [8 ]_. This automatically renders all PEPs on every
160
- commit.
169
+ in a series of pull requests [8 ]_. It currently automatically renders all
170
+ PEPs on every commit.
161
171
162
172
163
173
Rejected Ideas
164
174
==============
165
175
166
- It would likely be possible to amend the current (as of November 2021)
167
- rendering process to include a lot of the quality-of-life improvements and
168
- issue mitigations mentioned above. However, we do not believe that this would
176
+ It would likely be possible to amend the current docutils-based manual
177
+ rendering process to include many of the quality-of-life improvements and
178
+ bug mitigations mentioned above. However, we do not believe that this would
169
179
solve the distributed tooling issue.
170
180
171
181
It would be possible to use the output from the proposed rendering system and
172
- import it into `python.org `_. We would argue however that this would be the
173
- worst of both worlds, as a great deal of complexity is added, and none is
174
- removed.
182
+ import it into the existing `python.org `_ domain . We would argue, however,
183
+ that this would be the worst of both worlds, as a great deal of complexity
184
+ is added, while none is removed.
175
185
176
186
177
187
Open Issues
@@ -183,8 +193,8 @@ None.
183
193
Acknowledgments
184
194
===============
185
195
186
- Thanks to Hugo van Kemenade, Pablo Galindo Salgado, and Éric Araujo for support
187
- since April 2020.
196
+ Thanks to Hugo van Kemenade, Pablo Galindo Salgado and Éric Araujo for
197
+ supporting this effort since April 2020.
188
198
189
199
190
200
Footnotes
0 commit comments