Skip to content

Commit ab1ef1a

Browse files
authored
Merge branch 'main' into feat/project_urls
2 parents 961f6fb + 6df00c3 commit ab1ef1a

6 files changed

Lines changed: 53 additions & 47 deletions

source/guides/analyzing-pypi-package-downloads.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ the `BigQuery quickstart guide
6868
Data schema
6969
-----------
7070

71-
Linehaul writes an entry in a ``the-psf.pypi.file_downloads`` table for each
71+
Linehaul writes an entry in a ``bigquery-public-data.pypi.file_downloads`` table for each
7272
download. The table contains information about what file was downloaded and how
7373
it was downloaded. Some useful columns from the `table schema
74-
<https://console.cloud.google.com/bigquery?pli=1&p=the-psf&d=pypi&t=file_downloads&page=table>`__
74+
<https://console.cloud.google.com/bigquery?pli=1&p=bigquery-public-data&d=pypi&t=file_downloads&page=table>`__
7575
include:
7676

7777
+------------------------+-----------------+-----------------------------+
@@ -108,7 +108,7 @@ The following query counts the total number of downloads for the project
108108

109109
#standardSQL
110110
SELECT COUNT(*) AS num_downloads
111-
FROM `the-psf.pypi.file_downloads`
111+
FROM `bigquery-public-data.pypi.file_downloads`
112112
WHERE file.project = 'pytest'
113113
-- Only query the last 30 days of history
114114
AND DATE(timestamp)
@@ -118,7 +118,7 @@ The following query counts the total number of downloads for the project
118118
+---------------+
119119
| num_downloads |
120120
+===============+
121-
| 20531925 |
121+
| 26190085 |
122122
+---------------+
123123

124124
To only count downloads from pip, filter on the ``details.installer.name``
@@ -128,7 +128,7 @@ column.
128128

129129
#standardSQL
130130
SELECT COUNT(*) AS num_downloads
131-
FROM `the-psf.pypi.file_downloads`
131+
FROM `bigquery-public-data.pypi.file_downloads`
132132
WHERE file.project = 'pytest'
133133
AND details.installer.name = 'pip'
134134
-- Only query the last 30 days of history
@@ -139,7 +139,7 @@ column.
139139
+---------------+
140140
| num_downloads |
141141
+===============+
142-
| 19391645 |
142+
| 24334215 |
143143
+---------------+
144144

145145
Package downloads over time
@@ -154,7 +154,7 @@ filtering by this column reduces corresponding costs.
154154
SELECT
155155
COUNT(*) AS num_downloads,
156156
DATE_TRUNC(DATE(timestamp), MONTH) AS `month`
157-
FROM `the-psf.pypi.file_downloads`
157+
FROM `bigquery-public-data.pypi.file_downloads`
158158
WHERE
159159
file.project = 'pytest'
160160
-- Only query the last 6 months of history
@@ -192,7 +192,7 @@ query processes over 500 GB of data.
192192
SELECT
193193
REGEXP_EXTRACT(details.python, r"[0-9]+\.[0-9]+") AS python_version,
194194
COUNT(*) AS num_downloads,
195-
FROM `the-psf.pypi.file_downloads`
195+
FROM `bigquery-public-data.pypi.file_downloads`
196196
WHERE
197197
-- Only query the last 6 months of history
198198
DATE(timestamp)
@@ -204,17 +204,17 @@ query processes over 500 GB of data.
204204
+--------+---------------+
205205
| python | num_downloads |
206206
+========+===============+
207-
| 3.7 | 12990683561 |
207+
| 3.7 | 18051328726 |
208208
+--------+---------------+
209-
| 3.6 | 9035598511 |
209+
| 3.6 | 9635067203 |
210210
+--------+---------------+
211-
| 2.7 | 8467785320 |
211+
| 3.8 | 7781904681 |
212212
+--------+---------------+
213-
| 3.8 | 4581627740 |
213+
| 2.7 | 6381252241 |
214214
+--------+---------------+
215-
| 3.5 | 2412533601 |
215+
| null | 2026630299 |
216216
+--------+---------------+
217-
| null | 1641456718 |
217+
| 3.5 | 1894153540 |
218218
+--------+---------------+
219219

