Skip to content

Commit ad43be9

Browse files
authored
Merge branch 'main' into distributing-guide
2 parents 00b7bfc + c747fa4 commit ad43be9

13 files changed

+70
-132
lines changed

source/guides/dropping-older-python-versions.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ Steps:
7878

7979
You can specify version ranges and exclusion rules, such as at least Python 3. Or, Python 2.7, 3.4 and beyond.
8080

81-
Examples::
81+
Examples:
82+
83+
.. code-block:: text
8284
8385
Requires-Python: ">=3"
8486
Requires-Python: ">2.7,!=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"

source/guides/installing-using-linux-tools.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ To install pip, wheel, and setuptools, in a parallel, non-system environment
107107
openSUSE
108108
~~~~~~~~
109109

110-
.. code-block:: bash
110+
.. code-block:: bash
111111
112-
sudo zypper install python3-pip python3-setuptools python3-wheel
112+
sudo zypper install python3-pip python3-setuptools python3-wheel
113113
114114
115115
.. _debian-ubuntu:
@@ -134,9 +134,9 @@ Firstly, update and refresh repository lists by running this command:
134134
Arch Linux
135135
~~~~~~~~~~
136136

137-
.. code-block:: bash
137+
.. code-block:: bash
138138
139-
sudo pacman -S python-pip
139+
sudo pacman -S python-pip
140140
141141
----
142142

source/guides/making-a-pypi-friendly-readme.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ such as ``text/plain``, ``text/x-rst`` (for reStructuredText), or ``text/markdow
5959
6060
The minimum required versions of the respective tools are:
6161

62-
- ``setuptools >= 38.6.0``
63-
- ``wheel >= 0.31.0``
64-
- ``twine >= 1.11.0``
62+
- ``setuptools >= 38.6.0``
63+
- ``wheel >= 0.31.0``
64+
- ``twine >= 1.11.0``
6565

6666
It's recommended that you use ``twine`` to upload the project's distribution packages:
6767

source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ for your new :term:`PyPI project <Project>`.
3737
However it is also possible to add `trusted publishing`_ to any
3838
pre-existing project, if you are its owner.
3939

40-
.. attention::
40+
.. attention::
4141

42-
If you followed earlier versions of this guide, you
43-
have created the secrets ``PYPI_API_TOKEN`` and ``TEST_PYPI_API_TOKEN``
44-
for direct PyPI and TestPyPI access. These are obsolete now and
45-
you should remove them from your GitHub repository and revoke
46-
them in your PyPI and TestPyPI account settings in case you are replacing your old setup with the new one.
42+
If you followed earlier versions of this guide, you
43+
have created the secrets ``PYPI_API_TOKEN`` and ``TEST_PYPI_API_TOKEN``
44+
for direct PyPI and TestPyPI access. These are obsolete now and
45+
you should remove them from your GitHub repository and revoke
46+
them in your PyPI and TestPyPI account settings in case you are replacing your old setup with the new one.
4747

4848

4949
Let's begin! 🚀

source/guides/using-testpypi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Setting up TestPyPI in :file:`.pypirc`
7575
If you want to avoid entering your username, you can configure TestPyPI in
7676
your :file:`$HOME/.pypirc`:
7777

78-
.. code::
78+
.. code:: ini
7979
8080
[testpypi]
8181
username = <your TestPyPI username>

source/specifications/binary-distribution-format.rst

Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1+
.. highlight:: text
12

23
.. _binary-distribution-format:
34

45
==========================
56
Binary distribution format
67
==========================
78

8-
The binary distribution format (:term:`wheel <Wheel>`) was originally defined
9-
in :pep:`427`. The current version of the specification is here.
10-
11-
12-
Abstract
13-
========
14-
15-
This PEP describes a built-package format for Python called "wheel".
9+
This page specifies the binary distribution format for Python packages,
10+
also called the wheel format.
1611

1712
A wheel is a ZIP-format archive with a specially formatted file name and
1813
the ``.whl`` extension. It contains a single distribution nearly as it
@@ -23,31 +18,6 @@ may be installed by simply unpacking into site-packages with the standard
2318
out onto their final paths at any later time.
2419

2520

