├── tests ├── __init__.py ├── unit │ ├── __init__.py │ ├── resolution_resolvelib │ │ └── __init__.py │ ├── test_utils_filesystem.py │ ├── test_vcs_mercurial.py │ ├── test_pep517.py │ └── test_network_utils.py ├── functional │ ├── __init__.py │ ├── test_bad_url.py │ ├── test_vcs_mercurial.py │ ├── test_pip_runner_script.py │ ├── test_install_cleanup.py │ ├── test_truststore.py │ ├── test_vcs_bazaar.py │ ├── test_vcs_subversion.py │ └── test_self_update.py ├── data │ ├── packages │ │ ├── invalid.whl │ │ ├── gmpy-1.15.tar.gz │ │ ├── gmpy2-2.0.tar.gz │ │ ├── symlinks │ │ │ ├── doc │ │ │ │ └── intro │ │ │ ├── docs │ │ │ ├── symlinks │ │ │ │ └── __init__.py │ │ │ ├── setup.cfg │ │ │ └── setup.py │ │ ├── duplicate-1.0.tar.gz │ │ ├── pkgwithmpkg-1.0.tar.gz │ │ ├── priority-1.0.tar.gz │ │ ├── BrokenEmitsUTF8 │ │ │ ├── broken.py │ │ │ └── setup.py │ │ ├── FSPkg │ │ │ ├── fspkg │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── priority-1.0-py2.py3-none-any.whl │ │ ├── LocalExtras │ │ │ ├── localextras │ │ │ │ └── __init__.py │ │ │ ├── .gitignore │ │ │ └── setup.py │ │ ├── LocalExtras-0.0.2 │ │ │ ├── localextras │ │ │ │ └── __init__.py │ │ │ ├── .gitignore │ │ │ └── setup.py │ │ ├── pkgwithmpkg-1.0-py2.7-macosx10.7.mpkg.zip │ │ ├── LocalEnvironMarker │ │ │ ├── localenvironmarker │ │ │ │ └── __init__.py │ │ │ ├── .gitignore │ │ │ └── setup.py │ │ ├── requires_wheelbroken_upper │ │ │ ├── requires_wheelbroken_upper │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── LineEndings │ │ │ └── setup.py │ │ ├── pep517_wrapper_buildsys │ │ │ ├── setup.py │ │ │ ├── setup.cfg │ │ │ ├── pyproject.toml │ │ │ └── mybuildsys.py │ │ ├── pep517_setup_and_pyproject │ │ │ ├── setup.py │ │ │ ├── setup.cfg │ │ │ └── pyproject.toml │ │ ├── test_tar.tgz │ │ ├── test_zip.zip │ │ ├── Upper-1.0.tar.gz │ │ ├── Upper-2.0.tar.gz │ │ ├── broken-0.1.tar.gz │ │ ├── child-0.1.tar.gz │ │ ├── parent-0.1.tar.gz │ │ ├── pep518-3.0.tar.gz │ │ ├── simple-1.0.tar.gz │ │ ├── simple-2.0.tar.gz │ │ ├── simple-3.0.tar.gz │ │ ├── source-1.0.tar.gz │ │ ├── INITools-0.2.tar.gz │ │ ├── corruptwheel-1.0-py2.py3-none-any.whl │ │ ├── simple2-1.0.tar.gz │ │ ├── simple2-2.0.tar.gz │ │ ├── simple2-3.0.tar.gz │ │ ├── SetupPyLatin1 │ │ │ └── setup.py │ │ ├── argparse-1.2.1.tar.gz │ │ ├── distribute-0.7.3.zip │ │ ├── virtualenv-1.10.tar.gz │ │ ├── wheelbroken-0.1.tar.gz │ │ ├── broken-0.2+broken.tar.gz │ │ ├── brokenegginfo-0.1.tar.gz │ │ ├── requiresupper-1.0.tar.gz │ │ ├── setuptools-0.9.6.tar.gz │ │ ├── virtualenv-1.9.1.tar.gz │ │ ├── TopoRequires-0.0.1.tar.gz │ │ ├── TopoRequires2-0.0.1.tar.gz │ │ ├── TopoRequires3-0.0.1.tar.gz │ │ ├── TopoRequires4-0.0.1.tar.gz │ │ ├── mypy-0.782-py3-none-any.whl │ │ ├── pep518_forkbomb-235.tar.gz │ │ ├── pip_test_package-0.1.tar.gz │ │ ├── require_simple-1.0.tar.gz │ │ ├── singlemodule-0.0.0.tar.gz │ │ ├── singlemodule-0.0.1.tar.gz │ │ ├── singlemodule-0.0.1.tar.lzma │ │ ├── singlemodule-0.0.1.tar.xz │ │ ├── wheelbrokenafter-0.1.tar.gz │ │ ├── meta-1.0-py2.py3-none-any.whl │ │ ├── pip_test_package-0.1.1.tar.gz │ │ ├── translationstring-1.1.tar.gz │ │ ├── require_invalid_version-1.0.tar.gz │ │ ├── brokenwheel-1.0-py2.py3-none-any.whl │ │ ├── colander-0.9.9-py2.py3-none-any.whl │ │ ├── compilewheel-1.0-py2.py3-none-any.whl │ │ ├── complex_dist-0.1-py2.py3-none-any.whl │ │ ├── has.script-1.0-py2.py3-none-any.whl │ │ ├── invalid_version-1.0-py3-none-any.whl │ │ ├── license.dist-0.1-py2.py3-none-any.whl │ │ ├── license.dist-0.2-py2.py3-none-any.whl │ │ ├── requiresPaste │ │ │ ├── requiresPaste.py │ │ │ └── pyproject.toml │ │ ├── setuptools-0.9.8-py2.py3-none-any.whl │ │ ├── simple.dist-0.1-py1-none-invalid.whl │ │ ├── simple.dist-0.1-py2.py3-none-any.whl │ │ ├── simplewheel-1.0-py2.py3-none-any.whl │ │ ├── simplewheel-2.0-py2.py3-none-any.whl │ │ ├── SetupPyUTF8 │ │ │ └── setup.py │ │ ├── invalid_version-2010i-py3-none-any.whl │ │ ├── pep518_twin_forkbombs_first-234.tar.gz │ │ ├── pep518_twin_forkbombs_second-238.tar.gz │ │ ├── script.wheel1-0.1-py2.py3-none-any.whl │ │ ├── script.wheel1a-0.1-py2.py3-none-any.whl │ │ ├── script.wheel2-0.1-py2.py3-none-any.whl │ │ ├── script.wheel2a-0.1-py2.py3-none-any.whl │ │ ├── script.wheel3-0.1-py2.py3-none-any.whl │ │ ├── simplewheel-2.0-1-py2.py3-none-any.whl │ │ ├── pep518_with_extra_and_markers-1.0.tar.gz │ │ ├── prjwithdatafile-1.0-py2.py3-none-any.whl │ │ ├── requires_source-1.0-py2.py3-none-any.whl │ │ ├── simple_namespace-1.0-py2.py3-none-any.whl │ │ ├── simplewheel-2.0-py3-fakeabi-fakeplat.whl │ │ ├── require_invalid_version-0.1-py3-none-any.whl │ │ ├── require_invalid_version-1.0-py3-none-any.whl │ │ ├── requires_simple_extra-0.1-py2.py3-none-any.whl │ │ ├── console_scripts_uppercase-1.0-py2.py3-none-any.whl │ │ └── HackedEggInfo │ │ │ └── setup.py │ ├── completion_paths │ │ ├── README.txt │ │ ├── REPLAY │ │ │ └── video.mpeg │ │ ├── requirements.txt │ │ └── resources │ │ │ └── images │ │ │ └── icon.png │ ├── src │ │ ├── extension │ │ │ ├── extension.c │ │ │ └── setup.py │ │ ├── pep518-3.0 │ │ │ ├── setup.cfg │ │ │ ├── pep518.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── simplewheel-1.0 │ │ │ ├── setup.cfg │ │ │ ├── simplewheel │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── simplewheel-2.0 │ │ │ ├── setup.cfg │ │ │ ├── simplewheel │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── pep518_forkbomb-235 │ │ │ ├── setup.cfg │ │ │ ├── pep518_forkbomb.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── TopoRequires │ │ │ ├── toporequires │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── pep518_missing_requires │ │ │ ├── pyproject.toml │ │ │ ├── pep518.py │ │ │ ├── MANIFEST.in │ │ │ └── setup.py │ │ ├── TopoRequires2 │ │ │ ├── toporequires2 │ │ │ │ └── __init__.py │ │ │ ├── setup.cfg.pending │ │ │ └── setup.py │ │ ├── TopoRequires3 │ │ │ ├── toporequires3 │ │ │ │ └── __init__.py │ │ │ ├── setup.cfg.pending │ │ │ └── setup.py │ │ ├── TopoRequires4 │ │ │ ├── toporequires4 │ │ │ │ └── __init__.py │ │ │ ├── setup.cfg.pending │ │ │ └── setup.py │ │ ├── pep518_twin_forkbombs_first-234 │ │ │ ├── setup.cfg │ │ │ ├── pep518_twin_forkbombs_first.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── pep518_twin_forkbombs_second-238 │ │ │ ├── setup.cfg │ │ │ ├── pep518_twin_forkbombs_second.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── pep518_with_extra_and_markers-1.0 │ │ │ ├── setup.cfg │ │ │ ├── MANIFEST.in │ │ │ ├── pep518_with_extra_and_markers.py │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── pep518_invalid_requires │ │ │ ├── pep518.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── prjwithdatafile │ │ │ ├── prjwithdatafile │ │ │ │ ├── somemodule.py │ │ │ │ └── README.txt │ │ │ └── setup.py │ │ ├── requires_simple_extra │ │ │ ├── requires_simple_extra.py │ │ │ ├── setup.cfg │ │ │ └── setup.py │ │ ├── simple_namespace │ │ │ ├── simple_namespace │ │ │ │ ├── __init__.py │ │ │ │ └── module │ │ │ │ │ └── __init__.py │ │ │ ├── setup.cfg │ │ │ └── setup.py │ │ ├── pep518_conflicting_requires │ │ │ ├── pep518.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── pep518_invalid_build_system │ │ │ ├── pep518.py │ │ │ ├── MANIFEST.in │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── requires_simple │ │ │ ├── requires_simple │ │ │ │ └── __init__.py │ │ │ └── setup.py │ │ ├── pep518_with_namespace_package-1.0 │ │ │ ├── pep518_with_namespace_package.py │ │ │ ├── setup.cfg │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── compilewheel │ │ │ ├── simple │ │ │ │ └── __init__.py │ │ │ ├── setup.py │ │ │ └── setup.cfg │ │ ├── pep517_setup_cfg_only │ │ │ └── setup.cfg │ │ ├── pep517_setup_only │ │ │ └── setup.py │ │ ├── pep517_pyproject_only │ │ │ └── pyproject.toml │ │ ├── pep517_setup_and_pyproject │ │ │ ├── pyproject.toml │ │ │ └── setup.py │ │ ├── withpyproject │ │ │ ├── setup.py │ │ │ └── pyproject.toml │ │ ├── chattymodule │ │ │ ├── chattymodule.py │ │ │ ├── pyproject.toml │ │ │ └── backend.py │ │ ├── singlemodule │ │ │ ├── singlemodule.py │ │ │ ├── setup.py │ │ │ └── setup.cfg │ │ ├── requires_capitalized │ │ │ └── setup.py │ │ ├── requires_requires_capitalized │ │ │ └── setup.py │ │ └── setup_error │ │ │ └── setup.py │ ├── packages2 │ │ └── duplicate-1.0.tar.gz │ ├── indexes │ │ ├── empty_with_pkg │ │ │ ├── index.html │ │ │ └── simple-1.0.tar.gz │ │ ├── in dex │ │ │ ├── README.txt │ │ │ └── simple │ │ │ │ └── index.html │ │ ├── dev │ │ │ └── bar │ │ │ │ └── index.html │ │ ├── simple │ │ │ └── simple │ │ │ │ └── index.html │ │ ├── require-invalid-version │ │ │ ├── invalid-version │ │ │ │ └── index.html │ │ │ └── require-invalid-version │ │ │ │ └── index.html │ │ ├── pre │ │ │ └── bar │ │ │ │ └── index.html │ │ ├── README.txt │ │ ├── invalid-version │ │ │ └── invalid-version │ │ │ │ └── index.html │ │ ├── yanked │ │ │ └── simple │ │ │ │ └── index.html │ │ ├── yanked_all │ │ │ └── simple │ │ │ │ └── index.html │ │ └── datarequire │ │ │ └── fakepackage │ │ │ └── index.html │ ├── backends │ │ ├── test_backend-0.1.tar.gz │ │ ├── test_backend-0.1-py2.py3-none-any.whl │ │ └── dummy_backend-0.1-py2.py3-none-any.whl │ ├── packages3 │ │ ├── dinner │ │ │ ├── Dinner-1.0.tar.gz │ │ │ ├── Dinner-2.0.tar.gz │ │ │ └── index.html │ │ ├── requiredinner │ │ │ ├── requiredinner-1.0.tar.gz │ │ │ └── index.html │ │ └── index.html │ └── reqfiles │ │ ├── supported_options2.txt │ │ └── README.txt ├── ruff.toml └── lib │ ├── index.py │ ├── options_helpers.py │ ├── compat.py │ └── filesystem.py ├── tools ├── __init__.py ├── codespell-ignore.txt ├── vendoring │ └── patches │ │ ├── truststore.patch │ │ ├── pkg_resources.patch │ │ ├── urllib3.patch │ │ └── urllib3-disable-brotli.patch ├── release │ └── check_version.py └── protected_pip.py ├── news ├── 13633.trivial.rst ├── 13652.trivial.rst ├── .gitignore ├── 8b0d3f48-311e-4f2c-a59b-b4487ece496c.trivial.rst ├── 13559.trivial.rst ├── 6823.bugfix.rst ├── 13682.bugfix.rst ├── 13555.bugfix.rst ├── 13656.bugfix.rst ├── 12891.feature.rst ├── 13660.feature.rst └── 13407.bugfix.rst ├── src └── pip │ ├── _vendor │ ├── certifi │ │ ├── py.typed │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── LICENSE │ ├── distro │ │ ├── py.typed │ │ ├── __main__.py │ │ └── __init__.py │ ├── idna │ │ ├── py.typed │ │ ├── package_data.py │ │ ├── compat.py │ │ └── __init__.py │ ├── rich │ │ ├── py.typed │ │ ├── themes.py │ │ ├── region.py │ │ ├── _extension.py │ │ ├── _stack.py │ │ ├── _pick.py │ │ ├── _timer.py │ │ ├── errors.py │ │ ├── _fileno.py │ │ ├── pager.py │ │ ├── abc.py │ │ ├── LICENSE │ │ ├── diagnose.py │ │ ├── _emoji_replace.py │ │ └── color_triplet.py │ ├── cachecontrol │ │ ├── py.typed │ │ ├── caches │ │ │ └── __init__.py │ │ ├── LICENSE.txt │ │ └── __init__.py │ ├── packaging │ │ ├── py.typed │ │ ├── LICENSE │ │ └── __init__.py │ ├── platformdirs │ │ ├── py.typed │ │ ├── version.py │ │ └── LICENSE │ ├── resolvelib │ │ ├── py.typed │ │ ├── __init__.py │ │ ├── resolvers │ │ │ └── __init__.py │ │ └── LICENSE │ ├── truststore │ │ ├── py.typed │ │ ├── LICENSE │ │ └── _ssl_constants.py │ ├── dependency_groups │ │ ├── py.typed │ │ ├── __init__.py │ │ ├── _toml_compat.py │ │ └── LICENSE.txt │ ├── pyproject_hooks │ │ ├── py.typed │ │ ├── _in_process │ │ │ └── __init__.py │ │ ├── __init__.py │ │ └── LICENSE │ ├── urllib3 │ │ ├── contrib │ │ │ ├── __init__.py │ │ │ ├── _securetransport │ │ │ │ └── __init__.py │ │ │ └── _appengine_environ.py │ │ ├── packages │ │ │ ├── __init__.py │ │ │ └── backports │ │ │ │ └── __init__.py │ │ ├── _version.py │ │ ├── util │ │ │ ├── queue.py │ │ │ └── __init__.py │ │ └── LICENSE.txt │ ├── distlib.pyi │ ├── msgpack.pyi │ ├── urllib3.pyi │ ├── pygments.pyi │ ├── requests.pyi │ ├── pkg_resources.pyi │ ├── tomli │ │ ├── py.typed │ │ ├── _types.py │ │ ├── __init__.py │ │ └── LICENSE │ ├── tomli_w │ │ ├── py.typed │ │ ├── __init__.py │ │ └── LICENSE │ ├── distlib │ │ ├── t32.exe │ │ ├── t64.exe │ │ ├── w32.exe │ │ ├── w64.exe │ │ ├── t64-arm.exe │ │ ├── w64-arm.exe │ │ └── __init__.py │ ├── vendor.txt │ ├── pygments │ │ ├── __main__.py │ │ └── modeline.py │ ├── requests │ │ ├── __version__.py │ │ ├── certs.py │ │ ├── hooks.py │ │ └── packages.py │ ├── msgpack │ │ ├── COPYING │ │ ├── exceptions.py │ │ └── __init__.py │ └── pkg_resources │ │ └── LICENSE │ ├── _internal │ ├── utils │ │ ├── __init__.py │ │ ├── datetime.py │ │ ├── filetypes.py │ │ └── _log.py │ ├── operations │ │ ├── __init__.py │ │ ├── build │ │ │ ├── __init__.py │ │ │ └── wheel.py │ │ └── install │ │ │ └── __init__.py │ ├── resolution │ │ ├── __init__.py │ │ ├── legacy │ │ │ └── __init__.py │ │ ├── resolvelib │ │ │ └── __init__.py │ │ └── base.py │ ├── index │ │ └── __init__.py │ ├── network │ │ └── __init__.py │ ├── models │ │ ├── __init__.py │ │ ├── scheme.py │ │ ├── candidate.py │ │ └── index.py │ ├── cli │ │ ├── __init__.py │ │ ├── status_codes.py │ │ └── command_context.py │ ├── metadata │ │ └── importlib │ │ │ └── __init__.py │ ├── main.py │ ├── __init__.py │ ├── vcs │ │ └── __init__.py │ ├── distributions │ │ ├── __init__.py │ │ └── installed.py │ └── commands │ │ └── help.py │ ├── py.typed │ ├── __init__.py │ └── __main__.py ├── docs ├── html │ ├── development │ │ ├── vendoring-policy.rst │ │ ├── architecture │ │ │ └── index.rst │ │ └── index.rst │ ├── topics │ │ ├── deps.png │ │ ├── deps.dot │ │ ├── index.md │ │ └── python-option.md │ ├── copyright.rst │ ├── reference │ │ ├── pip.rst │ │ ├── pip_hash.rst │ │ ├── pip_list.rst │ │ ├── pip_show.rst │ │ ├── pip_cache.rst │ │ ├── pip_check.rst │ │ ├── pip_debug.rst │ │ ├── pip_index.rst │ │ ├── pip_wheel.rst │ │ ├── pip_config.rst │ │ ├── pip_freeze.rst │ │ ├── pip_install.rst │ │ ├── pip_search.rst │ │ ├── pip_download.rst │ │ ├── pip_uninstall.rst │ │ └── index.md │ ├── installing.rst │ ├── news.rst │ ├── quickstart.rst │ ├── cli │ │ ├── pip_cache.rst │ │ ├── pip_config.rst │ │ ├── pip_inspect.rst │ │ ├── pip_debug.rst │ │ ├── pip_lock.rst │ │ ├── index.md │ │ ├── pip_index.rst │ │ └── pip_uninstall.rst │ └── ux-research-design │ │ └── index.md └── man │ ├── commands │ ├── hash.rst │ ├── help.rst │ ├── list.rst │ ├── lock.rst │ ├── show.rst │ ├── cache.rst │ ├── check.rst │ ├── wheel.rst │ ├── config.rst │ ├── freeze.rst │ ├── index.rst │ ├── search.rst │ ├── install.rst │ ├── download.rst │ ├── uninstall.rst │ └── debug.rst │ └── index.rst ├── .gitattributes ├── .readthedocs.yml ├── .github ├── dependabot.yml ├── chronographer.yml ├── ISSUE_TEMPLATE │ └── config.yml ├── workflows │ ├── lock-threads.yml │ └── update-rtd-redirects.yml ├── CONTRIBUTING.md ├── PULL_REQUEST_TEMPLATE.md └── FUNDING.yml ├── SECURITY.md ├── .gitignore ├── .readthedocs-custom-redirects.yml └── LICENSE.txt /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/13633.trivial.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/13652.trivial.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/functional/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | -------------------------------------------------------------------------------- /src/pip/_vendor/certifi/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/distro/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/idna/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/invalid.whl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/cachecontrol/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/packaging/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/platformdirs/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/resolvelib/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/truststore/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/completion_paths/README.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/gmpy-1.15.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/gmpy2-2.0.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/symlinks/doc/intro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/extension/extension.c: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518-3.0/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/operations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/resolution/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/dependency_groups/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/pyproject_hooks/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/duplicate-1.0.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/pkgwithmpkg-1.0.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/priority-1.0.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages2/duplicate-1.0.tar.gz: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-1.0/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-2.0/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/operations/build/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/resolution/legacy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/distlib.pyi: -------------------------------------------------------------------------------- 1 | from distlib import * -------------------------------------------------------------------------------- /src/pip/_vendor/msgpack.pyi: -------------------------------------------------------------------------------- 1 | from msgpack import * -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3.pyi: -------------------------------------------------------------------------------- 1 | from urllib3 import * -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/completion_paths/REPLAY/video.mpeg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/completion_paths/requirements.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/indexes/empty_with_pkg/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/BrokenEmitsUTF8/broken.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/symlinks/docs: -------------------------------------------------------------------------------- 1 | IntxLNKdoc -------------------------------------------------------------------------------- /tests/data/src/pep518-3.0/pep518.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_forkbomb-235/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/resolution_resolvelib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /news/8b0d3f48-311e-4f2c-a59b-b4487ece496c.trivial.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/resolution/resolvelib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/pygments.pyi: -------------------------------------------------------------------------------- 1 | from pygments import * -------------------------------------------------------------------------------- /src/pip/_vendor/requests.pyi: -------------------------------------------------------------------------------- 1 | from requests import * -------------------------------------------------------------------------------- /tests/data/completion_paths/resources/images/icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/FSPkg/fspkg/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /tests/data/packages/priority-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires/toporequires/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_forkbomb-235/pep518_forkbomb.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_missing_requires/pyproject.toml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/packages/backports/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras/localextras/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/symlinks/symlinks/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires2/toporequires2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires3/toporequires3/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires4/toporequires4/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_first-234/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_second-238/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_extra_and_markers-1.0/setup.cfg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_vendor/idna/package_data.py: -------------------------------------------------------------------------------- 1 | __version__ = "3.10" 2 | -------------------------------------------------------------------------------- /src/pip/_vendor/pkg_resources.pyi: -------------------------------------------------------------------------------- 1 | from pkg_resources import * -------------------------------------------------------------------------------- /src/pip/_vendor/tomli/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561 2 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli_w/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561 2 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/contrib/_securetransport/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras-0.0.2/localextras/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/pkgwithmpkg-1.0-py2.7-macosx10.7.mpkg.zip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_requires/pep518.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_missing_requires/pep518.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/prjwithdatafile/prjwithdatafile/somemodule.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/requires_simple_extra/requires_simple_extra.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/simple_namespace/simple_namespace/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pip/_internal/index/__init__.py: -------------------------------------------------------------------------------- 1 | """Index interaction code""" 2 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras/.gitignore: -------------------------------------------------------------------------------- 1 | /LocalExtras.egg-info 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518-3.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_conflicting_requires/pep518.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_build_system/pep518.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/requires_simple/requires_simple/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /tests/data/src/simple_namespace/simple_namespace/module/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/LocalEnvironMarker/localenvironmarker/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/symlinks/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = dev 3 | -------------------------------------------------------------------------------- /tests/data/src/pep518_forkbomb-235/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /news/13559.trivial.rst: -------------------------------------------------------------------------------- 1 | Add privacy notice to documentation index page. 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_requires/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_missing_requires/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_first-234/pep518_twin_forkbombs_first.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/requires_simple_extra/setup.cfg: -------------------------------------------------------------------------------- 1 | [wheel] 2 | universal=1 3 | -------------------------------------------------------------------------------- /tests/data/src/simple_namespace/setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal=1 3 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-1.0/simplewheel/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.0" 2 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-2.0/simplewheel/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "2.0" 2 | -------------------------------------------------------------------------------- /news/6823.bugfix.rst: -------------------------------------------------------------------------------- 1 | Better preserve original casing when a path is displayed. 2 | -------------------------------------------------------------------------------- /tests/data/packages/LocalEnvironMarker/.gitignore: -------------------------------------------------------------------------------- 1 | /LocalEnvironMarker.egg-info 2 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras-0.0.2/.gitignore: -------------------------------------------------------------------------------- 1 | /LocalExtras-0.0.2.egg-info 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_conflicting_requires/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_build_system/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_second-238/pep518_twin_forkbombs_second.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_namespace_package-1.0/pep518_with_namespace_package.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/packages/requires_wheelbroken_upper/requires_wheelbroken_upper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/data/src/compilewheel/simple/__init__.py: -------------------------------------------------------------------------------- 1 | def spam(gen): 2 | yield from gen 3 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_first-234/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_second-238/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_extra_and_markers-1.0/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include pyproject.toml 2 | -------------------------------------------------------------------------------- /news/13682.bugfix.rst: -------------------------------------------------------------------------------- 1 | Fix "pip index versions" to honor only-binary/no-binary options 2 | -------------------------------------------------------------------------------- /src/pip/_internal/network/__init__.py: -------------------------------------------------------------------------------- 1 | """Contains purely network-related utilities.""" 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_extra_and_markers-1.0/pep518_with_extra_and_markers.py: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_namespace_package-1.0/setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | universal=1 3 | -------------------------------------------------------------------------------- /docs/html/development/vendoring-policy.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../../src/pip/_vendor/README.rst 2 | -------------------------------------------------------------------------------- /docs/html/topics/deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/docs/html/topics/deps.png -------------------------------------------------------------------------------- /tests/data/packages/LineEndings/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /src/pip/_internal/models/__init__.py: -------------------------------------------------------------------------------- 1 | """A package that contains models that represent entities.""" 2 | -------------------------------------------------------------------------------- /src/pip/_internal/operations/install/__init__.py: -------------------------------------------------------------------------------- 1 | """For modules related to installing packages.""" 2 | -------------------------------------------------------------------------------- /tests/data/packages/pep517_wrapper_buildsys/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /tests/data/src/pep517_setup_cfg_only/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = "dummy" 3 | version = "0.1" 4 | -------------------------------------------------------------------------------- /news/13555.bugfix.rst: -------------------------------------------------------------------------------- 1 | Fix bash completion when the ``$IFS`` variable has been modified from its default. 2 | -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/_version.py: -------------------------------------------------------------------------------- 1 | # This file is protected via CODEOWNERS 2 | __version__ = "1.26.20" 3 | -------------------------------------------------------------------------------- /tests/data/packages/pep517_setup_and_pyproject/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /tests/data/packages/test_tar.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/test_tar.tgz -------------------------------------------------------------------------------- /tests/data/packages/test_zip.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/test_zip.zip -------------------------------------------------------------------------------- /news/13656.bugfix.rst: -------------------------------------------------------------------------------- 1 | Precompute Python Requirements on each candidate, reducing time of long resolutions. 2 | -------------------------------------------------------------------------------- /tests/data/src/prjwithdatafile/prjwithdatafile/README.txt: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | Test project file 5 | -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/t64-arm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/t64-arm.exe -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/w64-arm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/src/pip/_vendor/distlib/w64-arm.exe -------------------------------------------------------------------------------- /src/pip/_vendor/distro/__main__.py: -------------------------------------------------------------------------------- 1 | from .distro import main 2 | 3 | if __name__ == "__main__": 4 | main() 5 | -------------------------------------------------------------------------------- /tests/data/packages/Upper-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/Upper-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/Upper-2.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/Upper-2.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/broken-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/broken-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/child-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/child-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/parent-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/parent-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/pep518-3.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pep518-3.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/simple-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/simple-2.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple-2.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/simple-3.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple-3.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/source-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/source-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/src/pep517_setup_only/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name="dummy", version="0.1") 4 | -------------------------------------------------------------------------------- /tests/data/src/pep518-3.0/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires=["simplewheel==2.0", "setuptools", "wheel"] 3 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_build_system/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | # This table is intentionally empty. 3 | -------------------------------------------------------------------------------- /tests/data/packages/INITools-0.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/INITools-0.2.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/corruptwheel-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- 1 | This is a corrupt wheel which _clearly_ is not a zip file. 2 | -------------------------------------------------------------------------------- /tests/data/packages/pep517_wrapper_buildsys/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = pep517-wrapper-buildsys 3 | version = 1.0 4 | -------------------------------------------------------------------------------- /tests/data/packages/simple2-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple2-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/simple2-2.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple2-2.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/simple2-3.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple2-3.0.tar.gz -------------------------------------------------------------------------------- /tests/data/src/pep517_pyproject_only/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["foo"] 3 | build-backend = "foo" 4 | -------------------------------------------------------------------------------- /tests/data/src/pep518_conflicting_requires/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools==1.0", "wheel"] 3 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_requires/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [1, 2, 3] # not a list of strings 3 | -------------------------------------------------------------------------------- /tests/data/packages/SetupPyLatin1/setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/SetupPyLatin1/setup.py -------------------------------------------------------------------------------- /tests/data/packages/argparse-1.2.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/argparse-1.2.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/distribute-0.7.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/distribute-0.7.3.zip -------------------------------------------------------------------------------- /tests/data/packages/pep517_setup_and_pyproject/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = pep517-setup-and-pyproject 3 | version = 1.0 4 | -------------------------------------------------------------------------------- /tests/data/packages/virtualenv-1.10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/virtualenv-1.10.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/wheelbroken-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/wheelbroken-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/src/TopoRequires2/setup.cfg.pending: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = TopoRequires2 3 | install-requires = 4 | TopoRequires 5 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires3/setup.cfg.pending: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = TopoRequires3 3 | install-requires = 4 | TopoRequires 5 | -------------------------------------------------------------------------------- /tests/data/src/pep517_setup_and_pyproject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["foo"] 3 | build-backend = "foo" 4 | -------------------------------------------------------------------------------- /tests/data/src/pep517_setup_and_pyproject/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name="dummy", version="0.1") 4 | -------------------------------------------------------------------------------- /tests/data/src/pep518_forkbomb-235/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel", "pep518_forkbomb"] 3 | -------------------------------------------------------------------------------- /tests/data/src/withpyproject/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name="withpyproject", version="0.0.1") 4 | -------------------------------------------------------------------------------- /tests/data/backends/test_backend-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/backends/test_backend-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/broken-0.2+broken.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/broken-0.2+broken.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/brokenegginfo-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/brokenegginfo-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/requiresupper-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/requiresupper-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/setuptools-0.9.6.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/setuptools-0.9.6.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/virtualenv-1.9.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/virtualenv-1.9.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/TopoRequires-0.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/TopoRequires-0.0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/TopoRequires2-0.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/TopoRequires2-0.0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/TopoRequires3-0.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/TopoRequires3-0.0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/TopoRequires4-0.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/TopoRequires4-0.0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/mypy-0.782-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/mypy-0.782-py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/pep518_forkbomb-235.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pep518_forkbomb-235.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/pip_test_package-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pip_test_package-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/require_simple-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/require_simple-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/singlemodule-0.0.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/singlemodule-0.0.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/singlemodule-0.0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/singlemodule-0.0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/singlemodule-0.0.1.tar.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/singlemodule-0.0.1.tar.lzma -------------------------------------------------------------------------------- /tests/data/packages/singlemodule-0.0.1.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/singlemodule-0.0.1.tar.xz -------------------------------------------------------------------------------- /tests/data/packages/wheelbrokenafter-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/wheelbrokenafter-0.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages3/dinner/Dinner-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages3/dinner/Dinner-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages3/dinner/Dinner-2.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages3/dinner/Dinner-2.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/meta-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/meta-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/pip_test_package-0.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pip_test_package-0.1.1.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/translationstring-1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/translationstring-1.1.tar.gz -------------------------------------------------------------------------------- /src/pip/_vendor/certifi/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import contents, where 2 | 3 | __all__ = ["contents", "where"] 4 | __version__ = "2025.10.05" 5 | -------------------------------------------------------------------------------- /tests/data/indexes/empty_with_pkg/simple-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/indexes/empty_with_pkg/simple-1.0.tar.gz -------------------------------------------------------------------------------- /news/12891.feature.rst: -------------------------------------------------------------------------------- 1 | Support installing dependencies declared with inline script metadata 2 | (:pep:`723`) with ``--requirements-from-script``. 3 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/themes.py: -------------------------------------------------------------------------------- 1 | from .default_styles import DEFAULT_STYLES 2 | from .theme import Theme 3 | 4 | 5 | DEFAULT = Theme(DEFAULT_STYLES) 6 | -------------------------------------------------------------------------------- /tests/data/packages/require_invalid_version-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/require_invalid_version-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_first-234/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel", "pep518_twin_forkbombs_second"] 3 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_second-238/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel", "pep518_twin_forkbombs_first"] 3 | -------------------------------------------------------------------------------- /tests/data/src/withpyproject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | 4 | # Note: pyproject.toml is always UTF-8 🤡 5 | -------------------------------------------------------------------------------- /tests/data/backends/test_backend-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/backends/test_backend-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/brokenwheel-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/brokenwheel-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/colander-0.9.9-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/colander-0.9.9-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/compilewheel-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/compilewheel-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/complex_dist-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/complex_dist-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/has.script-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/has.script-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/invalid_version-1.0-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/invalid_version-1.0-py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/license.dist-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/license.dist-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/license.dist-0.2-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/license.dist-0.2-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/pep517_setup_and_pyproject/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ "setuptools" ] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /tests/data/packages/requiresPaste/requiresPaste.py: -------------------------------------------------------------------------------- 1 | """Module requiring Paste to test dependencies download of pip wheel.""" 2 | 3 | __version__ = "3.1.4" 4 | -------------------------------------------------------------------------------- /tests/data/packages/setuptools-0.9.8-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/setuptools-0.9.8-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simple.dist-0.1-py1-none-invalid.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple.dist-0.1-py1-none-invalid.whl -------------------------------------------------------------------------------- /tests/data/packages/simple.dist-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple.dist-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simplewheel-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simplewheel-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simplewheel-2.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simplewheel-2.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/backends/dummy_backend-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/backends/dummy_backend-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/indexes/in dex/README.txt: -------------------------------------------------------------------------------- 1 | This directory has the odd space in its name in order to test urlquoting and 2 | dequoting of file:// scheme index URLs. 3 | -------------------------------------------------------------------------------- /tests/data/packages/SetupPyUTF8/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="SetupPyUTF8", 5 | author="Saúl Ibarra Corretgé", 6 | ) 7 | -------------------------------------------------------------------------------- /tests/data/packages/invalid_version-2010i-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/invalid_version-2010i-py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/pep518_twin_forkbombs_first-234.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pep518_twin_forkbombs_first-234.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/pep518_twin_forkbombs_second-238.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pep518_twin_forkbombs_second-238.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/script.wheel1-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/script.wheel1-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/script.wheel1a-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/script.wheel1a-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/script.wheel2-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/script.wheel2-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/script.wheel2a-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/script.wheel2a-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/script.wheel3-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/script.wheel3-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simplewheel-2.0-1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simplewheel-2.0-1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages3/requiredinner/requiredinner-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages3/requiredinner/requiredinner-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/src/pep518_forkbomb-235/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name="pep518_forkbomb", version="235", py_modules=["pep518_forkbomb"]) 4 | -------------------------------------------------------------------------------- /tests/data/packages/pep518_with_extra_and_markers-1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/pep518_with_extra_and_markers-1.0.tar.gz -------------------------------------------------------------------------------- /tests/data/packages/prjwithdatafile-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/prjwithdatafile-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/requires_source-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/requires_source-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simple_namespace-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simple_namespace-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/simplewheel-2.0-py3-fakeabi-fakeplat.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/simplewheel-2.0-py3-fakeabi-fakeplat.whl -------------------------------------------------------------------------------- /tests/data/src/TopoRequires4/setup.cfg.pending: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = TopoRequires4 3 | install-requires = 4 | TopoRequires2 5 | TopoRequires 6 | TopoRequires3 7 | -------------------------------------------------------------------------------- /tests/data/src/chattymodule/chattymodule.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | """Entry point for the application script""" 3 | print("Call your main application code here") 4 | -------------------------------------------------------------------------------- /tests/data/src/singlemodule/singlemodule.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | """Entry point for the application script""" 3 | print("Call your main application code here") 4 | -------------------------------------------------------------------------------- /news/13660.feature.rst: -------------------------------------------------------------------------------- 1 | When using the ``importlib.metadata`` backend, pip skips redundant work 2 | converting version objects to strings and back to version objects. 3 | -------------------------------------------------------------------------------- /tests/data/packages/require_invalid_version-0.1-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/require_invalid_version-0.1-py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/packages/require_invalid_version-1.0-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/require_invalid_version-1.0-py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/src/pep518_with_namespace_package-1.0/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools", 4 | "wheel", 5 | "simple_namespace", 6 | ] 7 | -------------------------------------------------------------------------------- /tests/data/src/requires_capitalized/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(name="Requires_Capitalized", version="0.1", install_requires=["simple==1.0"]) 4 | -------------------------------------------------------------------------------- /src/pip/_internal/cli/__init__.py: -------------------------------------------------------------------------------- 1 | """Subpackage containing all of pip's command line interface related code""" 2 | 3 | # This file intentionally does not import submodules 4 | -------------------------------------------------------------------------------- /src/pip/_internal/cli/status_codes.py: -------------------------------------------------------------------------------- 1 | SUCCESS = 0 2 | ERROR = 1 3 | UNKNOWN_ERROR = 2 4 | VIRTUALENV_NOT_FOUND = 3 5 | PREVIOUS_BUILD_DIR_ERROR = 4 6 | NO_MATCHES_FOUND = 23 7 | -------------------------------------------------------------------------------- /tests/data/packages/requires_simple_extra-0.1-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/requires_simple_extra-0.1-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/src/requires_simple/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | setup(name="requires_simple", version="0.1", install_requires=["simple==1.0"]) 4 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="TopoRequires", 5 | version="0.0.1", 6 | packages=["toporequires"], 7 | ) 8 | -------------------------------------------------------------------------------- /tests/data/packages/console_scripts_uppercase-1.0-py2.py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pypa/pip/HEAD/tests/data/packages/console_scripts_uppercase-1.0-py2.py3-none-any.whl -------------------------------------------------------------------------------- /tests/data/src/compilewheel/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import find_packages, setup 3 | 4 | setup(name="compilewheel", version="1.0", packages=find_packages()) 5 | -------------------------------------------------------------------------------- /tests/data/packages/pep517_wrapper_buildsys/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ "setuptools" ] 3 | build-backend = "mybuildsys" # setuptools.build_meta 4 | backend-path = ["."] 5 | -------------------------------------------------------------------------------- /src/pip/_internal/metadata/importlib/__init__.py: -------------------------------------------------------------------------------- 1 | from ._dists import Distribution 2 | from ._envs import Environment 3 | 4 | __all__ = ["NAME", "Distribution", "Environment"] 5 | 6 | NAME = "importlib" 7 | -------------------------------------------------------------------------------- /tests/data/packages/symlinks/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | version = "0.1" 4 | 5 | setup( 6 | name="symlinks", 7 | version=version, 8 | packages=["symlinks"], 9 | ) 10 | -------------------------------------------------------------------------------- /tests/data/src/extension/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import Extension, setup 2 | 3 | module = Extension("extension", sources=["extension.c"]) 4 | setup(name="extension", version="0.0.1", ext_modules=[module]) 5 | -------------------------------------------------------------------------------- /tests/data/reqfiles/supported_options2.txt: -------------------------------------------------------------------------------- 1 | # default is no constraints 2 | # We're not testing the format control logic here, just that the options are 3 | # accepted 4 | --no-binary fred 5 | --only-binary wilma 6 | -------------------------------------------------------------------------------- /tools/codespell-ignore.txt: -------------------------------------------------------------------------------- 1 | # An actual English word 2 | lousily 3 | followings 4 | # A contributor first name 5 | wil 6 | Whit 7 | # Codebase variable or class names 8 | uptodate 9 | afile 10 | failer 11 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli_w/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = ("dumps", "dump") 2 | __version__ = "1.2.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 3 | 4 | from pip._vendor.tomli_w._writer import dump, dumps 5 | -------------------------------------------------------------------------------- /tests/data/indexes/dev/bar/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bar-1.0.tar.gz 5 | bar-2.0.dev1.tar.gz 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/data/indexes/in dex/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | simple-1.0.tar.gz 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/data/indexes/simple/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | simple-1.0.tar.gz 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/data/packages/requires_wheelbroken_upper/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | name="requires_wheelbroken_upper", 5 | version="0", 6 | install_requires=["wheelbroken", "upper"], 7 | ) 8 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires2/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="TopoRequires2", 5 | version="0.0.1", 6 | packages=["toporequires2"], 7 | install_requires=["TopoRequires"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires3/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="TopoRequires3", 5 | version="0.0.1", 6 | packages=["toporequires3"], 7 | install_requires=["TopoRequires"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_requires/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | setup( 5 | name="pep518_invalid_requires", 6 | version="1.0.0", 7 | py_modules=["pep518"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_missing_requires/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | setup( 5 | name="pep518_missing_requires", 6 | version="1.0.0", 7 | py_modules=["pep518"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_conflicting_requires/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | setup( 5 | name="pep518_conflicting_requires", 6 | version="1.0.0", 7 | py_modules=["pep518"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_invalid_build_system/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | setup( 5 | name="pep518_invalid_build_system", 6 | version="1.0.0", 7 | py_modules=["pep518"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_first-234/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="pep518_twin_forkbombs_first", 5 | version="234", 6 | py_modules=["pep518_twin_forkbombs_first"], 7 | ) 8 | -------------------------------------------------------------------------------- /tests/data/src/pep518_twin_forkbombs_second-238/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="pep518_twin_forkbombs_second", 5 | version="238", 6 | py_modules=["pep518_twin_forkbombs_second"], 7 | ) 8 | -------------------------------------------------------------------------------- /tests/data/src/requires_requires_capitalized/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="requires_requires_capitalized", 5 | version="1.0", 6 | install_requires=["requires_Capitalized==0.1"], 7 | ) 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Patches must have Unix-style line endings, even on Windows 2 | tools/vendoring/patches/* eol=lf 3 | # The CA Bundle should always use Unix-style line endings, even on Windows 4 | src/pip/_vendor/certifi/*.pem eol=lf 5 | -------------------------------------------------------------------------------- /src/pip/_vendor/packaging/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /tests/data/reqfiles/README.txt: -------------------------------------------------------------------------------- 1 | supported_options.txt 2 | --------------------- 3 | 4 | Contains --no-use-wheel. 5 | 6 | supported_options2.txt 7 | ---------------------- 8 | 9 | Contains --no-binary and --only-binary options. 10 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/region.py: -------------------------------------------------------------------------------- 1 | from typing import NamedTuple 2 | 3 | 4 | class Region(NamedTuple): 5 | """Defines a rectangular region of the screen.""" 6 | 7 | x: int 8 | y: int 9 | width: int 10 | height: int 11 | -------------------------------------------------------------------------------- /tests/data/src/simple_namespace/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="simple_namespace", 5 | version="1.0", 6 | namespace_packages=["simple_namespace"], 7 | packages=["simple_namespace.module"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/singlemodule/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="singlemodule", 5 | version="0.0.1", 6 | description="A sample Python project with a single module", 7 | py_modules=["singlemodule"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/indexes/require-invalid-version/invalid-version/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | invalid_version-2010i-py3-none-any.whl 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/data/src/requires_simple_extra/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="requires_simple_extra", 5 | version="0.1", 6 | py_modules=["requires_simple_extra"], 7 | extras_require={"extra": ["simple==1.0"]}, 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/TopoRequires4/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="TopoRequires4", 5 | version="0.0.1", 6 | packages=["toporequires4"], 7 | install_requires=["TopoRequires2", "TopoRequires", "TopoRequires3"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-1.0/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | import simplewheel 5 | 6 | setup( 7 | name="simplewheel", 8 | version=simplewheel.__version__, 9 | packages=["simplewheel"], 10 | ) 11 | -------------------------------------------------------------------------------- /tests/data/src/simplewheel-2.0/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | import simplewheel 5 | 6 | setup( 7 | name="simplewheel", 8 | version=simplewheel.__version__, 9 | packages=["simplewheel"], 10 | ) 11 | -------------------------------------------------------------------------------- /tests/data/src/pep518-3.0/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | import simplewheel # ensure dependency is installed 5 | 6 | setup( 7 | name="pep518", 8 | version="3.0", 9 | py_modules=["pep518"], 10 | ) 11 | -------------------------------------------------------------------------------- /tests/data/indexes/pre/bar/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bar-1.0.tar.gz 5 | bar-1.0b1.tar.gz 6 | bar-2.0.dev1.tar.gz 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/copyright.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========= 4 | Copyright 5 | ========= 6 | 7 | pip and this documentation is: 8 | 9 | Copyright © 2008-2020 The pip developers (see `AUTHORS.txt `_ file). All rights reserved. 10 | -------------------------------------------------------------------------------- /tests/data/src/chattymodule/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "backend" 4 | backend-path = ["."] 5 | 6 | [project] 7 | name = "chattymodule" 8 | version = "0.0.1" 9 | 10 | [tool.setuptools] 11 | py-modules = ["chattymodule"] 12 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_extra_and_markers-1.0/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "requires_simple_extra[extra]", 4 | "simplewheel==1.0; python_version < '3'", 5 | "simplewheel==2.0; python_version >= '3'", 6 | "setuptools", 7 | "wheel", 8 | ] 9 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_namespace_package-1.0/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | import simple_namespace.module 4 | 5 | setup( 6 | name="pep518_with_namespace_package", 7 | version="1.0", 8 | py_modules=["pep518_with_namespace_package"], 9 | ) 10 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-22.04 5 | tools: 6 | python: "3.11" 7 | jobs: 8 | install: 9 | - pip install . 10 | - pip install --group docs 11 | 12 | sphinx: 13 | builder: dirhtml 14 | configuration: docs/html/conf.py 15 | -------------------------------------------------------------------------------- /docs/html/reference/pip.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip` 12 | -------------------------------------------------------------------------------- /docs/html/installing.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../installation/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`installation` 12 | -------------------------------------------------------------------------------- /docs/html/news.rst: -------------------------------------------------------------------------------- 1 | ========= 2 | Changelog 3 | ========= 4 | 5 | .. attention:: 6 | 7 | Major and minor releases of pip also include changes listed within 8 | prior beta releases. 9 | 10 | .. towncrier-draft-entries:: Not yet released 11 | 12 | .. pip-news-include:: ../../NEWS.rst 13 | -------------------------------------------------------------------------------- /docs/html/quickstart.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../getting-started/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`getting-started` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_hash.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_hash/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_hash` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_list.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_list/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_list` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_show.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_show/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_show` 12 | -------------------------------------------------------------------------------- /tests/data/src/compilewheel/setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | # This flag says that the code is written to work on both Python 2 and Python 3 | # 3. If at all possible, it is good practice to do this. If you cannot, you 4 | # will need to generate wheels for each Python version that you support. 5 | universal=1 6 | -------------------------------------------------------------------------------- /tests/data/src/singlemodule/setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_wheel] 2 | # This flag says that the code is written to work on both Python 2 and Python 3 | # 3. If at all possible, it is good practice to do this. If you cannot, you 4 | # will need to generate wheels for each Python version that you support. 5 | universal=1 6 | -------------------------------------------------------------------------------- /docs/html/reference/pip_cache.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_cache/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_cache` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_check.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_check/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_check` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_debug.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_debug/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_debug` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_index.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_index/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_index` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_wheel.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_wheel/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_wheel` 12 | -------------------------------------------------------------------------------- /docs/man/commands/hash.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | pip-hash 5 | ======== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: hash 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: hash 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: hash 21 | -------------------------------------------------------------------------------- /docs/man/commands/help.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | pip-help 5 | ======== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: help 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: help 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: help 21 | -------------------------------------------------------------------------------- /docs/man/commands/list.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | pip-list 5 | ======== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: list 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: list 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: list 21 | -------------------------------------------------------------------------------- /docs/man/commands/lock.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | pip-lock 5 | ======== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: lock 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: lock 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: lock 21 | -------------------------------------------------------------------------------- /docs/man/commands/show.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | pip-show 5 | ======== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: show 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: show 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: show 21 | -------------------------------------------------------------------------------- /src/pip/py.typed: -------------------------------------------------------------------------------- 1 | pip is a command line program. While it is implemented in Python, and so is 2 | available for import, you must not use pip's internal APIs in this way. Typing 3 | information is provided as a convenience only and is not a guarantee. Expect 4 | unannounced changes to the API and types in releases. 5 | -------------------------------------------------------------------------------- /docs/html/reference/pip_config.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_config/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_config` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_freeze.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_freeze/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_freeze` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_install.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_install/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_install` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_search.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_search/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_search` 12 | -------------------------------------------------------------------------------- /docs/man/commands/cache.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========= 4 | pip-cache 5 | ========= 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: cache 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: cache 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: cache 21 | -------------------------------------------------------------------------------- /docs/man/commands/check.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========= 4 | pip-check 5 | ========= 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: check 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: check 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: check 21 | -------------------------------------------------------------------------------- /docs/man/commands/wheel.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========= 4 | pip-wheel 5 | ========= 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: wheel 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: wheel 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: wheel 21 | -------------------------------------------------------------------------------- /tests/data/packages/requiresPaste/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ['flit_core >=2,<4'] 3 | build-backend = 'flit_core.buildapi' 4 | 5 | [tool.flit.metadata] 6 | module = 'requiresPaste' 7 | author = 'A. Random Developer' 8 | author-email = 'author@example.com' 9 | requires = ['Paste==3.4.2'] 10 | -------------------------------------------------------------------------------- /docs/html/reference/pip_download.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_download/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_download` 12 | -------------------------------------------------------------------------------- /docs/html/reference/pip_uninstall.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | .. meta:: 4 | 5 | :http-equiv=refresh: 3; url=../../cli/pip_uninstall/ 6 | 7 | This page has moved 8 | =================== 9 | 10 | You should be redirected automatically in 3 seconds. If that didn't 11 | work, here's a link: :doc:`../cli/pip_uninstall` 12 | -------------------------------------------------------------------------------- /docs/man/commands/config.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========== 4 | pip-config 5 | ========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: config 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: config 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: config 21 | -------------------------------------------------------------------------------- /docs/man/commands/freeze.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========== 4 | pip-freeze 5 | ========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: freeze 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: freeze 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: freeze 21 | -------------------------------------------------------------------------------- /docs/man/commands/index.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | =========== 4 | pip-index 5 | =========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: index 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: index 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: index 21 | -------------------------------------------------------------------------------- /docs/man/commands/search.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========== 4 | pip-search 5 | ========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: search 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: search 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: search 21 | -------------------------------------------------------------------------------- /src/pip/_internal/utils/datetime.py: -------------------------------------------------------------------------------- 1 | """For when pip wants to check the date or time.""" 2 | 3 | import datetime 4 | 5 | 6 | def today_is_later_than(year: int, month: int, day: int) -> bool: 7 | today = datetime.date.today() 8 | given = datetime.date(year, month, day) 9 | 10 | return today > given 11 | -------------------------------------------------------------------------------- /tests/data/packages3/requiredinner/index.html: -------------------------------------------------------------------------------- 1 | 2 | PyPI Mirror 3 | 4 |

