Skip to content

Commit 182bac1

Browse files
authored
Merge pull request #10774 from gavindsouza/patch-1
2 parents d0051d3 + 55fab93 commit 182bac1

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

docs/html/development/architecture/anatomy.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,23 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the
2424
* ``README.rst``
2525
* ``setup.cfg``
2626
* ``setup.py``
27-
* ``tox.ini`` -- ``pip`` uses Tox, an automation tool, configured by this `tox.ini`_ file. ``tox.ini`` describes a few environments ``pip`` uses during development for simplifying how tests are run (complicated situation there). Example: ``tox -e -py36``. We can run tests for different versions of Python by changing “36” to “27” or similar.
28-
* ``.coveragerc``
27+
* ``noxfile.py`` -- ``pip`` uses Nox, an automation tool, configured by this file. ``noxfile.py`` describes a few environments ``pip`` uses during development for simplifying how tests are run (complicated situation there). Example: ``nox -s lint``, ``nox -s test-3.10``. We can run tests for different versions of Python by changing “3.10” to “3.7” or similar.
2928
* ``.gitattributes``
3029
* ``.gitignore``
3130
* ``.mailmap``
32-
* ``.readthedocs.yml``
3331
* ``docs/`` *[documentation, built with Sphinx]*
3432

3533
* ``html/`` *[sources to HTML documentation avail. online]*
3634
* ``man/`` has man pages the distros can use by running ``man pip``
3735
* ``pip_sphinxext.py`` *[an extension -- pip-specific plugins to Sphinx that do not apply to other packages]*
36+
* ``requirements.txt``
3837

3938
* ``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 changelog…. 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!]*
4039

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

4342
* ``src/`` *[source; see below]*
44-
* ``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.]*
43+
* ``tools/`` *[misc development workflow tools, like requirements files & CI files & helpers. For instance, automating the release.]*
4544
* ``tests/`` -- contains tests you can run. There are instructions in :doc:`../getting-started`.
4645

4746
* ``__init__.py``
@@ -51,10 +50,7 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the
5150
* ``lib/`` *[helpers for tests]*
5251
* ``unit/`` *[unit tests -- fast and small and nice!]*
5352

54-
* ``tools`` *[misc development workflow tools, like requirements files & CI files & helpers for tox]*
5553
* ``.github``
56-
* ``.tox``
57-
5854

5955

6056
src directory
@@ -67,24 +63,23 @@ dependencies (code from other packages).
6763

6864
Within ``src/``:
6965

70-
* ``pip.egg-info/`` *[ignore the contents for now]*
7166
* ``pip/``
7267

7368
* ``__init__.py``
7469
* ``__main__.py``
75-
* ``__pycache__/`` *[not discussing contents right now]*
7670
* ``_internal/`` *[where all the pip code lives that’s written by pip maintainers -- underscore means private. pip is not a library -- it’s a command line tool! A very important distinction! People who want to install stuff with pip should not use the internals -- they should use the CLI. There’s a note on this in the docs.]*
7771

7872
* ``__init__.py``
79-
* ``build_env.py`` [not discussing now]
73+
* ``build_env.py``
8074
* ``cache.py`` *[has all the info for how to handle caching within pip -- cache-handling stuff. Uses cachecontrol from PyPI, vendored into pip]*
8175
* ``cli/`` *[subpackage containing helpers & additional code for managing the command line interface. Uses argparse from stdlib]*
8276
* ``commands/`` *[literally - each file is the name of the command on the pip CLI. Each has a class that defines what’s needed to set it up, what happens]*
8377
* ``configuration.py``
8478
* ``download.py``
8579
* ``exceptions.py``
86-
* ``index.py``
87-
* ``locations.py``
80+
* ``index/``
81+
* ``locations/``
82+
* ``main.py`` *[legacy entry point]*
8883
* ``models/`` *[in-process refactoring! Goal: improve how pip internally models representations it has for data -- data representation. General overall cleanup. Data reps are spread throughout codebase….link is defined in a class in 1 file, and then another file imports Link from that file. Sometimes cyclic dependency?!?! To prevent future situations like this, etc., Pradyun started moving these into a models directory.]*
8984
* ``operations/`` -- a bit of a weird directory….. ``Freeze.py`` used to be in there. Freeze is an operation -- there was an operations.freeze. Then “prepare” got added (the operation of preparing a pkg). Then “check” got added for checking the state of an env.] [what’s a command vs an operation? Command is on CLI; an operation would be an internal bit of code that actually does some subset of the operation the command says. ``install`` command uses bits of ``check`` and ``prepare``, for instance. In the long run, Pradyun’s goal: ``prepare.py`` goes away (gets refactored into other files) such that ``operations`` is just ``check`` and ``freeze``..... … Pradyun plans to refactor this. [how does this compare to ``utils``?]
9085

@@ -102,5 +97,4 @@ Within ``src/``:
10297

10398
.. _`tracking issue`: https://github.com/pypa/pip/issues/6831
10499
.. _GitHub repository: https://github.com/pypa/pip/
105-
.. _tox.ini: https://github.com/pypa/pip/blob/main/tox.ini
106100
.. _improving the pip dependency resolver: https://github.com/pypa/pip/issues/988

news/10774.trivial.rst

Whitespace-only changes.

0 commit comments

Comments
 (0)