Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyBeswick committed Oct 8, 2019
2 parents c6906f1 + e5cc08d commit bcbaee7
Show file tree
Hide file tree
Showing 165 changed files with 3,339 additions and 2,105 deletions.
8 changes: 4 additions & 4 deletions .azure-pipelines/jobs/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
inputs:
versionSpec: '3'

- bash: pip install tox nox setuptools wheel
- bash: pip install twine nox setuptools wheel
displayName: Install dependencies

- bash: nox -s generate_authors
Expand All @@ -24,12 +24,12 @@ jobs:
- bash: nox -s generate_news -- --yes
displayName: Generate NEWS.rst

- bash: tox -e packaging
displayName: Run Tox packaging

- bash: python setup.py sdist bdist_wheel
displayName: Create sdist and wheel

- bash: twine check dist/*
displayName: Check distributions with twine

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/steps/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ steps:
inputs:
testResultsFiles: junit/*.xml
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
condition: succeededOrFailed()
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/~good-first-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: (Maintainers Only) Good First Issue
about: For maintainers, to create an issue that is good for new contributors
labels: ["good first issue"]

---

<!-- Write the issue below, provide clear instructions for resolution -->

<!-- End of issue content. -->
<!-- Leave the following intact -->

---

**Good First Issue**: This issue is a good starting point for first time contributors -- the process of fixing this should be a good introduction to pip's development workflow. If you've already contributed to pip, work on [another issue without this label](https://github.com/pypa/pip/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+-label%3A%22good+first+issue%22) instead. If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our [Getting Started Guide](https://pip.pypa.io/en/latest/development/getting-started/). If you are working on this issue and have questions, feel free to ask them here, [`#pypa-dev` on Freenode](https://webchat.freenode.net/?channels=%23pypa-dev), or the [pypa-dev mailing list](https://groups.google.com/forum/#!forum/pypa-dev).
18 changes: 0 additions & 18 deletions .github/workflows/python-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jobs:
env:
- TOXENV: docs
- TOXENV: lint
- TOXENV: lint-py2
PYTHON_VERSION: 2.7
- TOXENV: mypy
- TOXENV: packaging
steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.env.PYTHON_VERSION || 3.7 }}
Expand All @@ -44,17 +40,3 @@ jobs:
run: >-
python -m tox
env: ${{ matrix.env }}

news_format:
name: Check NEWS format
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
version: 3.7
- name: Install nox
run: pip install nox
- name: Check NEWS format
run: nox -s validate_news
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
exclude: 'src/pip/_vendor/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: WHEEL
- id: flake8
exclude: tests/data
- id: forbid-new-submodules
- id: trailing-whitespace
exclude: .patch

- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
hooks:
- id: isort
files: \.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.730
hooks:
- id: mypy
exclude: docs|tests
args: []
- id: mypy
name: mypy, for Py2
exclude: docs|tests
args: ["-2"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.1
hooks:
- id: python-no-log-warn
- id: python-no-eval
- id: rst-backticks
# Validate existing ReST files and NEWS fragments.
files: .*\.rst$|^news/.*
types: [file]
# The errors flagged in NEWS.rst are old.
exclude: NEWS.rst

- repo: https://github.com/mgedmin/check-manifest
rev: '0.39'
hooks:
- id: check-manifest
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
- stage: primary
env: TOXENV=docs
- env: TOXENV=lint
- env: TOXENV=lint-py2
python: 2.7
- env: TOXENV=mypy
- env: TOXENV=packaging
# Latest CPython
- env: GROUP=1
python: 2.7
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exclude .mailmap
exclude .appveyor.yml
exclude .travis.yml
exclude .readthedocs.yml
exclude .pre-commit-config.yaml
exclude tox.ini
exclude noxfile.py

Expand Down
2 changes: 1 addition & 1 deletion docs/html/development/architecture/anatomy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the

* ``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!]*

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

* ``src/`` *[source; see below]*
* ``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.]*
Expand Down
1 change: 0 additions & 1 deletion docs/html/development/architecture/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,3 @@ files on PyPI. It’s for getting all files of Flask.)
.. _`tracking issue`: https://github.com/pypa/pip/issues/6831
.. _PyPI: https://pypi.org/
.. _PyPI Simple API: https://warehouse.readthedocs.io/api-reference/legacy/#simple-project-api

4 changes: 2 additions & 2 deletions docs/html/development/architecture/package-finding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ difference may simply be historical and may not actually be necessary.)

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

The ``PackageFinder`` class is responsible for doing all of the things listed
in the :ref:`Overview <index-py-overview>` section like fetching and parsing
Expand Down
2 changes: 2 additions & 0 deletions docs/html/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ from a description of the feature/change in one or more paragraphs, each wrapped
at 80 characters. Remember that a news entry is meant for end users and should
only contain details relevant to an end user.

.. _`choosing-news-entry-type`:

Choosing the type of NEWS entry
-------------------------------

Expand Down
42 changes: 12 additions & 30 deletions docs/html/development/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ process, please `open an issue`_ about it on the issue tracker.
Development Environment
-----------------------

pip uses :pypi:`tox` for testing against multiple different Python environments
and ensuring reproducible environments for linting and building documentation.
pip is a command line application written in Python. For developing pip,
you should `install Python`_ on your computer.

For developing pip, you need to install ``tox`` on your system. Often, you can
just do ``python -m pip install tox`` to install and use it.
For developing pip, you need to install :pypi:`tox`. Often, you can run
``python -m pip install tox`` to install and use it.

Running pip From Source Tree
----------------------------
Expand All @@ -30,8 +30,9 @@ from the ``src`` directory:
Running Tests
-------------

pip uses the :pypi:`pytest` test framework, :pypi:`mock` and :pypi:`pretend`
for testing. These are automatically installed by tox for running the tests.
pip's tests are written using the :pypi:`pytest` test framework, :pypi:`mock`
and :pypi:`pretend`. :pypi:`tox` is used to automate the setup and execution of
pip's tests.

To run tests locally, run:

Expand All @@ -42,7 +43,7 @@ To run tests locally, run:
The example above runs tests against Python 3.6. You can also use other
versions like ``py27`` and ``pypy3``.

``tox`` has been configured to any additional arguments it is given to
``tox`` has been configured to forward any additional arguments it is given to
``pytest``. This enables the use of pytest's `rich CLI`_. As an example, you
can select tests using the various ways that pytest provides:

Expand All @@ -67,35 +68,15 @@ tools, you can tell pip to skip those tests:
Running Linters
---------------

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

To use linters locally, run:

.. code-block:: console
$ tox -e lint
$ tox -e lint-py2
The above commands run the linters on Python 3 followed by Python 2.

.. note::

Do not silence errors from flake8 with ``# noqa`` comments or otherwise.

Running mypy
------------

pip uses :pypi:`mypy` to run static type analysis, which helps catch certain
kinds of bugs. The codebase uses `PEP 484 type-comments`_ due to compatibility
requirements with Python 2.7.

To run the ``mypy`` type checker, run:

.. code-block:: console
$ tox -e mypy
Building Documentation
----------------------
Expand All @@ -112,5 +93,6 @@ To build it locally, run:
The built documentation can be found in the ``docs/build`` folder.

.. _`open an issue`: https://github.com/pypa/pip/issues/new?title=Trouble+with+pip+development+environment
.. _`install Python`: https://realpython.com/installing-python/
.. _`PEP 484 type-comments`: https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code
.. _`rich CLI`: https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests
Loading

0 comments on commit bcbaee7

Please sign in to comment.