PyPI Mirror

5 |

For testing --index-url with a file:// url for the index

6 | requiredinner=1.0.tar.gz
7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/man/commands/install.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | =========== 4 | pip-install 5 | =========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: install 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: install 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: install 21 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli/_types.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | from typing import Any, Callable, Tuple 6 | 7 | # Type annotations 8 | ParseFloat = Callable[[str], Any] 9 | Key = Tuple[str, ...] 10 | Pos = int 11 | -------------------------------------------------------------------------------- /tests/data/indexes/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Details on Test Indexes 3 | ======================= 4 | 5 | empty_with_pkg 6 | -------------- 7 | empty index, but there's a package in the dir 8 | 9 | in dex 10 | ------ 11 | for testing url quoting with indexes 12 | 13 | simple 14 | ------ 15 | contains index page for "simple" pkg 16 | -------------------------------------------------------------------------------- /docs/man/commands/download.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ============ 4 | pip-download 5 | ============ 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: download 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: download 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: download 21 | -------------------------------------------------------------------------------- /tests/data/packages3/index.html: -------------------------------------------------------------------------------- 1 | 2 | PyPI Mirror 3 | 4 |

PyPI Mirror

5 |

For testing --index-url with a file:// url for the index

6 | requiredinner
7 | Dinner
8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/man/commands/uninstall.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ============= 4 | pip-uninstall 5 | ============= 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: uninstall 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: uninstall 16 | 17 | Options 18 | ******* 19 | 20 | .. pip-command-options:: uninstall 21 | -------------------------------------------------------------------------------- /src/pip/_vendor/certifi/__main__.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from pip._vendor.certifi import contents, where 4 | 5 | parser = argparse.ArgumentParser() 6 | parser.add_argument("-c", "--contents", action="store_true") 7 | args = parser.parse_args() 8 | 9 | if args.contents: 10 | print(contents()) 11 | else: 12 | print(where()) 13 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_extension.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | 4 | def load_ipython_extension(ip: Any) -> None: # pragma: no cover 5 | # prevent circular import 6 | from pip._vendor.rich.pretty import install 7 | from pip._vendor.rich.traceback import install as tr_install 8 | 9 | install() 10 | tr_install() 11 | -------------------------------------------------------------------------------- /tests/data/src/prjwithdatafile/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name="prjwithdatafile", 5 | version="1.0", 6 | packages=["prjwithdatafile"], 7 | data_files=[ 8 | (r"packages1", ["prjwithdatafile/README.txt"]), 9 | (r"packages2", ["prjwithdatafile/README.txt"]), 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /news/13407.bugfix.rst: -------------------------------------------------------------------------------- 1 | Revisions in version control URLs now must be percent-encoded. 2 | For example, use ``git+https://example.com/repo.git@issue%231`` to specify the branch ``issue#1``. 3 | If you previously used a branch name containing a ``%`` character in a version control URL, you now need to replace it with ``%25`` to ensure correct percent-encoding. 4 | -------------------------------------------------------------------------------- /src/pip/_vendor/dependency_groups/__init__.py: -------------------------------------------------------------------------------- 1 | from ._implementation import ( 2 | CyclicDependencyError, 3 | DependencyGroupInclude, 4 | DependencyGroupResolver, 5 | resolve, 6 | ) 7 | 8 | __all__ = ( 9 | "CyclicDependencyError", 10 | "DependencyGroupInclude", 11 | "DependencyGroupResolver", 12 | "resolve", 13 | ) 14 | -------------------------------------------------------------------------------- /tests/data/indexes/invalid-version/invalid-version/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | invalid_version-2010i-py3-none-any.whl 5 | invalid_version-1.0-py3-none-any.whl 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/html/reference/index.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | Reference provides information about various file formats, interfaces and 4 | interoperability standards that pip utilises/implements. 5 | 6 | ```{toctree} 7 | :titlesonly: 8 | 9 | build-system 10 | requirement-specifiers 11 | requirements-file-format 12 | installation-report 13 | inspect-report 14 | ``` 15 | -------------------------------------------------------------------------------- /tests/data/src/setup_error/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | # This is to get an error that originates from setuptools, which generates a 4 | # decently sized output. 5 | setup( 6 | cmdclass={ 7 | "egg_info": "", 8 | "install": "", 9 | "bdist_wheel": "", 10 | } 11 | ) 12 | -------------------------------------------------------------------------------- /tests/data/indexes/yanked/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | simple-1.0.tar.gz 5 | simple-2.0.tar.gz 6 | simple-3.0.tar.gz 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/data/packages3/dinner/index.html: -------------------------------------------------------------------------------- 1 | 2 | PyPI Mirror 3 | 4 |