220220
Caveats
@@ -251,7 +251,7 @@ the official Python client library for BigQuery.
251251
252252
query_job = client.query("""
253253
SELECT COUNT(*) AS num_downloads
254-
FROM `the-psf.pypi.file_downloads`
254+
FROM `bigquery-public-data.pypi.file_downloads`
255255
WHERE file.project = 'pytest'
256256
-- Only query the last 30 days of history
257257
AND DATE(timestamp)
@@ -303,7 +303,7 @@ References
303303
.. [#] `PyPI Download Counts deprecation email <https://mail.python.org/pipermail/distutils-sig/2013-May/020855.html>`__
304304
.. [#] `PyPI BigQuery dataset announcement email <https://mail.python.org/pipermail/distutils-sig/2016-May/028986.html>`__
305305
306-
.. _public PyPI download statistics dataset: https://console.cloud.google.com/bigquery?p=the-psf&d=pypi&page=dataset
306+
.. _public PyPI download statistics dataset: https://console.cloud.google.com/bigquery?p=bigquery-public-data&d=pypi&page=dataset
307307
.. _bandersnatch: /key_projects/#bandersnatch
308308
.. _Google BigQuery: https://cloud.google.com/bigquery
309309
.. _BigQuery web UI: https://console.cloud.google.com/bigquery

source/guides/distributing-packages-using-setuptools.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ The section does *not* aim to cover best practices for Python project
1212
development as a whole. For example, it does not provide guidance or tool
1313
recommendations for version control, documentation, or testing.
1414

15-
For more reference material, see `Building and Distributing Packages
16-
<https://setuptools.readthedocs.io/en/latest/setuptools.html>`_ in the
17-
:ref:`setuptools` docs, but note that some advisory content there may be
18-
outdated. In the event of conflicts, prefer the advice in the Python
19-
Packaging User Guide.
15+
For more reference material, see :std:doc:`Building and Distributing
16+
Packages <userguide/index>` in the :ref:`setuptools` docs, but note
17+
that some advisory content there may be outdated. In the event of
18+
conflicts, prefer the advice in the Python Packaging User Guide.
2019

2120
.. contents:: Contents
2221
:local:
@@ -445,9 +444,9 @@ The value must be a mapping from package name to a list of relative path names
445444
that should be copied into the package. The paths are interpreted as relative to
446445
the directory containing the package.
447446

448-
For more information, see `Including Data Files
449-
<https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files>`_
450-
from the `setuptools docs <https://setuptools.readthedocs.io>`_.
447+
For more information, see :std:doc:`Including Data Files
448+
<setuptools:userguide/datafiles>` from the
449+
:std:doc:`setuptools docs <setuptools:index>`.
451450

452451

453452
.. _`Data Files`:
@@ -652,7 +651,7 @@ maintained by a redistributor.
652651
A local version identifier takes the form ``<public version identifier>+<local version label>``.
653652
For example::
654653

655-
1.2.0.dev1+hg.5.b11e5e6f0b0b # 5th VCS commmit since 1.2.0.dev1 release
654+
1.2.0.dev1+hg.5.b11e5e6f0b0b # 5th VCS commit since 1.2.0.dev1 release
656655
1.2.1+fedora.4 # Package with downstream Fedora patches applied
657656

658657

source/guides/hosting-your-own-index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ all repositories using a valid HTTPS setup.
2626

2727
The directory layout is fairly simple, within a root directory you need to
2828
create a directory for each project. This directory should be the normalized
29-
name (as defined by PEP 503) of the project. Within each of these directories
29+
name (as defined by :pep:`503`) of the project. Within each of these directories
3030
simply place each of the downloadable files. If you have the projects "Foo"
3131
(with the versions 1.0 and 2.0) and "bar" (with the version 0.1) You should
3232
end up with a structure that looks like::
@@ -46,7 +46,7 @@ instruct users to add the URL to their installer's configuration.
4646
----
4747

4848
.. [1] For complete documentation of the simple repository protocol, see
49-
PEP 503.
49+
:pep:`503`.
5050
5151
5252
.. _devpi: http://doc.devpi.net/latest/

source/key_projects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ build
4343
User IRC:`#pypa <https://webchat.freenode.net/?channels=%23pypa>`__ |
4444
Dev IRC:`#pypa-dev <https://webchat.freenode.net/?channels=%23pypa-dev>`__
4545

46-
``build`` is a PEP-517 compatible Python package builder. It provides a CLI to
46+
``build`` is a :pep:`517` compatible Python package builder. It provides a CLI to
4747
build packages, as well as a Python API.
4848

4949

source/specifications/platform-compatibility-tags.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ The scheme defined in :pep:`425` is insufficient for public distribution of
3333
wheel files (and \*nix wheel files in general) to Linux platforms, due to the
3434
large ecosystem of Linux platforms and subtle differences between them.
3535

36-
Instead, :pep:`513` defines the ``manylinux`` standard, which represents a
36+
Instead, :pep:`600` defines the ``manylinux`` standard, which represents a
3737
common subset of Linux platforms, and allows building wheels tagged with the
3838
``manylinux`` platform tag which can be used across most common Linux
3939
distributions.
4040

41-
There are multiple iterations of the ``manylinux`` specification, each
41+
There were multiple iterations of the ``manylinux`` specification, each
4242
representing the common subset of Linux platforms at a given point in time:
4343

4444
* ``manylinux1`` (:pep:`513`) supports ``x86_64`` and ``i686``
@@ -51,6 +51,11 @@ representing the common subset of Linux platforms at a given point in time:
5151
and ``s390x``) and updates the base platform to a compatible Linux platform
5252
from 2014.
5353

54+
``manylinux_x_y`` (:pep:`600`) supersedes all previous PEPs to define a
55+
future-proof standard. It defines ``x`` and ``y`` as glibc major an minor
56+
versions supported (e.g. ``manylinux_2_24`` should work on any distro using
57+
glibc 2.24+). Previous tags are still supported for backward compatibility.
58+
5459
In general, distributions built for older versions of the specification are
5560
forwards-compatible (meaning that ``manylinux1`` distributions should continue
5661
to work on modern systems) but not backwards-compatible (meaning that
@@ -59,26 +64,27 @@ existed before 2010).
5964

6065
Package maintainers should attempt to target the most compatible specification
6166
possible, with the caveat that the provided build environment for
62-
``manylinux1`` has reached end-of-life, and the build environment for
63-
``manylinux2010`` will reach end-of-life in November 2020 [#]_, meaning that
67+
``manylinux1`` and ``manylinux2010`` have reached end-of-life meaning that
6468
these images will no longer receive security updates.
6569

6670
Manylinux compatibility support
6771
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6872

6973
.. Note::
70-
The ``manylinux2014`` specification is relatively new and is not yet widely
71-
recognised by install tools.
74+
* The ``manylinux2014`` specification is relatively new and is not yet widely
75+
recognised by install tools.
76+
* The ``manylinux_x_y`` specification is relatively new and is not yet widely
77+
recognised by install tools.
7278

7379
The following table shows the minimum versions of relevant projects to support
7480
the various ``manylinux`` standards:
7581

76-
========== ============== ================= =================
77-
Tool ``manylinux1`` ``manylinux2010`` ``manylinux2014``
78-
========== ============== ================= =================
79-
pip ``>=8.1.0`` ``>=19.0`` ``>=19.3``
80-
auditwheel ``>=1.0.0`` ``>=2.0.0`` ``>=3.0.0``
81-
========== ============== ================= =================
82+
========== ============== ================= ================= =================
83+
Tool ``manylinux1`` ``manylinux2010`` ``manylinux2014`` ``manylinux_x_y``
84+
========== ============== ================= ================= =================
85+
pip ``>=8.1.0`` ``>=19.0`` ``>=19.3`` ``>=20.3``
86+
auditwheel ``>=1.0.0`` ``>=2.0.0`` ``>=3.0.0`` ``>=3.3.0`` [#]_
87+
========== ============== ================= ================= =================
8288

8389
Platform tags for other \*nix platforms
8490
---------------------------------------
@@ -89,4 +95,4 @@ distribution of wheel files to other \*nix platforms. Efforts are currently
8995
schemes for AIX and for Alpine Linux.
9096

9197

92-
.. [#] https://wiki.centos.org/About/Product
98+
.. [#] Only support for ``manylinux_2_24`` has been added in auditwheel 3.3.0

source/tutorials/packaging-projects.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,22 +195,23 @@ an escape hatch when absolutely necessary.
195195
There are many more than the ones mentioned here. See
196196
:doc:`/guides/distributing-packages-using-setuptools` for more details.
197197

198-
199198
If you create a :file:`setup.py` file, this will enable direct interaction
200199
with :file:`setup.py` (which generally should be avoided), and editable
201200
installs. This file used to be required, but can be omitted in modern
202-
setuptools.
203-
204-
Anything you set in :file:`setup.cfg` can instead be set via keyword argument to
205-
:func:`setup()`; this enables computed values to be used. You will also need
206-
:func:`setup()` for setting up extension modules for compilation.
201+
setuptools. If you include the file, you must have a call to
202+
:func:`setup()` in it:
207203

208204
.. code-block:: python
209205
210206
import setuptools
211207
212208
setuptools.setup()
213209
210+
Anything you set in :file:`setup.cfg` can instead be set via keyword argument to
211+
:func:`setup()`; this enables computed values to be used. You will also need
212+
:func:`setup()` for setting up extension modules for compilation.
213+
214+
214215
.. tab:: setup.py (dynamic)
215216

216217
:file:`setup.py` is the build script for :ref:`setuptools`. It tells setuptools

0 commit comments

Comments
 (0)