|
| 1 | +# get-pip.py |
| 2 | + |
| 3 | +`get-pip.py` is a bootstrapping script that enables users to install pip, |
| 4 | +setuptools, and wheel in Python environments that don't already have them. You |
| 5 | +should not directly reference the files located in this repository and instead |
| 6 | +use the versions located at <https://bootstrap.pypa.io/>. |
| 7 | + |
| 8 | +## Usage |
| 9 | + |
| 10 | +```console |
| 11 | +$ curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
| 12 | +$ python get-pip.py |
| 13 | +``` |
| 14 | + |
| 15 | +Upon execution, `get-pip.py` will install `pip`, `setuptools` and `wheel` in |
| 16 | +the current Python environment. |
| 17 | + |
| 18 | +It is possible to provide additional arguments to the underlying script. These |
| 19 | +are passed through to the underlying `pip install` command, and can thus be |
| 20 | +used to constraint the versions of the packages, or to pass other pip options |
| 21 | +such as `--no-index`. |
| 22 | + |
| 23 | +```console |
| 24 | +$ python get-pip.py "pip < 21.0" "setuptools < 50.0" "wheel < 1.0" |
| 25 | +$ python get-pip.py --no-index --find-links=/local/copies |
| 26 | +``` |
| 27 | + |
| 28 | +### get-pip.py options |
| 29 | + |
| 30 | +This script also has it's own options, which control which packages it will |
| 31 | +install. |
| 32 | + |
| 33 | +- `--no-setuptools`: do not attempt to install `setuptools`. |
| 34 | +- `--no-wheel`: do not attempt to install `wheel`. |
| 35 | + |
| 36 | +## Development |
| 37 | + |
| 38 | +You need to have a [`nox`](https://nox.readthedocs.io/) available on the CLI. |
| 39 | + |
| 40 | +### How it works |
| 41 | + |
| 42 | +`get-pip.py` bundles a copy of pip with a tiny amount of glue code. This glue |
| 43 | +code comes from the `templates/` directory. |
| 44 | + |
| 45 | +### Updating after a pip release |
| 46 | + |
| 47 | +If you just made a pip release, run `nox -s update-for-release -- <version>`. |
| 48 | +This session will handle all the script updates (by running `generate`), commit |
| 49 | +the changes and tag the commit. |
| 50 | + |
| 51 | +IMPORTANT: Check that the correct files got modified before pushing. The session |
| 52 | +will pause to let you do this. |
| 53 | + |
| 54 | +### Generating the scripts |
| 55 | + |
| 56 | +Run `nox -s generate`. |
| 57 | + |
| 58 | +## Discussion |
| 59 | + |
| 60 | +If you run into bugs, you can file them in our [issue tracker]. |
| 61 | + |
| 62 | +You can also join `#pypa` or `#pypa-dev` on Freenode to ask questions or |
| 63 | +get involved. |
| 64 | + |
| 65 | +[issue tracker]: https://github.com/pypa/get-pip/issues |
| 66 | + |
| 67 | +## Code of Conduct |
| 68 | + |
| 69 | +Everyone interacting in the get-pip project's codebases, issue trackers, chat |
| 70 | +rooms, and mailing lists is expected to follow the [PSF Code of Conduct]. |
| 71 | + |
| 72 | +[PSF Code of Conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md |
0 commit comments