PyPI Mirror

5 |

For testing --index-url with a file:// url for the index

6 | Dinner-1.0.tar.gz
7 | Dinner-2.0.tar.gz
8 | 9 | 10 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | groups: 8 | github-actions: 9 | patterns: 10 | - "*" 11 | - package-ecosystem: "pip" 12 | directory: "/build-project" 13 | schedule: 14 | interval: "weekly" 15 | -------------------------------------------------------------------------------- /src/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2015 Eric Larson 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | from pip._vendor.cachecontrol.caches.file_cache import FileCache, SeparateBodyFileCache 6 | from pip._vendor.cachecontrol.caches.redis_cache import RedisCache 7 | 8 | __all__ = ["FileCache", "SeparateBodyFileCache", "RedisCache"] 9 | -------------------------------------------------------------------------------- /src/pip/_vendor/dependency_groups/_toml_compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | import tomllib 3 | except ImportError: 4 | try: 5 | from pip._vendor import tomli as tomllib # type: ignore[no-redef, unused-ignore] 6 | except ModuleNotFoundError: # pragma: no cover 7 | tomllib = None # type: ignore[assignment, unused-ignore] 8 | 9 | __all__ = ("tomllib",) 10 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2021 Taneli Hukkinen 3 | # Licensed to PSF under a Contributor Agreement. 4 | 5 | __all__ = ("loads", "load", "TOMLDecodeError") 6 | __version__ = "2.3.0" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 7 | 8 | from ._parser import TOMLDecodeError, load, loads 9 | -------------------------------------------------------------------------------- /.github/chronographer.yml: -------------------------------------------------------------------------------- 1 | branch-protection-check-name: Changelog entry 2 | action-hints: 3 | check-title-prefix: "Chronographer: " 4 | external-docs-url: https://pip.pypa.io/dev/news-entry-failure 5 | inline-markdown: > 6 | See https://pip.pypa.io/dev/news-entry-failure for details. 7 | enforce-name: 8 | suffix: .rst 9 | labels: 10 | skip-changelog: skip news 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # Documentation for this file can be found at: 2 | # https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository 3 | 4 | blank_issues_enabled: true 5 | # contact_links: 6 | # - name: "(maintainers only) Blank issue" 7 | # url: https://github.com/pypa/pip/issues/new 8 | # about: For maintainers only. 9 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Please read the guidelines on reporting security issues [on the 6 | official website](https://www.python.org/dev/security/) for 7 | instructions on how to report a security-related problem to 8 | the Python Security Response Team responsibly. 9 | 10 | To reach the response team, email `security at python dot org`. 11 | -------------------------------------------------------------------------------- /tests/data/src/pep518_with_extra_and_markers-1.0/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | # ensure dependencies are installed 5 | import simple 6 | import simplewheel 7 | 8 | assert simplewheel.__version__ == "2.0" 9 | 10 | setup( 11 | name="pep518_with_extra_and_markers", 12 | version="1.0", 13 | py_modules=["pep518_with_extra_and_markers"], 14 | ) 15 | -------------------------------------------------------------------------------- /src/pip/_vendor/idna/compat.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Union 2 | 3 | from .core import decode, encode 4 | 5 | 6 | def ToASCII(label: str) -> bytes: 7 | return encode(label) 8 | 9 | 10 | def ToUnicode(label: Union[bytes, bytearray]) -> str: 11 | return decode(label) 12 | 13 | 14 | def nameprep(s: Any) -> None: 15 | raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol") 16 | -------------------------------------------------------------------------------- /tests/data/packages/HackedEggInfo/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from setuptools.command import egg_info as orig_egg_info 3 | 4 | 5 | class egg_info(orig_egg_info.egg_info): 6 | def run(self): 7 | orig_egg_info.egg_info.run(self) 8 | 9 | 10 | setup( 11 | name="hackedegginfo", 12 | version="0.0.0", 13 | cmdclass={"egg_info": egg_info}, 14 | zip_safe=False, 15 | ) 16 | -------------------------------------------------------------------------------- /src/pip/_internal/main.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | def main(args: list[str] | None = None) -> int: 5 | """This is preserved for old console scripts that may still be referencing 6 | it. 7 | 8 | For additional details, see https://github.com/pypa/pip/issues/7498. 9 | """ 10 | from pip._internal.utils.entrypoints import _wrapper 11 | 12 | return _wrapper(args) 13 | -------------------------------------------------------------------------------- /src/pip/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | __version__ = "26.0.dev0" 4 | 5 | 6 | def main(args: list[str] | None = None) -> int: 7 | """This is an internal API only meant for use by pip's own console scripts. 8 | 9 | For additional details, see https://github.com/pypa/pip/issues/7498. 10 | """ 11 | from pip._internal.utils.entrypoints import _wrapper 12 | 13 | return _wrapper(args) 14 | -------------------------------------------------------------------------------- /tests/data/indexes/yanked_all/simple/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | simple-1.0.tar.gz 5 | simple-2.0.tar.gz 6 | simple-3.0.tar.gz 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/cli/pip_cache.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _`pip cache`: 3 | 4 | pip cache 5 | --------- 6 | 7 | 8 | Usage 9 | ***** 10 | 11 | .. tab:: Unix/macOS 12 | 13 | .. pip-command-usage:: cache "python -m pip" 14 | 15 | .. tab:: Windows 16 | 17 | .. pip-command-usage:: cache "py -m pip" 18 | 19 | Description 20 | *********** 21 | 22 | .. pip-command-description:: cache 23 | 24 | Options 25 | ******* 26 | 27 | .. pip-command-options:: cache 28 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_stack.py: -------------------------------------------------------------------------------- 1 | from typing import List, TypeVar 2 | 3 | T = TypeVar("T") 4 | 5 | 6 | class Stack(List[T]): 7 | """A small shim over builtin list.""" 8 | 9 | @property 10 | def top(self) -> T: 11 | """Get top of stack.""" 12 | return self[-1] 13 | 14 | def push(self, item: T) -> None: 15 | """Push an item on to the stack (append in stack nomenclature).""" 16 | self.append(item) 17 | -------------------------------------------------------------------------------- /src/pip/_vendor/vendor.txt: -------------------------------------------------------------------------------- 1 | CacheControl==0.14.3 2 | distlib==0.4.0 3 | distro==1.9.0 4 | msgpack==1.1.2 5 | packaging==25.0 6 | platformdirs==4.5.0 7 | pyproject-hooks==1.2.0 8 | requests==2.32.5 9 | certifi==2025.10.5 10 | idna==3.10 11 | urllib3==1.26.20 12 | rich==14.2.0 13 | pygments==2.19.2 14 | resolvelib==1.2.1 15 | setuptools==70.3.0 16 | tomli==2.3.0 17 | tomli-w==1.2.0 18 | truststore==0.10.4 19 | dependency-groups==1.3.1 20 | -------------------------------------------------------------------------------- /docs/html/topics/deps.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [fontname = "Handlee"]; 3 | node [fontname = "Handlee"]; 4 | edge [fontname = "Handlee"]; 5 | 6 | bgcolor=transparent; 7 | 8 | A [color=blue fontcolor=blue]; 9 | A -> B [color=red]; 10 | A -> C [color=red]; 11 | node [color=lightgrey fontcolor=lightgrey]; 12 | edge [color=lightgrey]; 13 | node [color=lightgrey]; 14 | B -> B1; 15 | B -> B2; 16 | C -> C1; 17 | C -> C2; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/pip/_vendor/pygments/__main__.py: -------------------------------------------------------------------------------- 1 | """ 2 | pygments.__main__ 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Main entry point for ``python -m pygments``. 6 | 7 | :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | """ 10 | 11 | import sys 12 | from pip._vendor.pygments.cmdline import main 13 | 14 | try: 15 | sys.exit(main(sys.argv)) 16 | except KeyboardInterrupt: 17 | sys.exit(1) 18 | -------------------------------------------------------------------------------- /tests/unit/test_utils_filesystem.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | 5 | def make_file(path: str) -> None: 6 | Path(path).touch() 7 | 8 | 9 | def make_valid_symlink(path: str) -> None: 10 | target = path + "1" 11 | make_file(target) 12 | os.symlink(target, path) 13 | 14 | 15 | def make_broken_symlink(path: str) -> None: 16 | os.symlink("foo", path) 17 | 18 | 19 | def make_dir(path: str) -> None: 20 | os.mkdir(path) 21 | -------------------------------------------------------------------------------- /tests/ruff.toml: -------------------------------------------------------------------------------- 1 | # Extend the `pyproject.toml` file in the parent directory. 2 | extend = "../pyproject.toml" 3 | 4 | # And extend linting to include pytest specific rules and configuration 5 | [lint] 6 | extend-select = ["PT"] 7 | ignore = ["PT011"] 8 | 9 | [lint.flake8-pytest-style] 10 | mark-parentheses = false 11 | fixture-parentheses = false 12 | parametrize-names-type = "csv" 13 | parametrize-values-type = "list" 14 | parametrize-values-row-type = "tuple" 15 | -------------------------------------------------------------------------------- /docs/man/commands/debug.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ========== 4 | pip-debug 5 | ========== 6 | 7 | Description 8 | *********** 9 | 10 | .. pip-command-description:: debug 11 | 12 | Usage 13 | ***** 14 | 15 | .. pip-command-usage:: debug 16 | 17 | 18 | .. warning:: 19 | This command is only meant for debugging. 20 | Its options and outputs are provisional and may change without notice. 21 | 22 | 23 | Options 24 | ******* 25 | 26 | .. pip-command-options:: debug 27 | -------------------------------------------------------------------------------- /docs/html/cli/pip_config.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _`pip config`: 3 | 4 | ========== 5 | pip config 6 | ========== 7 | 8 | 9 | Usage 10 | ===== 11 | 12 | .. tab:: Unix/macOS 13 | 14 | .. pip-command-usage:: config "python -m pip" 15 | 16 | .. tab:: Windows 17 | 18 | .. pip-command-usage:: config "py -m pip" 19 | 20 | 21 | Description 22 | =========== 23 | 24 | .. pip-command-description:: config 25 | 26 | 27 | Options 28 | ======= 29 | 30 | .. pip-command-options:: config 31 | -------------------------------------------------------------------------------- /tests/data/indexes/require-invalid-version/require-invalid-version/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | require_invalid_version-0.1-py3-none-any.whl 5 | require_invalid_version-1.0-py3-none-any.whl 6 | require_invalid_version-1.0.tar.gz 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_pick.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | 4 | def pick_bool(*values: Optional[bool]) -> bool: 5 | """Pick the first non-none bool or return the last value. 6 | 7 | Args: 8 | *values (bool): Any number of boolean or None values. 9 | 10 | Returns: 11 | bool: First non-none boolean. 12 | """ 13 | assert values, "1 or more values required" 14 | for value in values: 15 | if value is not None: 16 | return value 17 | return bool(value) 18 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_timer.py: -------------------------------------------------------------------------------- 1 | """ 2 | Timer context manager, only used in debug. 3 | 4 | """ 5 | 6 | from time import time 7 | 8 | import contextlib 9 | from typing import Generator 10 | 11 | 12 | @contextlib.contextmanager 13 | def timer(subject: str = "time") -> Generator[None, None, None]: 14 | """print the elapsed time. (only used in debugging)""" 15 | start = time() 16 | yield 17 | elapsed = time() - start 18 | elapsed_ms = elapsed * 1000 19 | print(f"{subject} elapsed {elapsed_ms:.1f}ms") 20 | -------------------------------------------------------------------------------- /src/pip/_vendor/requests/__version__.py: -------------------------------------------------------------------------------- 1 | # .-. .-. .-. . . .-. .-. .-. .-. 2 | # |( |- |.| | | |- `-. | `-. 3 | # ' ' `-' `-`.`-' `-' `-' ' `-' 4 | 5 | __title__ = "requests" 6 | __description__ = "Python HTTP for Humans." 7 | __url__ = "https://requests.readthedocs.io" 8 | __version__ = "2.32.5" 9 | __build__ = 0x023205 10 | __author__ = "Kenneth Reitz" 11 | __author_email__ = "me@kennethreitz.org" 12 | __license__ = "Apache-2.0" 13 | __copyright__ = "Copyright Kenneth Reitz" 14 | __cake__ = "\u2728 \U0001f370 \u2728" 15 | -------------------------------------------------------------------------------- /.github/workflows/lock-threads.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Closed Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 7 * * *' # 7am UTC, daily 6 | workflow_dispatch: 7 | 8 | permissions: 9 | issues: write 10 | pull-requests: write 11 | 12 | concurrency: 13 | group: lock 14 | 15 | jobs: 16 | action: 17 | if: github.repository_owner == 'pypa' 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: dessant/lock-threads@v5 21 | with: 22 | issue-inactive-days: '30' 23 | pr-inactive-days: '15' 24 | -------------------------------------------------------------------------------- /src/pip/_vendor/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | requests.certs 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module returns the preferred default CA certificate bundle. There is 8 | only one — the one from the certifi package. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | from pip._vendor.certifi import where 15 | 16 | if __name__ == "__main__": 17 | print(where()) 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to pip 2 | 3 | Thank you for your interest in contributing to pip! There are many ways to 4 | contribute, and we appreciate all of them. 5 | 6 | As a reminder, all contributors are expected to follow our [Code of Conduct][coc]. 7 | 8 | [coc]: https://www.pypa.io/en/latest/code-of-conduct/ 9 | 10 | ## Development Documentation 11 | 12 | Our [development documentation](https://pip.pypa.io/en/latest/development/) contains details on how to get started with contributing to pip, and details of our development processes. 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /docs/html/topics/index.md: -------------------------------------------------------------------------------- 1 | # Topic Guides 2 | 3 | These pages provide detailed information on individual topics. 4 | 5 | ```{note} 6 | This section of the documentation is currently being fleshed out. See 7 | {issue}`9475` for more details. 8 | ``` 9 | 10 | ```{toctree} 11 | :maxdepth: 1 12 | 13 | authentication 14 | caching 15 | configuration 16 | dependency-resolution 17 | more-dependency-resolution 18 | https-certificates 19 | local-project-installs 20 | repeatable-installs 21 | secure-installs 22 | vcs-support 23 | python-option 24 | workflow 25 | ``` 26 | -------------------------------------------------------------------------------- /src/pip/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | 5 | __title__ = "packaging" 6 | __summary__ = "Core utilities for Python packages" 7 | __uri__ = "https://github.com/pypa/packaging" 8 | 9 | __version__ = "25.0" 10 | 11 | __author__ = "Donald Stufft and individual contributors" 12 | __email__ = "donald@stufft.io" 13 | 14 | __license__ = "BSD-2-Clause or Apache-2.0" 15 | __copyright__ = f"2014 {__author__}" 16 | -------------------------------------------------------------------------------- /docs/html/cli/pip_inspect.rst: -------------------------------------------------------------------------------- 1 | .. _`pip inspect`: 2 | 3 | =========== 4 | pip inspect 5 | =========== 6 | 7 | .. versionadded:: 22.2 8 | 9 | 10 | Usage 11 | ===== 12 | 13 | .. tab:: Unix/macOS 14 | 15 | .. pip-command-usage:: inspect "python -m pip" 16 | 17 | .. tab:: Windows 18 | 19 | .. pip-command-usage:: inspect "py -m pip" 20 | 21 | 22 | Description 23 | =========== 24 | 25 | .. pip-command-description:: inspect 26 | 27 | The format of the JSON output is described in :doc:`../reference/inspect-report`. 28 | 29 | 30 | Options 31 | ======= 32 | 33 | .. pip-command-options:: inspect 34 | -------------------------------------------------------------------------------- /src/pip/_internal/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from pip._internal.utils import _log 4 | 5 | # init_logging() must be called before any call to logging.getLogger() 6 | # which happens at import of most modules. 7 | _log.init_logging() 8 | 9 | 10 | def main(args: list[str] | None = None) -> int: 11 | """This is preserved for old console scripts that may still be referencing 12 | it. 13 | 14 | For additional details, see https://github.com/pypa/pip/issues/7498. 15 | """ 16 | from pip._internal.utils.entrypoints import _wrapper 17 | 18 | return _wrapper(args) 19 | -------------------------------------------------------------------------------- /docs/html/cli/pip_debug.rst: -------------------------------------------------------------------------------- 1 | .. _`pip debug`: 2 | 3 | ========= 4 | pip debug 5 | ========= 6 | 7 | 8 | Usage 9 | ===== 10 | 11 | .. tab:: Unix/macOS 12 | 13 | .. pip-command-usage:: debug "python -m pip" 14 | 15 | .. tab:: Windows 16 | 17 | .. pip-command-usage:: debug "py -m pip" 18 | 19 | 20 | .. warning:: 21 | 22 | This command is only meant for debugging. 23 | Its options and outputs are provisional and may change without notice. 24 | 25 | 26 | Description 27 | =========== 28 | 29 | .. pip-command-description:: debug 30 | 31 | 32 | Options 33 | ======= 34 | 35 | .. pip-command-options:: debug 36 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/util/queue.py: -------------------------------------------------------------------------------- 1 | import collections 2 | 3 | from ..packages import six 4 | from ..packages.six.moves import queue 5 | 6 | if six.PY2: 7 | # Queue is imported for side effects on MS Windows. See issue #229. 8 | import Queue as _unused_module_Queue # noqa: F401 9 | 10 | 11 | class LifoQueue(queue.Queue): 12 | def _init(self, _): 13 | self.queue = collections.deque() 14 | 15 | def _qsize(self, len=len): 16 | return len(self.queue) 17 | 18 | def _put(self, item): 19 | self.queue.append(item) 20 | 21 | def _get(self): 22 | return self.queue.pop() 23 | -------------------------------------------------------------------------------- /src/pip/_vendor/cachecontrol/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2012-2021 Eric Larson 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /docs/html/ux-research-design/index.md: -------------------------------------------------------------------------------- 1 | # UX Research & Design 2 | 3 | ```{toctree} 4 | :hidden: 5 | 6 | contribute 7 | guidance 8 | research-results/index 9 | ``` 10 | 11 | Welcome to pip’s UX research and design documentation. The purpose of this section of the documentation is to: 12 | 13 | - [Identify where new contributors can participate in or lead UX research and design activities](contribute) 14 | - [Share pip UX guidelines](guidance), including an introduction to User Centered Design practices, and how they can be applied to the pip project 15 | - Share [results of user research](research-results/index) that the pip team has already conducted 16 | -------------------------------------------------------------------------------- /tests/lib/index.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from pip._internal.models.candidate import InstallationCandidate 4 | from pip._internal.models.link import Link 5 | 6 | 7 | def make_mock_candidate( 8 | version: str, yanked_reason: str | None = None, hex_digest: str | None = None 9 | ) -> InstallationCandidate: 10 | url = f"https://example.com/pkg-{version}.tar.gz" 11 | if hex_digest is not None: 12 | assert len(hex_digest) == 64 13 | url += f"#sha256={hex_digest}" 14 | 15 | link = Link(url, yanked_reason=yanked_reason) 16 | candidate = InstallationCandidate("mypackage", version, link) 17 | 18 | return candidate 19 | -------------------------------------------------------------------------------- /src/pip/_internal/vcs/__init__.py: -------------------------------------------------------------------------------- 1 | # Expose a limited set of classes and functions so callers outside of 2 | # the vcs package don't need to import deeper than `pip._internal.vcs`. 3 | # (The test directory may still need to import from a vcs sub-package.) 4 | # Import all vcs modules to register each VCS in the VcsSupport object. 5 | import pip._internal.vcs.bazaar 6 | import pip._internal.vcs.git 7 | import pip._internal.vcs.mercurial 8 | import pip._internal.vcs.subversion # noqa: F401 9 | from pip._internal.vcs.versioncontrol import ( # noqa: F401 10 | RemoteNotFoundError, 11 | RemoteNotValidError, 12 | is_url, 13 | make_vcs_requirement_url, 14 | vcs, 15 | ) 16 | -------------------------------------------------------------------------------- /src/pip/_internal/resolution/base.py: -------------------------------------------------------------------------------- 1 | from typing import Callable, Optional 2 | 3 | from pip._internal.req.req_install import InstallRequirement 4 | from pip._internal.req.req_set import RequirementSet 5 | 6 | InstallRequirementProvider = Callable[ 7 | [str, Optional[InstallRequirement]], InstallRequirement 8 | ] 9 | 10 | 11 | class BaseResolver: 12 | def resolve( 13 | self, root_reqs: list[InstallRequirement], check_supported_wheels: bool 14 | ) -> RequirementSet: 15 | raise NotImplementedError() 16 | 17 | def get_installation_order( 18 | self, req_set: RequirementSet 19 | ) -> list[InstallRequirement]: 20 | raise NotImplementedError() 21 | -------------------------------------------------------------------------------- /src/pip/_vendor/msgpack/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2008-2011 INADA Naoki 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /src/pip/_vendor/pyproject_hooks/_in_process/__init__.py: -------------------------------------------------------------------------------- 1 | """This is a subpackage because the directory is on sys.path for _in_process.py 2 | 3 | The subpackage should stay as empty as possible to avoid shadowing modules that 4 | the backend might import. 5 | """ 6 | 7 | import importlib.resources as resources 8 | 9 | try: 10 | resources.files 11 | except AttributeError: 12 | # Python 3.8 compatibility 13 | def _in_proc_script_path(): 14 | return resources.path(__package__, "_in_process.py") 15 | 16 | else: 17 | 18 | def _in_proc_script_path(): 19 | return resources.as_file( 20 | resources.files(__package__).joinpath("_in_process.py") 21 | ) 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/resolvelib/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | "AbstractProvider", 3 | "AbstractResolver", 4 | "BaseReporter", 5 | "InconsistentCandidate", 6 | "RequirementsConflicted", 7 | "ResolutionError", 8 | "ResolutionImpossible", 9 | "ResolutionTooDeep", 10 | "Resolver", 11 | "__version__", 12 | ] 13 | 14 | __version__ = "1.2.1" 15 | 16 | 17 | from .providers import AbstractProvider 18 | from .reporters import BaseReporter 19 | from .resolvers import ( 20 | AbstractResolver, 21 | InconsistentCandidate, 22 | RequirementsConflicted, 23 | ResolutionError, 24 | ResolutionImpossible, 25 | ResolutionTooDeep, 26 | Resolver, 27 | ) 28 | -------------------------------------------------------------------------------- /tests/functional/test_bad_url.py: -------------------------------------------------------------------------------- 1 | # test the error message returned by pip when 2 | # a bad "file:" URL is passed to it. 3 | 4 | from typing import Any 5 | 6 | 7 | def test_filenotfound_error_message(script: Any) -> None: 8 | # Test the error message returned when using a bad 'file:' URL. 9 | # make pip to fail and get an error message 10 | # by running "pip install -r file:///nonexistent_file" 11 | proc = script.pip("install", "-r", "file:///unexistent_file", expect_error=True) 12 | assert proc.returncode == 1 13 | expect = ( 14 | "ERROR: 404 Client Error: FileNotFoundError for url: file:///unexistent_file" 15 | ) 16 | assert proc.stderr.rstrip() == expect 17 | -------------------------------------------------------------------------------- /src/pip/_internal/models/scheme.py: -------------------------------------------------------------------------------- 1 | """ 2 | For types associated with installation schemes. 3 | 4 | For a general overview of available schemes and their context, see 5 | https://docs.python.org/3/install/index.html#alternate-installation. 6 | """ 7 | 8 | from dataclasses import dataclass 9 | 10 | SCHEME_KEYS = ["platlib", "purelib", "headers", "scripts", "data"] 11 | 12 | 13 | @dataclass(frozen=True) 14 | class Scheme: 15 | """A Scheme holds paths which are used as the base directories for 16 | artifacts associated with a Python package. 17 | """ 18 | 19 | __slots__ = SCHEME_KEYS 20 | 21 | platlib: str 22 | purelib: str 23 | headers: str 24 | scripts: str 25 | data: str 26 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import find_packages, setup 4 | 5 | 6 | def path_to_url(path): 7 | """ 8 | Convert a path to URI. The path will be made absolute and 9 | will not have quoted path parts. 10 | """ 11 | path = os.path.normpath(os.path.abspath(path)) 12 | drive, path = os.path.splitdrive(path) 13 | filepath = path.split(os.path.sep) 14 | url = "/".join(filepath) 15 | if drive: 16 | return "file:///" + drive + url 17 | return "file://" + url 18 | 19 | 20 | setup( 21 | name="LocalExtras", 22 | version="0.0.1", 23 | packages=find_packages(), 24 | extras_require={"bar": ["simple"], "baz": ["singlemodule"]}, 25 | ) 26 | -------------------------------------------------------------------------------- /tests/data/packages/pep517_wrapper_buildsys/mybuildsys.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools.build_meta import build_sdist 4 | from setuptools.build_meta import build_wheel as setuptools_build_wheel 5 | from setuptools.build_meta import ( 6 | get_requires_for_build_sdist, 7 | get_requires_for_build_wheel, 8 | prepare_metadata_for_build_wheel, 9 | ) 10 | 11 | 12 | def build_wheel(*a, **kw): 13 | if os.environ.get("PIP_TEST_FAIL_BUILD_WHEEL"): 14 | raise RuntimeError("Failing build_wheel, as requested.") 15 | 16 | # Create the marker file to record that the hook was called 17 | with open(os.environ["PIP_TEST_MARKER_FILE"], "wb"): 18 | pass 19 | 20 | return setuptools_build_wheel(*a, **kw) 21 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 2 | patreon: # Replace with a single Patreon username 3 | open_collective: # Replace with a single Open Collective username 4 | ko_fi: # Replace with a single Ko-fi username 5 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 6 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 7 | liberapay: # Replace with a single Liberapay username 8 | issuehunt: # Replace with a single IssueHunt username 9 | otechie: # Replace with a single Otechie username 10 | custom: "https://pypi.org/sponsor/" # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 11 | -------------------------------------------------------------------------------- /tests/data/packages/LocalEnvironMarker/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import find_packages, setup 4 | 5 | 6 | def path_to_url(path): 7 | """ 8 | Convert a path to URI. The path will be made absolute and 9 | will not have quoted path parts. 10 | """ 11 | path = os.path.normpath(os.path.abspath(path)) 12 | drive, path = os.path.splitdrive(path) 13 | filepath = path.split(os.path.sep) 14 | url = "/".join(filepath) 15 | if drive: 16 | return "file:///" + drive + url 17 | return "file://" + url 18 | 19 | 20 | setup( 21 | name="LocalEnvironMarker", 22 | version="0.0.1", 23 | packages=find_packages(), 24 | extras_require={ 25 | ":python_version == '2.7'": ["simple"], 26 | }, 27 | ) 28 | -------------------------------------------------------------------------------- /tests/data/packages/LocalExtras-0.0.2/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from setuptools import find_packages, setup 4 | 5 | 6 | def path_to_url(path): 7 | """ 8 | Convert a path to URI. The path will be made absolute and 9 | will not have quoted path parts. 10 | """ 11 | path = os.path.normpath(os.path.abspath(path)) 12 | drive, path = os.path.splitdrive(path) 13 | filepath = path.split(os.path.sep) 14 | url = "/".join(filepath) 15 | if drive: 16 | return "file:///" + drive + url 17 | return "file://" + url 18 | 19 | 20 | setup( 21 | name="LocalExtras", 22 | version="0.0.2", 23 | packages=find_packages(), 24 | install_requires=["simple==1.0"], 25 | extras_require={"bar": ["simple==2.0"], "baz": ["singlemodule"]}, 26 | ) 27 | -------------------------------------------------------------------------------- /src/pip/_vendor/distlib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012-2024 Vinay Sajip. 4 | # Licensed to the Python Software Foundation under a contributor agreement. 5 | # See LICENSE.txt and CONTRIBUTORS.txt. 6 | # 7 | import logging 8 | 9 | __version__ = '0.4.0' 10 | 11 | 12 | class DistlibException(Exception): 13 | pass 14 | 15 | 16 | try: 17 | from logging import NullHandler 18 | except ImportError: # pragma: no cover 19 | 20 | class NullHandler(logging.Handler): 21 | 22 | def handle(self, record): 23 | pass 24 | 25 | def emit(self, record): 26 | pass 27 | 28 | def createLock(self): 29 | self.lock = None 30 | 31 | 32 | logger = logging.getLogger(__name__) 33 | logger.addHandler(NullHandler()) 34 | -------------------------------------------------------------------------------- /src/pip/_vendor/resolvelib/resolvers/__init__.py: -------------------------------------------------------------------------------- 1 | from ..structs import RequirementInformation 2 | from .abstract import AbstractResolver, Result 3 | from .criterion import Criterion 4 | from .exceptions import ( 5 | InconsistentCandidate, 6 | RequirementsConflicted, 7 | ResolutionError, 8 | ResolutionImpossible, 9 | ResolutionTooDeep, 10 | ResolverException, 11 | ) 12 | from .resolution import Resolution, Resolver 13 | 14 | __all__ = [ 15 | "AbstractResolver", 16 | "Criterion", 17 | "InconsistentCandidate", 18 | "RequirementInformation", 19 | "RequirementsConflicted", 20 | "Resolution", 21 | "ResolutionError", 22 | "ResolutionImpossible", 23 | "ResolutionTooDeep", 24 | "Resolver", 25 | "ResolverException", 26 | "Result", 27 | ] 28 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/errors.py: -------------------------------------------------------------------------------- 1 | class ConsoleError(Exception): 2 | """An error in console operation.""" 3 | 4 | 5 | class StyleError(Exception): 6 | """An error in styles.""" 7 | 8 | 9 | class StyleSyntaxError(ConsoleError): 10 | """Style was badly formatted.""" 11 | 12 | 13 | class MissingStyle(StyleError): 14 | """No such style.""" 15 | 16 | 17 | class StyleStackError(ConsoleError): 18 | """Style stack is invalid.""" 19 | 20 | 21 | class NotRenderableError(ConsoleError): 22 | """Object is not renderable.""" 23 | 24 | 25 | class MarkupError(ConsoleError): 26 | """Markup was badly formatted.""" 27 | 28 | 29 | class LiveError(ConsoleError): 30 | """Error related to Live display.""" 31 | 32 | 33 | class NoAltScreen(ConsoleError): 34 | """Alt screen mode was required.""" 35 | -------------------------------------------------------------------------------- /src/pip/_internal/utils/filetypes.py: -------------------------------------------------------------------------------- 1 | """Filetype information.""" 2 | 3 | from pip._internal.utils.misc import splitext 4 | 5 | WHEEL_EXTENSION = ".whl" 6 | BZ2_EXTENSIONS: tuple[str, ...] = (".tar.bz2", ".tbz") 7 | XZ_EXTENSIONS: tuple[str, ...] = ( 8 | ".tar.xz", 9 | ".txz", 10 | ".tlz", 11 | ".tar.lz", 12 | ".tar.lzma", 13 | ) 14 | ZIP_EXTENSIONS: tuple[str, ...] = (".zip", WHEEL_EXTENSION) 15 | TAR_EXTENSIONS: tuple[str, ...] = (".tar.gz", ".tgz", ".tar") 16 | ARCHIVE_EXTENSIONS = ZIP_EXTENSIONS + BZ2_EXTENSIONS + TAR_EXTENSIONS + XZ_EXTENSIONS 17 | 18 | 19 | def is_archive_file(name: str) -> bool: 20 | """Return True if `name` is a considered as an archive file.""" 21 | ext = splitext(name)[1].lower() 22 | if ext in ARCHIVE_EXTENSIONS: 23 | return True 24 | return False 25 | -------------------------------------------------------------------------------- /src/pip/_vendor/resolvelib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Tzu-ping Chung 2 | 3 | Permission to use, copy, modify, and distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /tests/data/packages/FSPkg/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | version = "0.1dev" 4 | 5 | setup( 6 | name="FSPkg", 7 | version=version, 8 | description="File system test package", 9 | long_description="""\ 10 | File system test package""", 11 | classifiers=[], # Get strings from https://pypi.org/pypi?%3Aaction=list_classifiers 12 | keywords="pip tests", 13 | author="pip", 14 | author_email="pip@openplans.org", 15 | url="http://pip.openplans.org", 16 | license="", 17 | packages=find_packages(exclude=["ez_setup", "examples", "tests"]), 18 | include_package_data=True, 19 | zip_safe=False, 20 | install_requires=[ 21 | # -*- Extra requirements: -*- 22 | ], 23 | entry_points=""" 24 | # -*- Entry points: -*- 25 | """, 26 | ) 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled files 2 | __pycache__/ 3 | *$py.class 4 | 5 | # Distribution / packaging 6 | /build/ 7 | /dist/ 8 | *.egg 9 | *.eggs 10 | *.egg-info/ 11 | MANIFEST 12 | 13 | # Documentation 14 | docs/build/ 15 | 16 | # mypy 17 | .mypy_cache/ 18 | 19 | # Unit test / coverage reports 20 | .[nt]ox/ 21 | htmlcov/ 22 | .coverage 23 | .coverage.* 24 | .*cache 25 | nosetests.xml 26 | coverage.xml 27 | *.cover 28 | tests/data/common_wheels/ 29 | 30 | # Misc 31 | *~ 32 | .*.sw? 33 | .env/ 34 | .venv/ 35 | 36 | # For IntelliJ IDEs (basically PyCharm) 37 | .idea/ 38 | 39 | # For Visual Studio Code 40 | .vscode/ 41 | 42 | # For Sublime Text 43 | *.sublime-workspace 44 | *.sublime-project 45 | 46 | # Scratch Pad for experiments 47 | .scratch/ 48 | 49 | # Mac 50 | .DS_Store 51 | 52 | # Profiling related artifacts 53 | *.prof 54 | -------------------------------------------------------------------------------- /tests/functional/test_vcs_mercurial.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from pip._internal.vcs.mercurial import Mercurial 4 | 5 | from tests.lib import PipTestEnvironment, _create_test_package, need_mercurial 6 | 7 | 8 | @need_mercurial 9 | def test_get_repository_root(script: PipTestEnvironment) -> None: 10 | version_pkg_path = _create_test_package(script.scratch_path, vcs="hg") 11 | tests_path = version_pkg_path.joinpath("tests") 12 | tests_path.mkdir() 13 | 14 | root1 = Mercurial.get_repository_root(os.fspath(version_pkg_path)) 15 | assert root1 is not None 16 | assert os.path.normcase(root1) == os.path.normcase(version_pkg_path) 17 | 18 | root2 = Mercurial.get_repository_root(os.fspath(tests_path)) 19 | assert root2 is not None 20 | assert os.path.normcase(root2) == os.path.normcase(version_pkg_path) 21 | -------------------------------------------------------------------------------- /docs/html/cli/pip_lock.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _`pip lock`: 3 | 4 | ======== 5 | pip lock 6 | ======== 7 | 8 | 9 | 10 | Usage 11 | ===== 12 | 13 | .. tab:: Unix/macOS 14 | 15 | .. pip-command-usage:: lock "python -m pip" 16 | 17 | .. tab:: Windows 18 | 19 | .. pip-command-usage:: lock "py -m pip" 20 | 21 | 22 | Description 23 | =========== 24 | 25 | .. pip-command-description:: lock 26 | 27 | Options 28 | ======= 29 | 30 | .. pip-command-options:: lock 31 | 32 | .. pip-index-options:: lock 33 | 34 | 35 | Examples 36 | ======== 37 | 38 | #. Emit a ``pylock.toml`` for the project in the current directory 39 | 40 | .. tab:: Unix/macOS 41 | 42 | .. code-block:: shell 43 | 44 | python -m pip lock -e . 45 | 46 | .. tab:: Windows 47 | 48 | .. code-block:: shell 49 | 50 | py -m pip lock -e . 51 | -------------------------------------------------------------------------------- /src/pip/_vendor/cachecontrol/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2015 Eric Larson 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | 5 | """CacheControl import Interface. 6 | 7 | Make it easy to import from cachecontrol without long namespaces. 8 | """ 9 | 10 | __author__ = "Eric Larson" 11 | __email__ = "eric@ionrock.org" 12 | __version__ = "0.14.3" 13 | 14 | from pip._vendor.cachecontrol.adapter import CacheControlAdapter 15 | from pip._vendor.cachecontrol.controller import CacheController 16 | from pip._vendor.cachecontrol.wrapper import CacheControl 17 | 18 | __all__ = [ 19 | "__author__", 20 | "__email__", 21 | "__version__", 22 | "CacheControlAdapter", 23 | "CacheController", 24 | "CacheControl", 25 | ] 26 | 27 | import logging 28 | 29 | logging.getLogger(__name__).addHandler(logging.NullHandler()) 30 | -------------------------------------------------------------------------------- /src/pip/_vendor/pyproject_hooks/__init__.py: -------------------------------------------------------------------------------- 1 | """Wrappers to call pyproject.toml-based build backend hooks. 2 | """ 3 | 4 | from typing import TYPE_CHECKING 5 | 6 | from ._impl import ( 7 | BackendUnavailable, 8 | BuildBackendHookCaller, 9 | HookMissing, 10 | UnsupportedOperation, 11 | default_subprocess_runner, 12 | quiet_subprocess_runner, 13 | ) 14 | 15 | __version__ = "1.2.0" 16 | __all__ = [ 17 | "BackendUnavailable", 18 | "BackendInvalid", 19 | "HookMissing", 20 | "UnsupportedOperation", 21 | "default_subprocess_runner", 22 | "quiet_subprocess_runner", 23 | "BuildBackendHookCaller", 24 | ] 25 | 26 | BackendInvalid = BackendUnavailable # Deprecated alias, previously a separate exception 27 | 28 | if TYPE_CHECKING: 29 | from ._impl import SubprocessRunner 30 | 31 | __all__ += ["SubprocessRunner"] 32 | -------------------------------------------------------------------------------- /tests/functional/test_pip_runner_script.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | from pip import __version__ 5 | 6 | from tests.lib import PipTestEnvironment 7 | 8 | 9 | def test_runner_work_in_environments_with_no_pip( 10 | script: PipTestEnvironment, pip_src: Path 11 | ) -> None: 12 | runner = pip_src / "src" / "pip" / "__pip-runner__.py" 13 | 14 | # Ensure there's no pip installed in the environment 15 | script.pip("uninstall", "pip", "--yes", use_module=True) 16 | # We don't use script.pip to check here, as when testing a 17 | # zipapp, script.pip will run pip from the zipapp. 18 | script.run("python", "-c", "import pip", expect_error=True) 19 | 20 | # The runner script should still invoke a usable pip 21 | result = script.run("python", os.fspath(runner), "--version") 22 | 23 | assert __version__ in result.stdout 24 | -------------------------------------------------------------------------------- /.github/workflows/update-rtd-redirects.yml: -------------------------------------------------------------------------------- 1 | name: Update documentation redirects 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | paths: 7 | - ".readthedocs-custom-redirects.yml" 8 | - ".readthedocs.yml" 9 | schedule: 10 | - cron: 0 0 * * MON # Run every Monday at 00:00 UTC 11 | 12 | env: 13 | FORCE_COLOR: "1" 14 | 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | update-rtd-redirects: 21 | runs-on: ubuntu-latest 22 | environment: RTD Deploys 23 | steps: 24 | - uses: actions/checkout@v6.0.1 25 | - uses: actions/setup-python@v6 26 | with: 27 | python-version: "3.11" 28 | - run: pipx run tools/update-rtd-redirects.py 29 | env: 30 | RTD_API_TOKEN: ${{ secrets.RTD_API_TOKEN }} 31 | -------------------------------------------------------------------------------- /src/pip/_internal/models/candidate.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from pip._vendor.packaging.version import Version 4 | from pip._vendor.packaging.version import parse as parse_version 5 | 6 | from pip._internal.models.link import Link 7 | 8 | 9 | @dataclass(frozen=True) 10 | class InstallationCandidate: 11 | """Represents a potential "candidate" for installation.""" 12 | 13 | __slots__ = ["name", "version", "link"] 14 | 15 | name: str 16 | version: Version 17 | link: Link 18 | 19 | def __init__(self, name: str, version: str, link: Link) -> None: 20 | object.__setattr__(self, "name", name) 21 | object.__setattr__(self, "version", parse_version(version)) 22 | object.__setattr__(self, "link", link) 23 | 24 | def __str__(self) -> str: 25 | return f"{self.name!r} candidate (version {self.version} at {self.link})" 26 | -------------------------------------------------------------------------------- /src/pip/_vendor/platformdirs/version.py: -------------------------------------------------------------------------------- 1 | # file generated by setuptools-scm 2 | # don't change, don't track in version control 3 | 4 | __all__ = [ 5 | "__version__", 6 | "__version_tuple__", 7 | "version", 8 | "version_tuple", 9 | "__commit_id__", 10 | "commit_id", 11 | ] 12 | 13 | TYPE_CHECKING = False 14 | if TYPE_CHECKING: 15 | from typing import Tuple 16 | from typing import Union 17 | 18 | VERSION_TUPLE = Tuple[Union[int, str], ...] 19 | COMMIT_ID = Union[str, None] 20 | else: 21 | VERSION_TUPLE = object 22 | COMMIT_ID = object 23 | 24 | version: str 25 | __version__: str 26 | __version_tuple__: VERSION_TUPLE 27 | version_tuple: VERSION_TUPLE 28 | commit_id: COMMIT_ID 29 | __commit_id__: COMMIT_ID 30 | 31 | __version__ = version = '4.5.0' 32 | __version_tuple__ = version_tuple = (4, 5, 0) 33 | 34 | __commit_id__ = commit_id = None 35 | -------------------------------------------------------------------------------- /src/pip/_vendor/requests/hooks.py: -------------------------------------------------------------------------------- 1 | """ 2 | requests.hooks 3 | ~~~~~~~~~~~~~~ 4 | 5 | This module provides the capabilities for the Requests hooks system. 6 | 7 | Available hooks: 8 | 9 | ``response``: 10 | The response generated from a Request. 11 | """ 12 | HOOKS = ["response"] 13 | 14 | 15 | def default_hooks(): 16 | return {event: [] for event in HOOKS} 17 | 18 | 19 | # TODO: response is the only one 20 | 21 | 22 | def dispatch_hook(key, hooks, hook_data, **kwargs): 23 | """Dispatches a hook dictionary on a given piece of data.""" 24 | hooks = hooks or {} 25 | hooks = hooks.get(key) 26 | if hooks: 27 | if hasattr(hooks, "__call__"): 28 | hooks = [hooks] 29 | for hook in hooks: 30 | _hook_data = hook(hook_data, **kwargs) 31 | if _hook_data is not None: 32 | hook_data = _hook_data 33 | return hook_data 34 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_fileno.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import IO, Callable 4 | 5 | 6 | def get_fileno(file_like: IO[str]) -> int | None: 7 | """Get fileno() from a file, accounting for poorly implemented file-like objects. 8 | 9 | Args: 10 | file_like (IO): A file-like object. 11 | 12 | Returns: 13 | int | None: The result of fileno if available, or None if operation failed. 14 | """ 15 | fileno: Callable[[], int] | None = getattr(file_like, "fileno", None) 16 | if fileno is not None: 17 | try: 18 | return fileno() 19 | except Exception: 20 | # `fileno` is documented as potentially raising a OSError 21 | # Alas, from the issues, there are so many poorly implemented file-like objects, 22 | # that `fileno()` can raise just about anything. 23 | return None 24 | return None 25 | -------------------------------------------------------------------------------- /tests/data/src/chattymodule/backend.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | from setuptools import build_meta 5 | from setuptools.build_meta import * 6 | 7 | 8 | def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None): 9 | if config_settings and "fail" in config_settings: 10 | print("I DIE, I DIE in prepare_metadata_for_build_wheel") 11 | sys.exit(1) 12 | print("HELLO FROM CHATTYMODULE prepare_metadata_for_build_wheel") 13 | return build_meta.prepare_metadata_for_build_wheel( 14 | metadata_directory, config_settings 15 | ) 16 | 17 | 18 | def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): 19 | if config_settings and "fail" in config_settings: 20 | print("I DIE, I DIE in build_wheel") 21 | sys.exit(1) 22 | print("HELLO FROM CHATTYMODULE build_wheel") 23 | return build_meta.build_wheel(wheel_directory, config_settings, metadata_directory) 24 | -------------------------------------------------------------------------------- /src/pip/__main__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | # Remove '' and current working directory from the first entry 5 | # of sys.path, if present to avoid using current directory 6 | # in pip commands check, freeze, install, list and show, 7 | # when invoked as python -m pip 8 | if sys.path[0] in ("", os.getcwd()): 9 | sys.path.pop(0) 10 | 11 | # If we are running from a wheel, add the wheel to sys.path 12 | # This allows the usage python pip-*.whl/pip install pip-*.whl 13 | if __package__ == "": 14 | # __file__ is pip-*.whl/pip/__main__.py 15 | # first dirname call strips of '/__main__.py', second strips off '/pip' 16 | # Resulting path is the name of the wheel itself 17 | # Add that to sys.path so we can import pip 18 | path = os.path.dirname(os.path.dirname(__file__)) 19 | sys.path.insert(0, path) 20 | 21 | if __name__ == "__main__": 22 | from pip._internal.cli.main import main as _main 23 | 24 | sys.exit(_main()) 25 | -------------------------------------------------------------------------------- /src/pip/_internal/cli/command_context.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Generator 2 | from contextlib import AbstractContextManager, ExitStack, contextmanager 3 | from typing import TypeVar 4 | 5 | _T = TypeVar("_T", covariant=True) 6 | 7 | 8 | class CommandContextMixIn: 9 | def __init__(self) -> None: 10 | super().__init__() 11 | self._in_main_context = False 12 | self._main_context = ExitStack() 13 | 14 | @contextmanager 15 | def main_context(self) -> Generator[None, None, None]: 16 | assert not self._in_main_context 17 | 18 | self._in_main_context = True 19 | try: 20 | with self._main_context: 21 | yield 22 | finally: 23 | self._in_main_context = False 24 | 25 | def enter_context(self, context_provider: AbstractContextManager[_T]) -> _T: 26 | assert self._in_main_context 27 | 28 | return self._main_context.enter_context(context_provider) 29 | -------------------------------------------------------------------------------- /tests/functional/test_install_cleanup.py: -------------------------------------------------------------------------------- 1 | from os.path import exists 2 | 3 | import pytest 4 | 5 | from tests.lib import PipTestEnvironment, TestData 6 | 7 | 8 | @pytest.mark.network 9 | @pytest.mark.xfail(reason="The --build option was removed") 10 | def test_no_clean_option_blocks_cleaning_after_install( 11 | script: PipTestEnvironment, data: TestData 12 | ) -> None: 13 | """ 14 | Test --no-clean option blocks cleaning after install 15 | """ 16 | build = script.base_path / "pip-build" 17 | script.pip( 18 | "install", 19 | "--no-clean", 20 | "--no-index", 21 | "--build", 22 | build, 23 | f"--find-links={data.find_links}", 24 | "simple", 25 | expect_temp=True, 26 | # TODO: allow_stderr_warning is used for the --build deprecation, 27 | # remove it when removing support for --build 28 | allow_stderr_warning=True, 29 | ) 30 | assert exists(build) 31 | -------------------------------------------------------------------------------- /docs/html/cli/index.md: -------------------------------------------------------------------------------- 1 | # Commands 2 | 3 | The general options that apply to all the commands listed below can be 4 | found [under the `pip` page in this section](pip). 5 | 6 | ```{toctree} 7 | :maxdepth: 1 8 | :hidden: 9 | 10 | pip 11 | ``` 12 | 13 | ```{toctree} 14 | :maxdepth: 1 15 | :caption: Environment Management and Introspection 16 | 17 | pip_install 18 | pip_uninstall 19 | pip_inspect 20 | pip_list 21 | pip_show 22 | pip_freeze 23 | pip_check 24 | ``` 25 | 26 | ```{toctree} 27 | :maxdepth: 1 28 | :caption: Resolving dependencies 29 | 30 | pip_lock 31 | ``` 32 | 33 | ```{toctree} 34 | :maxdepth: 1 35 | :caption: Handling Distribution Files 36 | 37 | pip_download 38 | pip_wheel 39 | pip_hash 40 | ``` 41 | 42 | ```{toctree} 43 | :maxdepth: 1 44 | :caption: Package Index information 45 | 46 | pip_search 47 | pip_index 48 | ``` 49 | 50 | ```{toctree} 51 | :maxdepth: 1 52 | :caption: Managing pip itself 53 | 54 | pip_cache 55 | pip_config 56 | pip_debug 57 | ``` 58 | -------------------------------------------------------------------------------- /src/pip/_internal/distributions/__init__.py: -------------------------------------------------------------------------------- 1 | from pip._internal.distributions.base import AbstractDistribution 2 | from pip._internal.distributions.sdist import SourceDistribution 3 | from pip._internal.distributions.wheel import WheelDistribution 4 | from pip._internal.req.req_install import InstallRequirement 5 | 6 | 7 | def make_distribution_for_install_requirement( 8 | install_req: InstallRequirement, 9 | ) -> AbstractDistribution: 10 | """Returns a Distribution for the given InstallRequirement""" 11 | # Editable requirements will always be source distributions. They use the 12 | # legacy logic until we create a modern standard for them. 13 | if install_req.editable: 14 | return SourceDistribution(install_req) 15 | 16 | # If it's a wheel, it's a WheelDistribution 17 | if install_req.is_wheel: 18 | return WheelDistribution(install_req) 19 | 20 | # Otherwise, a SourceDistribution 21 | return SourceDistribution(install_req) 22 | -------------------------------------------------------------------------------- /tests/functional/test_truststore.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Callable 2 | 3 | import pytest 4 | 5 | from tests.lib import PipTestEnvironment, TestPipResult 6 | 7 | PipRunner = Callable[..., TestPipResult] 8 | 9 | 10 | @pytest.fixture 11 | def pip_no_truststore(script: PipTestEnvironment) -> PipRunner: 12 | def pip(*args: str, **kwargs: Any) -> TestPipResult: 13 | return script.pip(*args, "--use-deprecated=legacy-certs", **kwargs) 14 | 15 | return pip 16 | 17 | 18 | @pytest.mark.network 19 | @pytest.mark.parametrize( 20 | "package", 21 | [ 22 | "INITools", 23 | "https://github.com/pypa/pip-test-package/archive/refs/heads/master.zip", 24 | ], 25 | ids=["PyPI", "GitHub"], 26 | ) 27 | def test_no_truststore_can_install( 28 | script: PipTestEnvironment, 29 | pip_no_truststore: PipRunner, 30 | package: str, 31 | ) -> None: 32 | result = pip_no_truststore("install", package) 33 | assert "Successfully installed" in result.stdout 34 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/pager.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from typing import Any 3 | 4 | 5 | class Pager(ABC): 6 | """Base class for a pager.""" 7 | 8 | @abstractmethod 9 | def show(self, content: str) -> None: 10 | """Show content in pager. 11 | 12 | Args: 13 | content (str): Content to be displayed. 14 | """ 15 | 16 | 17 | class SystemPager(Pager): 18 | """Uses the pager installed on the system.""" 19 | 20 | def _pager(self, content: str) -> Any: #  pragma: no cover 21 | return __import__("pydoc").pager(content) 22 | 23 | def show(self, content: str) -> None: 24 | """Use the same pager used by pydoc.""" 25 | self._pager(content) 26 | 27 | 28 | if __name__ == "__main__": # pragma: no cover 29 | from .__main__ import make_test_card 30 | from .console import Console 31 | 32 | console = Console() 33 | with console.pager(styles=True): 34 | console.print(make_test_card()) 35 | -------------------------------------------------------------------------------- /tools/vendoring/patches/truststore.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/pip/_vendor/truststore/_api.py b/src/pip/_vendor/truststore/_api.py 2 | index 47b7a63ab..d09d3096f 100644 3 | --- a/src/pip/_vendor/truststore/_api.py 4 | +++ b/src/pip/_vendor/truststore/_api.py 5 | @@ -48,12 +48,12 @@ def inject_into_ssl() -> None: 6 | # the truststore patched instance 7 | # also see https://github.com/psf/requests/pull/6667 8 | try: 9 | - import requests.adapters 10 | + from pip._vendor.requests import adapters as requests_adapters 11 | 12 | - preloaded_context = getattr(requests.adapters, "_preloaded_ssl_context", None) 13 | + preloaded_context = getattr(requests_adapters, "_preloaded_ssl_context", None) 14 | if preloaded_context is not None: 15 | setattr( 16 | - requests.adapters, 17 | + requests_adapters, 18 | "_preloaded_ssl_context", 19 | SSLContext(ssl.PROTOCOL_TLS_CLIENT), 20 | ) 21 | -------------------------------------------------------------------------------- /docs/html/cli/pip_index.rst: -------------------------------------------------------------------------------- 1 | .. _`pip index`: 2 | 3 | =========== 4 | pip index 5 | =========== 6 | 7 | 8 | 9 | Usage 10 | ===== 11 | 12 | .. tab:: Unix/macOS 13 | 14 | .. pip-command-usage:: index "python -m pip" 15 | 16 | .. tab:: Windows 17 | 18 | .. pip-command-usage:: index "py -m pip" 19 | 20 | 21 | Description 22 | =========== 23 | 24 | .. pip-command-description:: index 25 | 26 | 27 | 28 | Options 29 | ======= 30 | 31 | .. pip-command-options:: index 32 | 33 | 34 | 35 | Examples 36 | ======== 37 | 38 | #. Search for "peppercorn" versions 39 | 40 | .. tab:: Unix/macOS 41 | 42 | .. code-block:: console 43 | 44 | $ python -m pip index versions peppercorn 45 | peppercorn (0.6) 46 | Available versions: 0.6, 0.5, 0.4, 0.3, 0.2, 0.1 47 | 48 | 49 | .. tab:: Windows 50 | 51 | .. code-block:: console 52 | 53 | C:\> py -m pip index peppercorn 54 | peppercorn (0.6) 55 | Available versions: 0.6, 0.5, 0.4, 0.3, 0.2, 0.1 56 | -------------------------------------------------------------------------------- /docs/html/development/architecture/index.rst: -------------------------------------------------------------------------------- 1 | .. _architecture-pip-internals: 2 | 3 | =============================== 4 | Architecture of pip's internals 5 | =============================== 6 | 7 | .. note:: 8 | 9 | This section of the documentation is currently being written. pip 10 | developers welcome your help to complete this documentation. If 11 | you're interested in helping out, please let us know in the 12 | `tracking issue`_, or just go ahead and submit a pull request and 13 | mention it in that tracking issue. 14 | 15 | .. note:: 16 | 17 | Direct use of pip's internals is *not supported*, and these internals 18 | can change at any time. For more details, see :ref:`Using pip from 19 | your program`. 20 | 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | 25 | overview 26 | anatomy 27 | configuration-files 28 | package-finding 29 | command-line-interface 30 | upgrade-options 31 | 32 | 33 | .. _`tracking issue`: https://github.com/pypa/pip/issues/6831 34 | -------------------------------------------------------------------------------- /docs/html/development/index.rst: -------------------------------------------------------------------------------- 1 | =========== 2 | Development 3 | =========== 4 | 5 | pip is a volunteer maintained open source project and we welcome contributions 6 | of all forms. The sections below will help you get started with development, 7 | testing, and documentation. 8 | 9 | You can also join ``#pypa`` (general packaging discussion and user support) and 10 | ``#pypa-dev`` (discussion about development of packaging tools) `on Libera.chat`_, 11 | or the ``#pip`` channel on the `PyPA Discord`_, to ask questions or get involved. 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | getting-started 17 | contributing 18 | ci 19 | issue-triage 20 | architecture/index 21 | release-process 22 | vendoring-policy 23 | 24 | .. note:: 25 | 26 | pip's development documentation has been rearranged and some older 27 | references might be broken. 28 | 29 | .. _`on Libera.chat`: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev 30 | .. _`PyPA Discord`: https://discord.gg/pypa 31 | -------------------------------------------------------------------------------- /tests/lib/options_helpers.py: -------------------------------------------------------------------------------- 1 | """Provides helper classes for testing option handling in pip""" 2 | 3 | from optparse import Values 4 | 5 | from pip._internal.cli import cmdoptions 6 | from pip._internal.cli.base_command import Command 7 | from pip._internal.commands import CommandInfo, commands_dict 8 | 9 | 10 | class FakeCommand(Command): 11 | def main( # type: ignore[override] 12 | self, args: list[str] 13 | ) -> tuple[Values, list[str]]: 14 | index_opts = cmdoptions.make_option_group( 15 | cmdoptions.index_group, 16 | self.parser, 17 | ) 18 | self.parser.add_option_group(index_opts) 19 | return self.parse_args(args) 20 | 21 | 22 | class AddFakeCommandMixin: 23 | def setup_method(self) -> None: 24 | commands_dict["fake"] = CommandInfo( 25 | "tests.lib.options_helpers", 26 | "FakeCommand", 27 | "fake summary", 28 | ) 29 | 30 | def teardown_method(self) -> None: 31 | commands_dict.pop("fake") 32 | -------------------------------------------------------------------------------- /tests/data/indexes/datarequire/fakepackage/index.html: -------------------------------------------------------------------------------- 1 | 2 | Links for fakepackage