26-
PEP Acceptance
27-
==============
28-
29-
This PEP was accepted, and the defined wheel version updated to 1.0, by
30-
Nick Coghlan on 16th February, 2013 [1]_
31-
32-
33-
Rationale
34-
=========
35-
36-
Python needs a package format that is easier to install than sdist.
37-
Python's sdist packages are defined by and require the distutils and
38-
setuptools build systems, running arbitrary code to build-and-install,
39-
and re-compile, code just so it can be installed into a new
40-
virtualenv. This system of conflating build-install is slow, hard to
41-
maintain, and hinders innovation in both build systems and installers.
42-
43-
Wheel attempts to remedy these problems by providing a simpler
44-
interface between the build system and the installer. The wheel
45-
binary package format frees installers from having to know about the
46-
build system, saves time by amortizing compile time over many
47-
installations, and removes the need to install a build system in the
48-
target environment.
49-
50-
5121
Details
5222
=======
5323

@@ -316,7 +286,9 @@ or the installation will fail.
316286
If JSON web signatures are used, one or more JSON Web Signature JSON
317287
Serialization (JWS-JS) signatures is stored in a file RECORD.jws adjacent
318288
to RECORD. JWS is used to sign RECORD by including the SHA-256 hash of
319-
RECORD as the signature's JSON payload::
289+
RECORD as the signature's JSON payload:
290+
291+
.. code-block:: json
320292
321293
{ "hash": "sha256=ADD-r2urObZHcxBW3Cr-vDCu5RJwT4CaRTHiFmbcIYY" }
322294
@@ -338,33 +310,6 @@ See
338310
- https://datatracker.ietf.org/doc/html/draft-jones-jose-json-private-key-01
339311

340312

341-
Comparison to .egg
342-
------------------
343-
344-
#. Wheel is an installation format; egg is importable. Wheel archives
345-
do not need to include .pyc and are less tied to a specific Python
346-
version or implementation. Wheel can install (pure Python) packages
347-
built with previous versions of Python so you don't always have to
348-
wait for the packager to catch up.
349-
#. Wheel uses .dist-info directories; egg uses .egg-info. Wheel is
350-
compatible with the new world of Python packaging and the new
351-
concepts it brings.
352-
#. Wheel has a richer file naming convention for today's
353-
multi-implementation world. A single wheel archive can indicate
354-
its compatibility with a number of Python language versions and
355-
implementations, ABIs, and system architectures. Historically the
356-
ABI has been specific to a CPython release, wheel is ready for the
357-
stable ABI.
358-
#. Wheel is lossless. The first wheel implementation bdist_wheel
359-
always generates egg-info, and then converts it to a .whl. It is
360-
also possible to convert existing eggs and bdist_wininst
361-
distributions.
362-
#. Wheel is versioned. Every wheel file contains the version of the
363-
wheel specification and the implementation that packaged it.
364-
Hopefully the next migration can simply be to Wheel 2.0.
365-
#. Wheel is a reference to the other Python.
366-
367-
368313
FAQ
369314
===
370315

@@ -469,20 +414,16 @@ Is it possible to import Python code directly from a wheel file?
469414
aware that many projects will require a failure to be reproduced with
470415
a fully installed package before accepting it as a genuine bug.
471416

472-
Changes
473-
=======
474417

475-
Since :pep:`427`, this specification has changed as follows:
476-
477-
- The rules on escaping in wheel filenames were revised, to bring them into line
478-
with what popular tools actually do (February 2021).
418+
History
419+
=======
479420

421+
This specification was originally approved as :pep:`427`.
480422

481-
References
482-
==========
423+
The following changes were applied since the initial version:
483424

