Skip to content

Commit ff041cc

Browse files
authored
Merge branch 'master' into master
2 parents 9a2181a + 7dc7b81 commit ff041cc

File tree

140 files changed

+2564
-1717
lines changed

Some content is hidden

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

140 files changed

+2564
-1717
lines changed

.azure-pipelines/jobs/package.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
inputs:
1616
versionSpec: '3'
1717

18-
- bash: pip install tox nox setuptools wheel
18+
- bash: pip install twine nox setuptools wheel
1919
displayName: Install dependencies
2020

2121
- bash: nox -s generate_authors
@@ -24,12 +24,12 @@ jobs:
2424
- bash: nox -s generate_news -- --yes
2525
displayName: Generate NEWS.rst
2626

27-
- bash: tox -e packaging
28-
displayName: Run Tox packaging
29-
3027
- bash: python setup.py sdist bdist_wheel
3128
displayName: Create sdist and wheel
3229

30+
- bash: twine check dist/*
31+
displayName: Check distributions with twine
32+
3333
- task: PublishBuildArtifacts@1
3434
displayName: 'Publish Artifact: dist'
3535
inputs:

.azure-pipelines/steps/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ steps:
2222
inputs:
2323
testResultsFiles: junit/*.xml
2424
testRunTitle: 'Python $(python.version)'
25-
condition: succeededOrFailed()
25+
condition: succeededOrFailed()

.github/workflows/python-linters.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ jobs:
2020
env:
2121
- TOXENV: docs
2222
- TOXENV: lint
23-
- TOXENV: lint-py2
24-
PYTHON_VERSION: 2.7
25-
- TOXENV: mypy
26-
- TOXENV: packaging
2723
steps:
2824
- uses: actions/checkout@master
2925
- name: Set up Python ${{ matrix.env.PYTHON_VERSION || 3.7 }}
@@ -44,17 +40,3 @@ jobs:
4440
run: >-
4541
python -m tox
4642
env: ${{ matrix.env }}
47-
48-
news_format:
49-
name: Check NEWS format
50-
runs-on: ubuntu-18.04
51-
steps:
52-
- uses: actions/checkout@master
53-
- name: Set up Python
54-
uses: actions/setup-python@v1
55-
with:
56-
version: 3.7
57-
- name: Install nox
58-
run: pip install nox
59-
- name: Check NEWS format
60-
run: nox -s validate_news

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
exclude: 'src/pip/_vendor/'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.3.0
6+
hooks:
7+
- id: check-builtin-literals
8+
- id: check-added-large-files
9+
- id: check-case-conflict
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: debug-statements
13+
- id: end-of-file-fixer
14+
exclude: WHEEL
15+
- id: flake8
16+
exclude: tests/data
17+
- id: forbid-new-submodules
18+
- id: trailing-whitespace
19+
exclude: .patch
20+
21+
- repo: https://github.com/timothycrosley/isort
22+
rev: 4.3.21
23+
hooks:
24+
- id: isort
25+
files: \.py$
26+
27+
- repo: https://github.com/pre-commit/mirrors-mypy
28+
rev: v0.730
29+
hooks:
30+
- id: mypy
31+
exclude: docs|tests
32+
args: []
33+
- id: mypy
34+
name: mypy, for Py2
35+
exclude: docs|tests
36+
args: ["-2"]
37+
38+
- repo: https://github.com/pre-commit/pygrep-hooks
39+
rev: v1.4.1
40+
hooks:
41+
- id: python-no-log-warn
42+
- id: python-no-eval
43+
- id: rst-backticks
44+
# Validate existing ReST files and NEWS fragments.
45+
files: .*\.rst$|^news/.*
46+
types: [file]
47+
# The errors flagged in NEWS.rst are old.
48+
exclude: NEWS.rst
49+
50+
- repo: https://github.com/mgedmin/check-manifest
51+
rev: '0.39'
52+
hooks:
53+
- id: check-manifest

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ jobs:
1717
- stage: primary
1818
env: TOXENV=docs
1919
- env: TOXENV=lint
20-
- env: TOXENV=lint-py2
21-
python: 2.7
22-
- env: TOXENV=mypy
23-
- env: TOXENV=packaging
2420
# Latest CPython
2521
- env: GROUP=1
2622
python: 2.7

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exclude .mailmap
1616
exclude .appveyor.yml
1717
exclude .travis.yml
1818
exclude .readthedocs.yml
19+
exclude .pre-commit-config.yaml
1920
exclude tox.ini
2021
exclude noxfile.py
2122

docs/html/development/architecture/anatomy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the
3939

4040
* ``news/`` *[pip stores news fragments… Every time pip makes a user-facing change, a file is added to this directory (usually a short note referring to a GitHub issue) with the right extension & name so it gets included in release notes…. So every release the maintainers will be deleting old files in this directory? Yes - we use the towncrier automation to generate a NEWS file, and auto-delete old stuff. There’s more about this in the contributor documentation!]*
4141

42-
* ``template.rst`` *[template for release notes -- this is a file towncrier uses…. Is this jinja? I don’t know, check towncrier docs]*
42+
* ``template.rst`` *[template for release notes -- this is a file towncrier uses…. Is this jinja? I don’t know, check towncrier docs]*
4343

4444
* ``src/`` *[source; see below]*
4545
* ``tasks/`` *[invoke is a PyPI library which uses files in this directory to define automation commands that are used in pip’s development processes -- not discussing further right now. For instance, automating the release.]*

docs/html/development/architecture/overview.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,3 @@ files on PyPI. It’s for getting all files of Flask.)
140140
.. _`tracking issue`: https://github.com/pypa/pip/issues/6831
141141
.. _PyPI: https://pypi.org/
142142
.. _PyPI Simple API: https://warehouse.readthedocs.io/api-reference/legacy/#simple-project-api
143-

docs/html/development/architecture/package-finding.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ difference may simply be historical and may not actually be necessary.)
8585

8686
Each of these commands also uses the ``PackageFinder`` class for pip's
8787
"self-check," (i.e. to check whether a pip upgrade is available). In this
88-
case, the ``PackageFinder`` instance is created by the ``outdated.py``
89-
module's ``pip_version_check()`` function.
88+
case, the ``PackageFinder`` instance is created by the
89+
``self_outdated_check.py`` module's ``pip_self_version_check()`` function.
9090

9191
The ``PackageFinder`` class is responsible for doing all of the things listed
9292
in the :ref:`Overview <index-py-overview>` section like fetching and parsing

docs/html/development/contributing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ from a description of the feature/change in one or more paragraphs, each wrapped
8989
at 80 characters. Remember that a news entry is meant for end users and should
9090
only contain details relevant to an end user.
9191

92+
.. _`choosing-news-entry-type`:
93+
9294
Choosing the type of NEWS entry
9395
-------------------------------
9496

docs/html/development/getting-started.rst

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,15 @@ tools, you can tell pip to skip those tests:
6868
Running Linters
6969
---------------
7070

71-
pip uses :pypi:`flake8` and :pypi:`isort` for linting the codebase. These
72-
ensure that the codebase is in compliance with :pep:`8` and the imports are
73-
consistently ordered and styled.
71+
pip uses :pypi:`pre-commit` for managing linting of the codebase.
72+
``pre-commit`` performs various checks on all files in pip and uses tools that
73+
help follow a consistent code style within the codebase.
7474

7575
To use linters locally, run:
7676

7777
.. code-block:: console
7878
7979
$ tox -e lint
80-
$ tox -e lint-py2
81-
82-
The above commands run the linters on Python 3 followed by Python 2.
83-
84-
.. note::
85-
86-
Do not silence errors from flake8 with ``# noqa`` comments or otherwise.
87-
88-
Running mypy
89-
------------
90-
91-
pip uses :pypi:`mypy` to run static type analysis, which helps catch certain
92-
kinds of bugs. The codebase uses `PEP 484 type-comments`_ due to compatibility
93-
requirements with Python 2.7.
94-
95-
To run the ``mypy`` type checker, run:
96-
97-
.. code-block:: console
98-
99-
$ tox -e mypy
10080
10181
Building Documentation
10282
----------------------

0 commit comments

Comments
 (0)