Skip to content

Commit 53985a5

Browse files
authored
Merge branch 'main' into dist-info-clarification
2 parents a813ea0 + 68ad77c commit 53985a5

43 files changed

Lines changed: 1216 additions & 282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/test.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.9
16+
17+
- name: pip cache
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.cache/pip
21+
key:
22+
${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('noxfile.py') }}
23+
restore-keys: |
24+
${{ matrix.os }}-${{ matrix.python-version }}-
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade nox virtualenv
29+
30+
- name: Nox build
31+
run: |
32+
python -m nox -s build

‎.travis.yml‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx==3.2.0
22
sphinx-autobuild==0.7.1
3+
sphinx-inline-tabs==2020.10.19b4
34
git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
45
git+https://github.com/pypa/pypa-docs-theme.git#egg=pypa-docs-theme

‎source/conf.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'sphinx.ext.extlinks',
3535
'sphinx.ext.intersphinx',
3636
'sphinx.ext.todo',
37+
'sphinx_inline_tabs',
3738
]
3839

3940
# Add any paths that contain templates here, relative to this directory.
@@ -375,6 +376,7 @@
375376
'python': ('https://docs.python.org/3', None),
376377
'python2': ('https://docs.python.org/2', None),
377378
'pip': ('https://pip.pypa.io/en/latest/', None),
379+
'setuptools': ('https://setuptools.rtfd.io/en/latest/', None),
378380
}
379381

380382

‎source/contribute.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ need:
7979
1. `Nox <https://nox.readthedocs.io/en/latest/>`_. You can install or upgrade
8080
nox using ``pip``::
8181

82-
pip install --user nox
82+
python -m pip install --user nox
8383

8484
2. Python 3.6. Our build scripts are designed to work with Python 3.6 only.
8585
See the `Hitchhiker's Guide to Python installation instructions`_ to install

‎source/discussions/install-requires-vs-requirements.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ packages. [1]_
8383

8484
Whereas ``install_requires`` metadata is automatically analyzed by pip during an
8585
install, requirements files are not, and only are used when a user specifically
86-
installs them using ``pip install -r``.
86+
installs them using ``python -m pip install -r``.
8787

8888
----
8989

‎source/discussions/pip-vs-easy-install.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ pip vs easy_install
66
===================
77

88

9-
`easy_install` was released in 2004, as part of :ref:`setuptools`. It was
9+
:ref:`easy_install <easy_install>` was released in 2004, as part of :ref:`setuptools`. It was
1010
notable at the time for installing :term:`packages <Distribution Package>` from
1111
:term:`PyPI <Python Package Index (PyPI)>` using requirement specifiers, and
1212
automatically installing dependencies.
1313

14-
:ref:`pip` came later in 2008, as alternative to `easy_install`, although still
14+
:ref:`pip` came later in 2008, as alternative to :ref:`easy_install <easy_install>`, although still
1515
largely built on top of :ref:`setuptools` components. It was notable at the
1616
time for *not* installing packages as :term:`Eggs <Egg>` or from :term:`Eggs <Egg>` (but
1717
rather simply as 'flat' packages from :term:`sdists <Source Distribution (or
@@ -27,13 +27,13 @@ Here's a breakdown of the important differences between pip and easy_install now
2727
|Installs from :term:`Wheels |Yes |No |
2828
|<Wheel>` | | |
2929
+------------------------------+--------------------------------------+-------------------------------+
30-
|Uninstall Packages |Yes (``pip uninstall``) |No |
30+
|Uninstall Packages |Yes (``python -m pip uninstall``) |No |
3131
+------------------------------+--------------------------------------+-------------------------------+
3232
|Dependency Overrides |Yes (:ref:`Requirements Files |No |
3333
| |<pip:Requirements Files>`) | |
3434
+------------------------------+--------------------------------------+-------------------------------+
35-
|List Installed Packages |Yes (``pip list`` and ``pip |No |
36-
| |freeze``) | |
35+
|List Installed Packages |Yes (``python -m pip list`` and |No |
36+
| |``python -m pip freeze``) | |
3737
+------------------------------+--------------------------------------+-------------------------------+
3838
|:pep:`438` |Yes |No |
3939
|Support | | |

‎source/glossary.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Glossary
4444
A :term:`Built Distribution` format introduced by :ref:`setuptools`,
4545
which is being replaced by :term:`Wheel`. For details, see `The
4646
Internal Structure of Python Eggs
47-
<https://setuptools.readthedocs.io/en/latest/formats.html>`_ and
47+
<https://setuptools.readthedocs.io/en/latest/deprecated/python_eggs.html>`_ and
4848
`Python Eggs <http://peak.telecommunity.com/DevCenter/PythonEggs>`_
4949

5050
Extension Module

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

Lines changed: 19 additions & 19 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,17 +108,17 @@ 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)
115115
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
116-
AND CURRENT_DATE())
116+
AND CURRENT_DATE()
117117

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,18 +128,18 @@ 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
135135
AND DATE(timestamp)
136136
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
137-
AND CURRENT_DATE())
137+
AND CURRENT_DATE()
138138

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)
@@ -274,7 +274,7 @@ Install `pypinfo`_ using pip.
274274

275275
::
276276

277-
pip install pypinfo
277+
python -m pip install pypinfo
278278

279279
Usage:
280280

@@ -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: 14 additions & 16 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:
@@ -32,7 +31,7 @@ Requirements for packaging and distributing
3231

3332
::
3433

35-
pip install twine
34+
python -m pip install twine
3635

3736
You'll need this to upload your project :term:`distributions <Distribution
3837
Package>` to :term:`PyPI <Python Package Index (PyPI)>` (see :ref:`below
@@ -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`:
@@ -508,9 +507,8 @@ entry_points
508507
Use this keyword to specify any plugins that your project provides for any named
509508
entry points that may be defined by your project or others that you depend on.
510509

511-
For more information, see the section on `Dynamic Discovery of Services and
512-
Plugins
513-
<https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins>`_
510+
For more information, see the section on `Advertising Behavior
511+
<https://setuptools.readthedocs.io/en/latest/userguide/entry_point.html#dynamic-discovery-of-services-and-plugins>`_
514512
from the :ref:`setuptools` docs.
515513

516514
The most commonly used entry point is "console_scripts" (see below).
@@ -653,7 +651,7 @@ maintained by a redistributor.
653651
A local version identifier takes the form ``<public version identifier>+<local version label>``.
654652
For example::
655653

656-
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
657655
1.2.1+fedora.4 # Package with downstream Fedora patches applied
658656

659657

@@ -668,7 +666,7 @@ Assuming you're in the root of your project directory, then run:
668666

669667
::
670668

671-
pip install -e .
669+
python -m pip install -e .
672670

673671

674672
Although somewhat cryptic, ``-e`` is short for ``--editable``, and ``.`` refers
@@ -700,7 +698,7 @@ see the :ref:`VCS Support <pip:VCS Support>` section of the pip docs.
700698

701699
Lastly, if you don't want to install any dependencies at all, you can run::
702700

703-
pip install -e . --no-deps
701+
python -m pip install -e . --no-deps
704702

705703

706704
For more information, see the `Development Mode
@@ -760,7 +758,7 @@ Before you can build wheels for your project, you'll need to install the
760758

761759
.. code-block:: text
762760
763-
pip install wheel
761+
python -m pip install wheel
764762
765763
766764
.. _`Universal Wheels`:

0 commit comments

Comments
 (0)