484-
.. [1] PEP acceptance
485-
(https://mail.python.org/pipermail/python-dev/2013-February/124103.html)
425+
- The rules on escaping in wheel filenames were revised, to bring them
426+
into line with what popular tools actually do (February 2021).
486427

487428

488429
Appendix
@@ -499,9 +440,3 @@ Example urlsafe-base64-nopad implementation::
499440
def urlsafe_b64decode_nopad(data):
500441
pad = b'=' * (4 - (len(data) & 3))
501442
return base64.urlsafe_b64decode(data + pad)
502-
503-
504-
Copyright
505-
=========
506-
507-
This document has been placed into the public domain.

source/specifications/core-metadata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. highlight:: text
2+
13
.. _`core-metadata`:
24

35
============================

source/specifications/dependency-specifiers.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. highlight:: text
2+
13
.. _dependency-specifiers:
24

35
=====================
@@ -273,7 +275,9 @@ error like all other unknown variables.
273275
- ``test``
274276

275277
The ``implementation_version`` marker variable is derived from
276-
``sys.implementation.version``::
278+
``sys.implementation.version``:
279+
280+
.. code-block:: python
277281
278282
def format_full_version(info):
279283
version = '{0.major}.{0.minor}.{0.micro}'.format(info)
@@ -400,7 +404,9 @@ The complete parsley grammar::
400404
sub_delims = '!' | '$' | '&' | '\\'' | '(' | ')' | '*' | '+' | ',' | ';' | '='
401405
hexdig = digit | 'a' | 'A' | 'b' | 'B' | 'c' | 'C' | 'd' | 'D' | 'e' | 'E' | 'f' | 'F'
402406

403-
A test program - if the grammar is in a string ``grammar``::
407+
A test program - if the grammar is in a string ``grammar``:
408+
409+
.. code-block:: python
404410
405411
import os
406412
import sys

source/specifications/direct-url-data-structure.rst

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. highlight:: json
12

23
.. _direct-url-data-structure:
34

@@ -32,7 +33,9 @@ for security reasons.
3233

3334
The user:password section of the URL MAY however
3435
be composed of environment variables, matching the following regular
35-
expression::
36+
expression:
37+
38+
.. code-block:: text
3639
3740
\$\{[A-Za-z0-9-_]+\}(:\$\{[A-Za-z0-9-_]+\})?
3841
@@ -130,24 +133,19 @@ Git
130133
---
131134

132135
Home page
133-
134136
https://git-scm.com/
135137

136138
vcs command
137-
138139
git
139140

140141
``vcs`` field
141-
142142
git
143143

144144
``requested_revision`` field
145-
146145
A tag name, branch name, Git ref, commit hash, shortened commit hash,
147146
or other commit-ish.
148147

149148
``commit_id`` field
150-
151149
A commit hash (40 hexadecimal characters sha1).
152150

153151
.. note::
@@ -162,70 +160,55 @@ Mercurial
162160
---------
163161

164162
Home page
165-
166163
https://www.mercurial-scm.org/
167164

168165
vcs command
169-
170166
hg
171167

172168
``vcs`` field
173-
174169
hg
175170

176171
``requested_revision`` field
177-
178172
A tag name, branch name, changeset ID, shortened changeset ID.
179173

180174
``commit_id`` field
181-
182175
A changeset ID (40 hexadecimal characters).
183176

184177
Bazaar
185178
------
186179

187180
Home page
188-
189181
https://www.breezy-vcs.org/
190182

191183
vcs command
192-
193184
bzr
194185

195186
``vcs`` field
196-
197187
bzr
198188

199189
``requested_revision`` field
200-
201190
A tag name, branch name, revision id.
202191

203192
``commit_id`` field
204-
205193
A revision id.
206194

207195
Subversion
208196
----------
209197

210198
Home page
211-
212199
https://subversion.apache.org/
213200

214201
vcs command
215-
216202
svn
217203

218204
``vcs`` field
219-
220205
svn
221206

222207
``requested_revision`` field
223-
224208
``requested_revision`` must be compatible with ``svn checkout`` ``--revision`` option.
225209
In Subversion, branch or tag is part of ``url``.
226210

227211
``commit_id`` field
228-
229212
Since Subversion does not support globally unique identifiers,
230213
this field is the Subversion revision number in the corresponding
231214
repository.

source/specifications/entry-points.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ restrictions on values specified in :pep:`685`.
111111
For tools writing the file, it is recommended only to insert a space between the
112112
object reference and the left square bracket.
113113

114-
For example::
114+
For example:
115+
116+
.. code-block:: ini
115117
116118
[console_scripts]
117119
foo = foomod:main

0 commit comments

Comments
 (0)