You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/html/development/architecture/anatomy.rst
+7-13Lines changed: 7 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,23 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the
24
24
* ``README.rst``
25
25
* ``setup.cfg``
26
26
* ``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.
29
28
* ``.gitattributes``
30
29
* ``.gitignore``
31
30
* ``.mailmap``
32
-
* ``.readthedocs.yml``
33
31
* ``docs/`` *[documentation, built with Sphinx]*
34
32
35
33
* ``html/`` *[sources to HTML documentation avail. online]*
36
34
* ``man/`` has man pages the distros can use by running ``man pip``
37
35
* ``pip_sphinxext.py`` *[an extension -- pip-specific plugins to Sphinx that do not apply to other packages]*
36
+
* ``requirements.txt``
38
37
39
38
* ``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!]*
40
39
41
40
* ``template.rst`` *[template for changelog -- this is a file towncrier uses…. Is this jinja? I don’t know, check towncrier docs]*
42
41
43
42
* ``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.]*
45
44
* ``tests/`` -- contains tests you can run. There are instructions in :doc:`../getting-started`.
46
45
47
46
* ``__init__.py``
@@ -51,10 +50,7 @@ The ``README``, license, ``pyproject.toml``, ``setup.py``, and so on are in the
51
50
* ``lib/`` *[helpers for tests]*
52
51
* ``unit/`` *[unit tests -- fast and small and nice!]*
53
52
54
-
* ``tools`` *[misc development workflow tools, like requirements files & CI files & helpers for tox]*
55
53
* ``.github``
56
-
* ``.tox``
57
-
58
54
59
55
60
56
src directory
@@ -67,24 +63,23 @@ dependencies (code from other packages).
67
63
68
64
Within ``src/``:
69
65
70
-
* ``pip.egg-info/`` *[ignore the contents for now]*
71
66
* ``pip/``
72
67
73
68
* ``__init__.py``
74
69
* ``__main__.py``
75
-
* ``__pycache__/`` *[not discussing contents right now]*
76
70
* ``_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.]*
77
71
78
72
* ``__init__.py``
79
-
* ``build_env.py`` [not discussing now]
73
+
* ``build_env.py``
80
74
* ``cache.py`` *[has all the info for how to handle caching within pip -- cache-handling stuff. Uses cachecontrol from PyPI, vendored into pip]*
81
75
* ``cli/`` *[subpackage containing helpers & additional code for managing the command line interface. Uses argparse from stdlib]*
82
76
* ``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]*
83
77
* ``configuration.py``
84
78
* ``download.py``
85
79
* ``exceptions.py``
86
-
* ``index.py``
87
-
* ``locations.py``
80
+
* ``index/``
81
+
* ``locations/``
82
+
* ``main.py`` *[legacy entry point]*
88
83
* ``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.]*
89
84
* ``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``?]
0 commit comments