Skip to content

Commit 5f0fc6f

Browse files
authored
Merge branch 'main' into patch-1
2 parents 8954361 + 68ad77c commit 5f0fc6f

34 files changed

Lines changed: 835 additions & 250 deletions

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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/guides/analyzing-pypi-package-downloads.rst

Lines changed: 17 additions & 17 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)
@@ -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: 12 additions & 13 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`:
@@ -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

@@ -670,7 +669,7 @@ Change directory to the root of the project directory and run ``pip install -e .
670669

671670
::
672671

673-
pip install -e .
672+
python -m pip install -e .
674673

675674

676675
The pip command-line flag ``-e`` is short for ``--editable``, and ``.`` refers
@@ -702,7 +701,7 @@ see the :ref:`VCS Support <pip:VCS Support>` section of the pip docs.
702701

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

705-
pip install -e . --no-deps
704+
python -m pip install -e . --no-deps
706705

707706

708707
For more information, see the `Development Mode
@@ -762,7 +761,7 @@ Before you can build wheels for your project, you'll need to install the
762761

763762
.. code-block:: text
764763
765-
pip install wheel
764+
python -m pip install wheel
766765
767766
768767
.. _`Universal Wheels`:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Ensure that before you generate source distributions or binary distributions, yo
3232

3333
Steps::
3434

35-
pip install --upgrade setuptools twine
35+
python -m pip install --upgrade setuptools twine
3636

3737
`setuptools` version should be above 24.0.0.
3838

0 commit comments

Comments
 (0)