Links for fakepackage

3 | fakepackage-1.0.0.tar.gz
4 | fakepackage-2.6.0.tar.gz
5 | fakepackage-2.7.0.tar.gz
6 | fakepackage-3.3.0.tar.gz
7 | fakepackage-9.9.9.tar.gz
8 | 9 | -------------------------------------------------------------------------------- /tests/functional/test_vcs_bazaar.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains functional tests of the Bazaar class. 3 | """ 4 | 5 | import os 6 | import sys 7 | from pathlib import Path 8 | 9 | import pytest 10 | 11 | from pip._internal.vcs.bazaar import Bazaar 12 | from pip._internal.vcs.versioncontrol import RemoteNotFoundError 13 | 14 | from tests.lib import PipTestEnvironment, is_bzr_installed, need_bzr 15 | 16 | 17 | @pytest.mark.skipif( 18 | sys.platform == "win32" or "CI" not in os.environ, 19 | reason="Bazaar is only required under CI", 20 | ) 21 | def test_ensure_bzr_available() -> None: 22 | """Make sure that bzr is available when running in CI.""" 23 | assert is_bzr_installed() 24 | 25 | 26 | @need_bzr 27 | def test_get_remote_url__no_remote(script: PipTestEnvironment, tmpdir: Path) -> None: 28 | repo_dir = tmpdir / "temp-repo" 29 | repo_dir.mkdir() 30 | 31 | script.run("bzr", "init", os.fspath(repo_dir)) 32 | 33 | with pytest.raises(RemoteNotFoundError): 34 | Bazaar().get_remote_url(os.fspath(repo_dir)) 35 | -------------------------------------------------------------------------------- /tests/unit/test_vcs_mercurial.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains functional tests of the Mercurial class. 3 | """ 4 | 5 | import configparser 6 | import os 7 | from pathlib import Path 8 | 9 | from pip._internal.utils.misc import hide_url 10 | from pip._internal.vcs.mercurial import Mercurial 11 | 12 | from tests.lib import need_mercurial 13 | 14 | 15 | @need_mercurial 16 | def test_mercurial_switch_updates_config_file_when_found(tmpdir: Path) -> None: 17 | hg = Mercurial() 18 | options = hg.make_rev_options() 19 | hg_dir = os.path.join(tmpdir, ".hg") 20 | os.mkdir(hg_dir) 21 | 22 | config = configparser.RawConfigParser() 23 | config.add_section("paths") 24 | config.set("paths", "default", "old_url") 25 | 26 | hgrc_path = os.path.join(hg_dir, "hgrc") 27 | with open(hgrc_path, "w") as f: 28 | config.write(f) 29 | hg.switch(os.fspath(tmpdir), hide_url("new_url"), options) 30 | 31 | config.read(hgrc_path) 32 | 33 | default_path = config.get("paths", "default") 34 | assert default_path == "new_url" 35 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/abc.py: -------------------------------------------------------------------------------- 1 | from abc import ABC 2 | 3 | 4 | class RichRenderable(ABC): 5 | """An abstract base class for Rich renderables. 6 | 7 | Note that there is no need to extend this class, the intended use is to check if an 8 | object supports the Rich renderable protocol. For example:: 9 | 10 | if isinstance(my_object, RichRenderable): 11 | console.print(my_object) 12 | 13 | """ 14 | 15 | @classmethod 16 | def __subclasshook__(cls, other: type) -> bool: 17 | """Check if this class supports the rich render protocol.""" 18 | return hasattr(other, "__rich_console__") or hasattr(other, "__rich__") 19 | 20 | 21 | if __name__ == "__main__": # pragma: no cover 22 | from pip._vendor.rich.text import Text 23 | 24 | t = Text() 25 | print(isinstance(Text, RichRenderable)) 26 | print(isinstance(t, RichRenderable)) 27 | 28 | class Foo: 29 | pass 30 | 31 | f = Foo() 32 | print(isinstance(f, RichRenderable)) 33 | print(isinstance("", RichRenderable)) 34 | -------------------------------------------------------------------------------- /docs/html/topics/python-option.md: -------------------------------------------------------------------------------- 1 | # Managing a different Python interpreter 2 | 3 | ```{versionadded} 22.3 4 | ``` 5 | 6 | Occasionally, you may want to use pip to manage a Python installation other than 7 | the one pip is installed into. In this case, you can use the `--python` option 8 | to specify the interpreter you want to manage. This option can take one of two 9 | values: 10 | 11 | 1. The path to a Python executable. 12 | 2. The path to a virtual environment. 13 | 14 | In both cases, pip will run exactly as if it had been invoked from that Python 15 | environment. 16 | 17 | One example of where this might be useful is to manage a virtual environment 18 | that does not have pip installed. 19 | 20 | ```{pip-cli} 21 | $ python -m venv .venv --without-pip 22 | $ pip --python .venv install SomePackage 23 | [...] 24 | Successfully installed SomePackage 25 | ``` 26 | 27 | You could also use `--python .venv/bin/python` (or on Windows, 28 | `--python .venv\Scripts\python.exe`) if you wanted to be explicit, but the 29 | virtual environment name is shorter and works exactly the same. 30 | -------------------------------------------------------------------------------- /.readthedocs-custom-redirects.yml: -------------------------------------------------------------------------------- 1 | # This file is read by tools/update-rtd-redirects.py. 2 | # It is related to Read the Docs, but is not a file processed by the platform. 3 | 4 | /dev/news-entry-failure: >- 5 | https://pip.pypa.io/en/latest/development/contributing/#news-entries 6 | /errors/resolution-impossible: >- 7 | https://pip.pypa.io/en/stable/topics/dependency-resolution/#dealing-with-dependency-conflicts 8 | /surveys/backtracking: >- 9 | https://forms.gle/LkZP95S4CfqBAU1N6 10 | /warnings/backtracking: >- 11 | https://pip.pypa.io/en/stable/topics/dependency-resolution/#possible-ways-to-reduce-backtracking 12 | /warnings/enable-long-paths: >- 13 | https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later 14 | /warnings/venv: >- 15 | https://docs.python.org/3/tutorial/venv.html 16 | /reference/build-system/pyproject-toml: >- 17 | https://pip.pypa.io/en/stable/reference/build-system/ 18 | /reference/build-system/setup-py: >- 19 | https://pip.pypa.io/en/stable/reference/build-system/ 20 | -------------------------------------------------------------------------------- /src/pip/_vendor/certifi/LICENSE: -------------------------------------------------------------------------------- 1 | This package contains a modified version of ca-bundle.crt: 2 | 3 | ca-bundle.crt -- Bundle of CA Root Certificates 4 | 5 | This is a bundle of X.509 certificates of public Certificate Authorities 6 | (CA). These were automatically extracted from Mozilla's root certificates 7 | file (certdata.txt). This file can be found in the mozilla source tree: 8 | https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt 9 | It contains the certificates in PEM format and therefore 10 | can be directly used with curl / libcurl / php_curl, or with 11 | an Apache+mod_ssl webserver for SSL client authentication. 12 | Just configure this file as the SSLCACertificateFile.# 13 | 14 | ***** BEGIN LICENSE BLOCK ***** 15 | This Source Code Form is subject to the terms of the Mozilla Public License, 16 | v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain 17 | one at http://mozilla.org/MPL/2.0/. 18 | 19 | ***** END LICENSE BLOCK ***** 20 | @(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $ 21 | -------------------------------------------------------------------------------- /src/pip/_vendor/idna/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import ( 2 | IDNABidiError, 3 | IDNAError, 4 | InvalidCodepoint, 5 | InvalidCodepointContext, 6 | alabel, 7 | check_bidi, 8 | check_hyphen_ok, 9 | check_initial_combiner, 10 | check_label, 11 | check_nfc, 12 | decode, 13 | encode, 14 | ulabel, 15 | uts46_remap, 16 | valid_contextj, 17 | valid_contexto, 18 | valid_label_length, 19 | valid_string_length, 20 | ) 21 | from .intranges import intranges_contain 22 | from .package_data import __version__ 23 | 24 | __all__ = [ 25 | "__version__", 26 | "IDNABidiError", 27 | "IDNAError", 28 | "InvalidCodepoint", 29 | "InvalidCodepointContext", 30 | "alabel", 31 | "check_bidi", 32 | "check_hyphen_ok", 33 | "check_initial_combiner", 34 | "check_label", 35 | "check_nfc", 36 | "decode", 37 | "encode", 38 | "intranges_contain", 39 | "ulabel", 40 | "uts46_remap", 41 | "valid_contextj", 42 | "valid_contexto", 43 | "valid_label_length", 44 | "valid_string_length", 45 | ] 46 | -------------------------------------------------------------------------------- /src/pip/_internal/distributions/installed.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING 4 | 5 | from pip._internal.distributions.base import AbstractDistribution 6 | from pip._internal.metadata import BaseDistribution 7 | 8 | if TYPE_CHECKING: 9 | from pip._internal.build_env import BuildEnvironmentInstaller 10 | 11 | 12 | class InstalledDistribution(AbstractDistribution): 13 | """Represents an installed package. 14 | 15 | This does not need any preparation as the required information has already 16 | been computed. 17 | """ 18 | 19 | @property 20 | def build_tracker_id(self) -> str | None: 21 | return None 22 | 23 | def get_metadata_distribution(self) -> BaseDistribution: 24 | assert self.req.satisfied_by is not None, "not actually installed" 25 | return self.req.satisfied_by 26 | 27 | def prepare_distribution_metadata( 28 | self, 29 | build_env_installer: BuildEnvironmentInstaller, 30 | build_isolation: bool, 31 | check_build_deps: bool, 32 | ) -> None: 33 | pass 34 | -------------------------------------------------------------------------------- /src/pip/_vendor/pkg_resources/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to 3 | deal in the Software without restriction, including without limitation the 4 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 5 | sell copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 16 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 17 | IN THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /tests/lib/compat.py: -------------------------------------------------------------------------------- 1 | # mypy: no-warn-unused-ignores 2 | 3 | import contextlib 4 | import signal 5 | from collections.abc import Iterator 6 | from contextlib import AbstractContextManager 7 | from typing import Callable 8 | 9 | # Applies on Windows. 10 | if not hasattr(signal, "pthread_sigmask"): 11 | # We're not relying on this behavior anywhere currently, it's just best 12 | # practice. 13 | blocked_signals: Callable[[], AbstractContextManager[None]] = contextlib.nullcontext 14 | else: 15 | 16 | @contextlib.contextmanager 17 | def blocked_signals() -> Iterator[None]: 18 | """Block all signals for e.g. starting a worker thread.""" 19 | mask = signal.valid_signals() 20 | 21 | old_mask = signal.pthread_sigmask( # type: ignore[attr-defined] 22 | signal.SIG_SETMASK, # type: ignore[attr-defined] 23 | mask, 24 | ) 25 | try: 26 | yield 27 | finally: 28 | signal.pthread_sigmask( # type: ignore[attr-defined] 29 | signal.SIG_SETMASK, # type: ignore[attr-defined] 30 | old_mask, 31 | ) 32 | -------------------------------------------------------------------------------- /tests/lib/filesystem.py: -------------------------------------------------------------------------------- 1 | """Helpers for filesystem-dependent tests.""" 2 | 3 | from __future__ import annotations 4 | 5 | import os 6 | from collections.abc import Iterator 7 | from contextlib import contextmanager 8 | from functools import partial 9 | from itertools import chain 10 | from pathlib import Path 11 | 12 | 13 | def get_filelist(base: str) -> set[str]: 14 | def join(dirpath: str, dirnames: list[str], filenames: list[str]) -> Iterator[str]: 15 | relative_dirpath = os.path.relpath(dirpath, base) 16 | join_dirpath = partial(os.path.join, relative_dirpath) 17 | return chain( 18 | (join_dirpath(p) for p in dirnames), 19 | (join_dirpath(p) for p in filenames), 20 | ) 21 | 22 | return set(chain.from_iterable(join(*dirinfo) for dirinfo in os.walk(base))) 23 | 24 | 25 | @contextmanager 26 | def chmod(path: str | Path, mode: int) -> Iterator[None]: 27 | """Contextmanager to temporarily update a path's mode.""" 28 | old_mode = os.stat(path).st_mode 29 | try: 30 | os.chmod(path, mode) 31 | yield 32 | finally: 33 | os.chmod(path, old_mode) 34 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Will McGugan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /tests/functional/test_vcs_subversion.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pytest 4 | 5 | from pip._internal.vcs.subversion import Subversion 6 | from pip._internal.vcs.versioncontrol import RemoteNotFoundError 7 | 8 | from tests.lib import PipTestEnvironment, _create_svn_repo, need_svn 9 | 10 | 11 | @need_svn 12 | def test_get_remote_url__no_remote(script: PipTestEnvironment, tmpdir: Path) -> None: 13 | repo_path = tmpdir / "temp-repo" 14 | repo_path.mkdir() 15 | repo_dir = str(repo_path) 16 | 17 | _create_svn_repo(script.scratch_path, repo_dir) 18 | 19 | with pytest.raises(RemoteNotFoundError): 20 | Subversion().get_remote_url(repo_dir) 21 | 22 | 23 | @need_svn 24 | def test_get_remote_url__no_remote_with_setup( 25 | script: PipTestEnvironment, tmpdir: Path 26 | ) -> None: 27 | repo_path = tmpdir / "temp-repo" 28 | repo_path.mkdir() 29 | setup = repo_path / "setup.py" 30 | setup.touch() 31 | repo_dir = str(repo_path) 32 | 33 | _create_svn_repo(script.scratch_path, repo_dir) 34 | 35 | with pytest.raises(RemoteNotFoundError): 36 | Subversion().get_remote_url(repo_dir) 37 | -------------------------------------------------------------------------------- /docs/man/index.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | ======== 4 | Man Page 5 | ======== 6 | 7 | SYNOPSIS 8 | ******** 9 | 10 | pip [options] 11 | 12 | DESCRIPTION 13 | *********** 14 | 15 | pip is the PyPA recommended package manager for Python packages 16 | 17 | OPTIONS 18 | ******* 19 | 20 | .. pip-general-options:: 21 | 22 | COMMANDS 23 | ******** 24 | 25 | pip-install(1) 26 | Install packages. 27 | 28 | pip-download(1) 29 | Download packages. 30 | 31 | pip-uninstall(1) 32 | Uninstall packages. 33 | 34 | pip-freeze(1) 35 | Output installed packages in requirements format. 36 | 37 | pip-lock(1) 38 | Generate a lock file for requirements and their dependencies. 39 | 40 | pip-list(1) 41 | List installed packages. 42 | 43 | pip-show(1) 44 | Show information about installed packages. 45 | 46 | pip-check(1) 47 | Verify installed packages have compatible dependencies. 48 | 49 | pip-search(1) 50 | Search PyPI for packages. 51 | 52 | pip-wheel(1) 53 | Build wheels from your requirements. 54 | 55 | pip-hash(1) 56 | Compute hashes of package archives. 57 | 58 | pip-help(1) 59 | Show help for pip commands. 60 | -------------------------------------------------------------------------------- /src/pip/_vendor/dependency_groups/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-present Stephen Rosen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/contrib/_appengine_environ.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module provides means to detect the App Engine environment. 3 | """ 4 | 5 | import os 6 | 7 | 8 | def is_appengine(): 9 | return is_local_appengine() or is_prod_appengine() 10 | 11 | 12 | def is_appengine_sandbox(): 13 | """Reports if the app is running in the first generation sandbox. 14 | 15 | The second generation runtimes are technically still in a sandbox, but it 16 | is much less restrictive, so generally you shouldn't need to check for it. 17 | see https://cloud.google.com/appengine/docs/standard/runtimes 18 | """ 19 | return is_appengine() and os.environ["APPENGINE_RUNTIME"] == "python27" 20 | 21 | 22 | def is_local_appengine(): 23 | return "APPENGINE_RUNTIME" in os.environ and os.environ.get( 24 | "SERVER_SOFTWARE", "" 25 | ).startswith("Development/") 26 | 27 | 28 | def is_prod_appengine(): 29 | return "APPENGINE_RUNTIME" in os.environ and os.environ.get( 30 | "SERVER_SOFTWARE", "" 31 | ).startswith("Google App Engine/") 32 | 33 | 34 | def is_prod_appengine_mvms(): 35 | """Deprecated.""" 36 | return False 37 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-present The pip developers (see AUTHORS.txt file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/pip/_internal/models/index.py: -------------------------------------------------------------------------------- 1 | import urllib.parse 2 | 3 | 4 | class PackageIndex: 5 | """Represents a Package Index and provides easier access to endpoints""" 6 | 7 | __slots__ = ["url", "netloc", "simple_url", "pypi_url", "file_storage_domain"] 8 | 9 | def __init__(self, url: str, file_storage_domain: str) -> None: 10 | super().__init__() 11 | self.url = url 12 | self.netloc = urllib.parse.urlsplit(url).netloc 13 | self.simple_url = self._url_for_path("simple") 14 | self.pypi_url = self._url_for_path("pypi") 15 | 16 | # This is part of a temporary hack used to block installs of PyPI 17 | # packages which depend on external urls only necessary until PyPI can 18 | # block such packages themselves 19 | self.file_storage_domain = file_storage_domain 20 | 21 | def _url_for_path(self, path: str) -> str: 22 | return urllib.parse.urljoin(self.url, path) 23 | 24 | 25 | PyPI = PackageIndex("https://pypi.org/", file_storage_domain="files.pythonhosted.org") 26 | TestPyPI = PackageIndex( 27 | "https://test.pypi.org/", file_storage_domain="test-files.pythonhosted.org" 28 | ) 29 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Taneli Hukkinen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/tomli_w/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Taneli Hukkinen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/requests/packages.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from .compat import chardet 4 | 5 | # This code exists for backwards compatibility reasons. 6 | # I don't like it either. Just look the other way. :) 7 | 8 | for package in ("urllib3", "idna"): 9 | vendored_package = "pip._vendor." + package 10 | locals()[package] = __import__(vendored_package) 11 | # This traversal is apparently necessary such that the identities are 12 | # preserved (requests.packages.urllib3.* is urllib3.*) 13 | for mod in list(sys.modules): 14 | if mod == vendored_package or mod.startswith(vendored_package + '.'): 15 | unprefixed_mod = mod[len("pip._vendor."):] 16 | sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod] 17 | 18 | if chardet is not None: 19 | target = chardet.__name__ 20 | for mod in list(sys.modules): 21 | if mod == target or mod.startswith(f"{target}."): 22 | imported_mod = sys.modules[mod] 23 | sys.modules[f"requests.packages.{mod}"] = imported_mod 24 | mod = mod.replace(target, "chardet") 25 | sys.modules[f"requests.packages.{mod}"] = imported_mod 26 | -------------------------------------------------------------------------------- /src/pip/_vendor/pyproject_hooks/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Thomas Kluyver 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/truststore/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Seth Michael Larson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/platformdirs/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2010-202x The platformdirs developers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_internal/utils/_log.py: -------------------------------------------------------------------------------- 1 | """Customize logging 2 | 3 | Defines custom logger class for the `logger.verbose(...)` method. 4 | 5 | init_logging() must be called before any other modules that call logging.getLogger. 6 | """ 7 | 8 | import logging 9 | from typing import Any, cast 10 | 11 | # custom log level for `--verbose` output 12 | # between DEBUG and INFO 13 | VERBOSE = 15 14 | 15 | 16 | class VerboseLogger(logging.Logger): 17 | """Custom Logger, defining a verbose log-level 18 | 19 | VERBOSE is between INFO and DEBUG. 20 | """ 21 | 22 | def verbose(self, msg: str, *args: Any, **kwargs: Any) -> None: 23 | return self.log(VERBOSE, msg, *args, **kwargs) 24 | 25 | 26 | def getLogger(name: str) -> VerboseLogger: 27 | """logging.getLogger, but ensures our VerboseLogger class is returned""" 28 | return cast(VerboseLogger, logging.getLogger(name)) 29 | 30 | 31 | def init_logging() -> None: 32 | """Register our VerboseLogger and VERBOSE log level. 33 | 34 | Should be called before any calls to getLogger(), 35 | i.e. in pip._internal.__init__ 36 | """ 37 | logging.setLoggerClass(VerboseLogger) 38 | logging.addLevelName(VERBOSE, "VERBOSE") 39 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/diagnose.py: -------------------------------------------------------------------------------- 1 | import os 2 | import platform 3 | 4 | from pip._vendor.rich import inspect 5 | from pip._vendor.rich.console import Console, get_windows_console_features 6 | from pip._vendor.rich.panel import Panel 7 | from pip._vendor.rich.pretty import Pretty 8 | 9 | 10 | def report() -> None: # pragma: no cover 11 | """Print a report to the terminal with debugging information""" 12 | console = Console() 13 | inspect(console) 14 | features = get_windows_console_features() 15 | inspect(features) 16 | 17 | env_names = ( 18 | "CLICOLOR", 19 | "COLORTERM", 20 | "COLUMNS", 21 | "JPY_PARENT_PID", 22 | "JUPYTER_COLUMNS", 23 | "JUPYTER_LINES", 24 | "LINES", 25 | "NO_COLOR", 26 | "TERM_PROGRAM", 27 | "TERM", 28 | "TTY_COMPATIBLE", 29 | "TTY_INTERACTIVE", 30 | "VSCODE_VERBOSE_LOGGING", 31 | ) 32 | env = {name: os.getenv(name) for name in env_names} 33 | console.print(Panel.fit((Pretty(env)), title="[b]Environment Variables")) 34 | 35 | console.print(f'platform="{platform.system()}"') 36 | 37 | 38 | if __name__ == "__main__": # pragma: no cover 39 | report() 40 | -------------------------------------------------------------------------------- /src/pip/_vendor/pygments/modeline.py: -------------------------------------------------------------------------------- 1 | """ 2 | pygments.modeline 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | A simple modeline parser (based on pymodeline). 6 | 7 | :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | """ 10 | 11 | import re 12 | 13 | __all__ = ['get_filetype_from_buffer'] 14 | 15 | 16 | modeline_re = re.compile(r''' 17 | (?: vi | vim | ex ) (?: [<=>]? \d* )? : 18 | .* (?: ft | filetype | syn | syntax ) = ( [^:\s]+ ) 19 | ''', re.VERBOSE) 20 | 21 | 22 | def get_filetype_from_line(l): # noqa: E741 23 | m = modeline_re.search(l) 24 | if m: 25 | return m.group(1) 26 | 27 | 28 | def get_filetype_from_buffer(buf, max_lines=5): 29 | """ 30 | Scan the buffer for modelines and return filetype if one is found. 31 | """ 32 | lines = buf.splitlines() 33 | for line in lines[-1:-max_lines-1:-1]: 34 | ret = get_filetype_from_line(line) 35 | if ret: 36 | return ret 37 | for i in range(max_lines, -1, -1): 38 | if i < len(lines): 39 | ret = get_filetype_from_line(lines[i]) 40 | if ret: 41 | return ret 42 | 43 | return None 44 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2008-2020 Andrey Petrov and contributors (see CONTRIBUTORS.txt) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/_emoji_replace.py: -------------------------------------------------------------------------------- 1 | from typing import Callable, Match, Optional 2 | import re 3 | 4 | from ._emoji_codes import EMOJI 5 | 6 | 7 | _ReStringMatch = Match[str] # regex match object 8 | _ReSubCallable = Callable[[_ReStringMatch], str] # Callable invoked by re.sub 9 | _EmojiSubMethod = Callable[[_ReSubCallable, str], str] # Sub method of a compiled re 10 | 11 | 12 | def _emoji_replace( 13 | text: str, 14 | default_variant: Optional[str] = None, 15 | _emoji_sub: _EmojiSubMethod = re.compile(r"(:(\S*?)(?:(?:\-)(emoji|text))?:)").sub, 16 | ) -> str: 17 | """Replace emoji code in text.""" 18 | get_emoji = EMOJI.__getitem__ 19 | variants = {"text": "\uFE0E", "emoji": "\uFE0F"} 20 | get_variant = variants.get 21 | default_variant_code = variants.get(default_variant, "") if default_variant else "" 22 | 23 | def do_replace(match: Match[str]) -> str: 24 | emoji_code, emoji_name, variant = match.groups() 25 | try: 26 | return get_emoji(emoji_name.lower()) + get_variant( 27 | variant, default_variant_code 28 | ) 29 | except KeyError: 30 | return emoji_code 31 | 32 | return _emoji_sub(do_replace, text) 33 | -------------------------------------------------------------------------------- /tests/data/packages/BrokenEmitsUTF8/setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from distutils.core import setup 3 | 4 | 5 | class FakeError(Exception): 6 | pass 7 | 8 | 9 | if sys.argv[1] in ("install", "bdist_wheel"): 10 | if hasattr(sys.stdout, "buffer"): 11 | sys.stdout.buffer.write( 12 | "\nThis package prints out UTF-8 stuff like:\n".encode() 13 | ) 14 | sys.stdout.buffer.write("* return type of ‘main’ is not ‘int’\n".encode()) 15 | sys.stdout.buffer.write( 16 | "* Björk Guðmundsdóttir [ˈpjœr̥k ˈkvʏðmʏntsˌtoʊhtɪr]".encode() 17 | ) 18 | else: 19 | pass 20 | sys.stdout.write("\nThis package prints out UTF-8 stuff like:\n") 21 | sys.stdout.write( 22 | "* return type of \xe2\x80\x98main\xe2\x80\x99 is not \xe2\x80\x98int\xe2\x80\x99\n" 23 | ) 24 | sys.stdout.write( 25 | "* Bj\xc3\xb6rk Gu\xc3\xb0mundsd\xc3\xb3ttir [\xcb\x88pj\xc5\x93r\xcc\xa5k \xcb\x88kv\xca\x8f\xc3\xb0m\xca\x8fnts\xcb\x8cto\xca\x8aht\xc9\xaar]\n" 26 | ) 27 | 28 | raise FakeError("this package designed to fail on install") 29 | 30 | setup( 31 | name="broken", 32 | version="0.2", 33 | py_modules=["broken"], 34 | ) 35 | -------------------------------------------------------------------------------- /tools/vendoring/patches/pkg_resources.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/pip/_vendor/pkg_resources/__init__.py b/src/pip/_vendor/pkg_resources/__init__.py 2 | index d47df3f3c..415c0c432 100644 3 | --- a/src/pip/_vendor/pkg_resources/__init__.py 4 | +++ b/src/pip/_vendor/pkg_resources/__init__.py 5 | @@ -87,7 +87,7 @@ except ImportError: 6 | # no write support, probably under GAE 7 | WRITE_SUPPORT = False 8 | 9 | -from pkg_resources.extern.jaraco.text import ( 10 | +from pip._internal.utils._jaraco_text import ( 11 | yield_lines, 12 | drop_comment, 13 | join_continuation, 14 | @@ -102,12 +102,11 @@ if TYPE_CHECKING: 15 | from _typeshed import BytesPath, StrPath, StrOrBytesPath 16 | from typing_extensions import Self 17 | 18 | -warnings.warn( 19 | - "pkg_resources is deprecated as an API. " 20 | - "See https://setuptools.pypa.io/en/latest/pkg_resources.html", 21 | - DeprecationWarning, 22 | - stacklevel=2, 23 | -) 24 | + 25 | +# Patch: Remove deprecation warning from vendored pkg_resources. 26 | +# Setting PYTHONWARNINGS=error to verify builds produce no warnings 27 | +# causes immediate exceptions. 28 | +# See https://github.com/pypa/pip/issues/12243 29 | 30 | 31 | _T = TypeVar("_T") 32 | -------------------------------------------------------------------------------- /tools/vendoring/patches/urllib3.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/pip/_vendor/urllib3/contrib/securetransport.py b/src/pip/_vendor/urllib3/contrib/securetransport.py 2 | index b97555454..189132baa 100644 3 | --- a/src/pip/_vendor/urllib3/contrib/securetransport.py 4 | +++ b/src/pip/_vendor/urllib3/contrib/securetransport.py 5 | @@ -19,8 +19,8 @@ 6 | 7 | To use this module, simply import and inject it:: 8 | 9 | - import urllib3.contrib.securetransport 10 | - urllib3.contrib.securetransport.inject_into_urllib3() 11 | + import urllib3.contrib.securetransport as securetransport 12 | + securetransport.inject_into_urllib3() 13 | 14 | Happy TLSing! 15 | 16 | diff --git a/src/pip/_vendor/urllib3/contrib/pyopenssl.py b/src/pip/_vendor/urllib3/contrib/pyopenssl.py 17 | index c43146279..4cded53f6 100644 18 | --- a/src/pip/_vendor/urllib3/contrib/pyopenssl.py 19 | +++ b/src/pip/_vendor/urllib3/contrib/pyopenssl.py 20 | @@ -28,7 +28,7 @@ 21 | .. code-block:: python 22 | 23 | try: 24 | - import urllib3.contrib.pyopenssl 25 | - urllib3.contrib.pyopenssl.inject_into_urllib3() 26 | + import urllib3.contrib.pyopenssl as pyopenssl 27 | + pyopenssl.inject_into_urllib3() 28 | except ImportError: 29 | pass 30 | -------------------------------------------------------------------------------- /src/pip/_vendor/rich/color_triplet.py: -------------------------------------------------------------------------------- 1 | from typing import NamedTuple, Tuple 2 | 3 | 4 | class ColorTriplet(NamedTuple): 5 | """The red, green, and blue components of a color.""" 6 | 7 | red: int 8 | """Red component in 0 to 255 range.""" 9 | green: int 10 | """Green component in 0 to 255 range.""" 11 | blue: int 12 | """Blue component in 0 to 255 range.""" 13 | 14 | @property 15 | def hex(self) -> str: 16 | """get the color triplet in CSS style.""" 17 | red, green, blue = self 18 | return f"#{red:02x}{green:02x}{blue:02x}" 19 | 20 | @property 21 | def rgb(self) -> str: 22 | """The color in RGB format. 23 | 24 | Returns: 25 | str: An rgb color, e.g. ``"rgb(100,23,255)"``. 26 | """ 27 | red, green, blue = self 28 | return f"rgb({red},{green},{blue})" 29 | 30 | @property 31 | def normalized(self) -> Tuple[float, float, float]: 32 | """Convert components into floats between 0 and 1. 33 | 34 | Returns: 35 | Tuple[float, float, float]: A tuple of three normalized colour components. 36 | """ 37 | red, green, blue = self 38 | return red / 255.0, green / 255.0, blue / 255.0 39 | -------------------------------------------------------------------------------- /src/pip/_vendor/distro/__init__.py: -------------------------------------------------------------------------------- 1 | from .distro import ( 2 | NORMALIZED_DISTRO_ID, 3 | NORMALIZED_LSB_ID, 4 | NORMALIZED_OS_ID, 5 | LinuxDistribution, 6 | __version__, 7 | build_number, 8 | codename, 9 | distro_release_attr, 10 | distro_release_info, 11 | id, 12 | info, 13 | like, 14 | linux_distribution, 15 | lsb_release_attr, 16 | lsb_release_info, 17 | major_version, 18 | minor_version, 19 | name, 20 | os_release_attr, 21 | os_release_info, 22 | uname_attr, 23 | uname_info, 24 | version, 25 | version_parts, 26 | ) 27 | 28 | __all__ = [ 29 | "NORMALIZED_DISTRO_ID", 30 | "NORMALIZED_LSB_ID", 31 | "NORMALIZED_OS_ID", 32 | "LinuxDistribution", 33 | "build_number", 34 | "codename", 35 | "distro_release_attr", 36 | "distro_release_info", 37 | "id", 38 | "info", 39 | "like", 40 | "linux_distribution", 41 | "lsb_release_attr", 42 | "lsb_release_info", 43 | "major_version", 44 | "minor_version", 45 | "name", 46 | "os_release_attr", 47 | "os_release_info", 48 | "uname_attr", 49 | "uname_info", 50 | "version", 51 | "version_parts", 52 | ] 53 | 54 | __version__ = __version__ 55 | -------------------------------------------------------------------------------- /tools/release/check_version.py: -------------------------------------------------------------------------------- 1 | """Checks if the version is acceptable, as per this project's release process.""" 2 | 3 | from __future__ import annotations 4 | 5 | import sys 6 | from datetime import datetime 7 | 8 | from packaging.version import InvalidVersion, Version 9 | 10 | 11 | def is_this_a_good_version_number(string: str) -> str | None: 12 | try: 13 | v = Version(string) 14 | except InvalidVersion as e: 15 | return str(e) 16 | 17 | if v.local: 18 | return "Nope. PyPI refuses local release versions." 19 | 20 | if v.dev: 21 | return "No development releases on PyPI. What are you even thinking?" 22 | 23 | if v.pre and v.pre[0] != "b": 24 | return "Only beta releases are allowed. No alphas." 25 | 26 | release = v.release 27 | expected_major = datetime.now().year % 100 28 | 29 | if len(release) not in [2, 3]: 30 | return f"Not of the form: {expected_major}.N or {expected_major}.N.P" 31 | 32 | return None 33 | 34 | 35 | def main() -> None: 36 | problem = is_this_a_good_version_number(sys.argv[1]) 37 | if problem is not None: 38 | print("ERROR:", problem) 39 | sys.exit(1) 40 | 41 | 42 | if __name__ == "__main__": 43 | main() 44 | -------------------------------------------------------------------------------- /tests/unit/test_pep517.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | from textwrap import dedent 4 | 5 | import pytest 6 | 7 | from pip._internal.exceptions import InvalidPyProjectBuildRequires 8 | from pip._internal.req import InstallRequirement 9 | 10 | 11 | @pytest.mark.parametrize( 12 | "spec", [("./foo",), ("git+https://example.com/pkg@dev#egg=myproj",)] 13 | ) 14 | def test_pep517_parsing_checks_requirements(tmpdir: Path, spec: tuple[str]) -> None: 15 | tmpdir.joinpath("pyproject.toml").write_text( 16 | dedent( 17 | f""" 18 | [build-system] 19 | requires = [{spec[0]!r}] 20 | build-backend = "foo" 21 | """ 22 | ) 23 | ) 24 | req = InstallRequirement(None, None) 25 | req.source_dir = os.fspath(tmpdir) # make req believe it has been unpacked 26 | 27 | with pytest.raises(InvalidPyProjectBuildRequires) as e: 28 | req.load_pyproject_toml() 29 | 30 | error = e.value 31 | 32 | assert str(req) in error.message 33 | assert error.context 34 | assert "build-system.requires" in error.context 35 | assert "contains an invalid requirement" in error.context 36 | assert error.hint_stmt 37 | assert "PEP 518" in error.hint_stmt 38 | -------------------------------------------------------------------------------- /tests/unit/test_network_utils.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from pip._internal.exceptions import NetworkConnectionError 4 | from pip._internal.network.utils import raise_for_status 5 | 6 | from tests.lib.requests_mocks import MockResponse 7 | 8 | 9 | @pytest.mark.parametrize( 10 | "status_code, error_type", 11 | [ 12 | (401, "Client Error"), 13 | (501, "Server Error"), 14 | ], 15 | ) 16 | def test_raise_for_status_raises_exception(status_code: int, error_type: str) -> None: 17 | contents = b"downloaded" 18 | resp = MockResponse(contents) 19 | resp.status_code = status_code 20 | resp.url = "http://www.example.com/whatever.tgz" 21 | resp.reason = "Network Error" 22 | with pytest.raises(NetworkConnectionError) as excinfo: 23 | raise_for_status(resp) 24 | assert str(excinfo.value) == ( 25 | f"{status_code} {error_type}: Network Error for url:" 26 | " http://www.example.com/whatever.tgz" 27 | ) 28 | 29 | 30 | def test_raise_for_status_does_not_raises_exception() -> None: 31 | contents = b"downloaded" 32 | resp = MockResponse(contents) 33 | resp.status_code = 201 34 | resp.url = "http://www.example.com/whatever.tgz" 35 | resp.reason = "No error" 36 | raise_for_status(resp) 37 | -------------------------------------------------------------------------------- /src/pip/_vendor/truststore/_ssl_constants.py: -------------------------------------------------------------------------------- 1 | import ssl 2 | import sys 3 | import typing 4 | 5 | # Hold on to the original class so we can create it consistently 6 | # even if we inject our own SSLContext into the ssl module. 7 | _original_SSLContext = ssl.SSLContext 8 | _original_super_SSLContext = super(_original_SSLContext, _original_SSLContext) 9 | 10 | # CPython is known to be good, but non-CPython implementations 11 | # may implement SSLContext differently so to be safe we don't 12 | # subclass the SSLContext. 13 | 14 | # This is returned by truststore.SSLContext.__class__() 15 | _truststore_SSLContext_dunder_class: typing.Optional[type] 16 | 17 | # This value is the superclass of truststore.SSLContext. 18 | _truststore_SSLContext_super_class: type 19 | 20 | if sys.implementation.name == "cpython": 21 | _truststore_SSLContext_super_class = _original_SSLContext 22 | _truststore_SSLContext_dunder_class = None 23 | else: 24 | _truststore_SSLContext_super_class = object 25 | _truststore_SSLContext_dunder_class = _original_SSLContext 26 | 27 | 28 | def _set_ssl_context_verify_mode( 29 | ssl_context: ssl.SSLContext, verify_mode: ssl.VerifyMode 30 | ) -> None: 31 | _original_super_SSLContext.verify_mode.__set__(ssl_context, verify_mode) # type: ignore[attr-defined] 32 | -------------------------------------------------------------------------------- /src/pip/_internal/commands/help.py: -------------------------------------------------------------------------------- 1 | from optparse import Values 2 | 3 | from pip._internal.cli.base_command import Command 4 | from pip._internal.cli.status_codes import SUCCESS 5 | from pip._internal.exceptions import CommandError 6 | 7 | 8 | class HelpCommand(Command): 9 | """Show help for commands""" 10 | 11 | usage = """ 12 | %prog """ 13 | ignore_require_venv = True 14 | 15 | def run(self, options: Values, args: list[str]) -> int: 16 | from pip._internal.commands import ( 17 | commands_dict, 18 | create_command, 19 | get_similar_commands, 20 | ) 21 | 22 | try: 23 | # 'pip help' with no args is handled by pip.__init__.parseopt() 24 | cmd_name = args[0] # the command we need help for 25 | except IndexError: 26 | return SUCCESS 27 | 28 | if cmd_name not in commands_dict: 29 | guess = get_similar_commands(cmd_name) 30 | 31 | msg = [f'unknown command "{cmd_name}"'] 32 | if guess: 33 | msg.append(f'maybe you meant "{guess}"') 34 | 35 | raise CommandError(" - ".join(msg)) 36 | 37 | command = create_command(cmd_name) 38 | command.parser.print_help() 39 | 40 | return SUCCESS 41 | -------------------------------------------------------------------------------- /src/pip/_vendor/msgpack/exceptions.py: -------------------------------------------------------------------------------- 1 | class UnpackException(Exception): 2 | """Base class for some exceptions raised while unpacking. 3 | 4 | NOTE: unpack may raise exception other than subclass of 5 | UnpackException. If you want to catch all error, catch 6 | Exception instead. 7 | """ 8 | 9 | 10 | class BufferFull(UnpackException): 11 | pass 12 | 13 | 14 | class OutOfData(UnpackException): 15 | pass 16 | 17 | 18 | class FormatError(ValueError, UnpackException): 19 | """Invalid msgpack format""" 20 | 21 | 22 | class StackError(ValueError, UnpackException): 23 | """Too nested""" 24 | 25 | 26 | # Deprecated. Use ValueError instead 27 | UnpackValueError = ValueError 28 | 29 | 30 | class ExtraData(UnpackValueError): 31 | """ExtraData is raised when there is trailing data. 32 | 33 | This exception is raised while only one-shot (not streaming) 34 | unpack. 35 | """ 36 | 37 | def __init__(self, unpacked, extra): 38 | self.unpacked = unpacked 39 | self.extra = extra 40 | 41 | def __str__(self): 42 | return "unpack(b) received extra data." 43 | 44 | 45 | # Deprecated. Use Exception instead to catch all exception during packing. 46 | PackException = Exception 47 | PackValueError = ValueError 48 | PackOverflowError = OverflowError 49 | -------------------------------------------------------------------------------- /src/pip/_internal/operations/build/wheel.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import logging 4 | import os 5 | 6 | from pip._vendor.pyproject_hooks import BuildBackendHookCaller 7 | 8 | from pip._internal.utils.subprocess import runner_with_spinner_message 9 | 10 | logger = logging.getLogger(__name__) 11 | 12 | 13 | def build_wheel_pep517( 14 | name: str, 15 | backend: BuildBackendHookCaller, 16 | metadata_directory: str, 17 | wheel_directory: str, 18 | ) -> str | None: 19 | """Build one InstallRequirement using the PEP 517 build process. 20 | 21 | Returns path to wheel if successfully built. Otherwise, returns None. 22 | """ 23 | assert metadata_directory is not None 24 | try: 25 | logger.debug("Destination directory: %s", wheel_directory) 26 | 27 | runner = runner_with_spinner_message( 28 | f"Building wheel for {name} (pyproject.toml)" 29 | ) 30 | with backend.subprocess_runner(runner): 31 | wheel_name = backend.build_wheel( 32 | wheel_directory=wheel_directory, 33 | metadata_directory=metadata_directory, 34 | ) 35 | except Exception: 36 | logger.error("Failed building wheel for %s", name) 37 | return None 38 | return os.path.join(wheel_directory, wheel_name) 39 | -------------------------------------------------------------------------------- /tools/protected_pip.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import os 4 | import pathlib 5 | import shutil 6 | import subprocess 7 | import sys 8 | from collections.abc import Iterable 9 | from glob import glob 10 | 11 | VIRTUAL_ENV = os.environ["VIRTUAL_ENV"] 12 | TOX_PIP_DIR = os.path.join(VIRTUAL_ENV, "pip") 13 | 14 | 15 | def pip(args: Iterable[str | pathlib.Path]) -> None: 16 | # First things first, get a recent (stable) version of pip. 17 | if not os.path.exists(TOX_PIP_DIR): 18 | subprocess.check_call( 19 | [ 20 | sys.executable, 21 | "-m", 22 | "pip", 23 | "--disable-pip-version-check", 24 | "install", 25 | "-t", 26 | TOX_PIP_DIR, 27 | "pip", 28 | ] 29 | ) 30 | shutil.rmtree(glob(os.path.join(TOX_PIP_DIR, "pip-*.dist-info"))[0]) 31 | # And use that version. 32 | pypath_env = os.environ.get("PYTHONPATH") 33 | pypath = pypath_env.split(os.pathsep) if pypath_env is not None else [] 34 | pypath.insert(0, TOX_PIP_DIR) 35 | os.environ["PYTHONPATH"] = os.pathsep.join(pypath) 36 | subprocess.check_call([sys.executable, "-m", "pip", *(os.fspath(a) for a in args)]) 37 | 38 | 39 | if __name__ == "__main__": 40 | pip(sys.argv[1:]) 41 | -------------------------------------------------------------------------------- /tools/vendoring/patches/urllib3-disable-brotli.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/pip/_vendor/urllib3/response.py b/src/pip/_vendor/urllib3/response.py 2 | index 01f08eee8..4969b70e3 100644 3 | --- a/src/pip/_vendor/urllib3/response.py 4 | +++ b/src/pip/_vendor/urllib3/response.py 5 | @@ -8,13 +8,7 @@ 6 | from socket import error as SocketError 7 | from socket import timeout as SocketTimeout 8 | 9 | -try: 10 | - try: 11 | - import brotlicffi as brotli 12 | - except ImportError: 13 | - import brotli 14 | -except ImportError: 15 | - brotli = None 16 | +brotli = None 17 | 18 | from . import util 19 | from ._collections import HTTPHeaderDict 20 | diff --git a/src/pip/_vendor/urllib3/util/request.py b/src/pip/_vendor/urllib3/util/request.py 21 | index b574b081e..330766ef4 100644 22 | --- a/src/pip/_vendor/urllib3/util/request.py 23 | +++ b/src/pip/_vendor/urllib3/util/request.py 24 | @@ -13,15 +13,6 @@ 25 | SKIPPABLE_HEADERS = frozenset(["accept-encoding", "host", "user-agent"]) 26 | 27 | ACCEPT_ENCODING = "gzip,deflate" 28 | -try: 29 | - try: 30 | - import brotlicffi as _unused_module_brotli # noqa: F401 31 | - except ImportError: 32 | - import brotli as _unused_module_brotli # noqa: F401 33 | -except ImportError: 34 | - pass 35 | -else: 36 | - ACCEPT_ENCODING += ",br" 37 | 38 | _FAILEDTELL = object() 39 | 40 | -------------------------------------------------------------------------------- /docs/html/cli/pip_uninstall.rst: -------------------------------------------------------------------------------- 1 | .. _`pip uninstall`: 2 | 3 | ============= 4 | pip uninstall 5 | ============= 6 | 7 | 8 | 9 | Usage 10 | ===== 11 | 12 | .. tab:: Unix/macOS 13 | 14 | .. pip-command-usage:: uninstall "python -m pip" 15 | 16 | .. tab:: Windows 17 | 18 | .. pip-command-usage:: uninstall "py -m pip" 19 | 20 | 21 | Description 22 | =========== 23 | 24 | .. pip-command-description:: uninstall 25 | 26 | 27 | Options 28 | ======= 29 | 30 | .. pip-command-options:: uninstall 31 | 32 | 33 | Examples 34 | ======== 35 | 36 | #. Uninstall a package. 37 | 38 | .. tab:: Unix/macOS 39 | 40 | .. code-block:: console 41 | 42 | $ python -m pip uninstall simplejson 43 | Uninstalling simplejson: 44 | /home/me/env/lib/python3.9/site-packages/simplejson 45 | /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info 46 | Proceed (Y/n)? y 47 | Successfully uninstalled simplejson 48 | 49 | .. tab:: Windows 50 | 51 | .. code-block:: console 52 | 53 | C:\> py -m pip uninstall simplejson 54 | Uninstalling simplejson: 55 | /home/me/env/lib/python3.9/site-packages/simplejson 56 | /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info 57 | Proceed (Y/n)? y 58 | Successfully uninstalled simplejson 59 | -------------------------------------------------------------------------------- /src/pip/_vendor/msgpack/__init__.py: -------------------------------------------------------------------------------- 1 | # ruff: noqa: F401 2 | import os 3 | 4 | from .exceptions import * # noqa: F403 5 | from .ext import ExtType, Timestamp 6 | 7 | version = (1, 1, 2) 8 | __version__ = "1.1.2" 9 | 10 | 11 | if os.environ.get("MSGPACK_PUREPYTHON"): 12 | from .fallback import Packer, Unpacker, unpackb 13 | else: 14 | try: 15 | from ._cmsgpack import Packer, Unpacker, unpackb 16 | except ImportError: 17 | from .fallback import Packer, Unpacker, unpackb 18 | 19 | 20 | def pack(o, stream, **kwargs): 21 | """ 22 | Pack object `o` and write it to `stream` 23 | 24 | See :class:`Packer` for options. 25 | """ 26 | packer = Packer(**kwargs) 27 | stream.write(packer.pack(o)) 28 | 29 | 30 | def packb(o, **kwargs): 31 | """ 32 | Pack object `o` and return packed bytes 33 | 34 | See :class:`Packer` for options. 35 | """ 36 | return Packer(**kwargs).pack(o) 37 | 38 | 39 | def unpack(stream, **kwargs): 40 | """ 41 | Unpack an object from `stream`. 42 | 43 | Raises `ExtraData` when `stream` contains extra bytes. 44 | See :class:`Unpacker` for options. 45 | """ 46 | data = stream.read() 47 | return unpackb(data, **kwargs) 48 | 49 | 50 | # alias for compatibility to simplejson/marshal/pickle. 51 | load = unpack 52 | loads = unpackb 53 | 54 | dump = pack 55 | dumps = packb 56 | -------------------------------------------------------------------------------- /tests/functional/test_self_update.py: -------------------------------------------------------------------------------- 1 | # Check that pip can update itself correctly 2 | 3 | from pathlib import Path 4 | from typing import Any 5 | 6 | 7 | def test_self_update_editable(script: Any, pip_src: Any, common_wheels: Path) -> None: 8 | # Test that if we have an environment with pip installed in non-editable 9 | # mode, that pip can safely update itself to an editable install. 10 | # See https://github.com/pypa/pip/issues/12666 for details. 11 | 12 | # Install flit-core (build backend) since we use --no-build-isolation 13 | script.pip("install", "--no-index", "-f", common_wheels, "flit-core") 14 | 15 | # Step 1. Install pip as non-editable. This is expected to succeed as 16 | # the existing pip in the environment is installed in editable mode, so 17 | # it only places a .pth file in the environment. 18 | proc = script.pip("install", "--no-build-isolation", pip_src) 19 | assert proc.returncode == 0 20 | # Step 2. Using the pip we just installed, install pip *again*, but 21 | # in editable mode. This could fail, as we'll need to uninstall the running 22 | # pip in order to install the new copy, and uninstalling pip while it's 23 | # running could fail. This test is specifically to ensure that doesn't 24 | # happen... 25 | proc = script.pip("install", "--no-build-isolation", "-e", pip_src) 26 | assert proc.returncode == 0 27 | -------------------------------------------------------------------------------- /src/pip/_vendor/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # For backwards compatibility, provide imports that used to be here. 4 | from .connection import is_connection_dropped 5 | from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers 6 | from .response import is_fp_closed 7 | from .retry import Retry 8 | from .ssl_ import ( 9 | ALPN_PROTOCOLS, 10 | HAS_SNI, 11 | IS_PYOPENSSL, 12 | IS_SECURETRANSPORT, 13 | PROTOCOL_TLS, 14 | SSLContext, 15 | assert_fingerprint, 16 | resolve_cert_reqs, 17 | resolve_ssl_version, 18 | ssl_wrap_socket, 19 | ) 20 | from .timeout import Timeout, current_time 21 | from .url import Url, get_host, parse_url, split_first 22 | from .wait import wait_for_read, wait_for_write 23 | 24 | __all__ = ( 25 | "HAS_SNI", 26 | "IS_PYOPENSSL", 27 | "IS_SECURETRANSPORT", 28 | "SSLContext", 29 | "PROTOCOL_TLS", 30 | "ALPN_PROTOCOLS", 31 | "Retry", 32 | "Timeout", 33 | "Url", 34 | "assert_fingerprint", 35 | "current_time", 36 | "is_connection_dropped", 37 | "is_fp_closed", 38 | "get_host", 39 | "parse_url", 40 | "make_headers", 41 | "resolve_cert_reqs", 42 | "resolve_ssl_version", 43 | "split_first", 44 | "ssl_wrap_socket", 45 | "wait_for_read", 46 | "wait_for_write", 47 | "SKIP_HEADER", 48 | "SKIPPABLE_HEADERS", 49 | ) 50 | --------------------------------------------------------------------------------