Skip to content

Commit fe27218

Browse files
authored
Merge pull request #9647 from vanschelven
2 parents 4e835c0 + 5df7d26 commit fe27218

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

docs/html/cli/pip_install.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,37 +1127,46 @@ Examples
11271127
11281128
py -m pip install --index-url http://my.package.repo/simple/ SomePackage
11291129
1130-
Search an additional index during install, in addition to `PyPI`_
1130+
Install from a local flat directory containing archives (and don't scan indexes):
11311131

11321132
.. tab:: Unix/macOS
11331133

11341134
.. code-block:: shell
11351135
1136-
python -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1136+
python -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1137+
python -m pip install --no-index --find-links=/local/dir/ SomePackage
1138+
python -m pip install --no-index --find-links=relative/dir/ SomePackage
11371139
11381140
.. tab:: Windows
11391141

11401142
.. code-block:: shell
11411143
1142-
py -m pip install --extra-index-url http://my.package.repo/simple SomePackage
1144+
py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1145+
py -m pip install --no-index --find-links=/local/dir/ SomePackage
1146+
py -m pip install --no-index --find-links=relative/dir/ SomePackage
11431147
1144-
Install from a local flat directory containing archives (and don't scan indexes):
1148+
Search an additional index during install, in addition to `PyPI`_
1149+
1150+
.. warning::
1151+
1152+
Using this option to search for packages which are not in the main
1153+
repository (such as private packages) is unsafe, per a security
1154+
vulnerability called
1155+
`dependency confusion <https://azure.microsoft.com/en-us/resources/3-ways-to-mitigate-risk-using-private-package-feeds/>`_:
1156+
an attacker can claim the package on the public repository in a way that
1157+
will ensure it gets chosen over the private package.
11451158

11461159
.. tab:: Unix/macOS
11471160

11481161
.. code-block:: shell
11491162
1150-
python -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1151-
python -m pip install --no-index --find-links=/local/dir/ SomePackage
1152-
python -m pip install --no-index --find-links=relative/dir/ SomePackage
1163+
python -m pip install --extra-index-url http://my.package.repo/simple SomePackage
11531164
11541165
.. tab:: Windows
11551166

11561167
.. code-block:: shell
11571168
1158-
py -m pip install --no-index --find-links=file:///local/dir/ SomePackage
1159-
py -m pip install --no-index --find-links=/local/dir/ SomePackage
1160-
py -m pip install --no-index --find-links=relative/dir/ SomePackage
1169+
py -m pip install --extra-index-url http://my.package.repo/simple SomePackage
11611170
11621171
11631172
#. Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.

docs/html/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ does not come with it included.
125125
126126
pip install keyring
127127
echo your-password | keyring set pypi.company.com your-username
128-
pip install your-package --extra-index-url https://pypi.company.com/
128+
pip install your-package --index-url https://pypi.company.com/
129129
130130
.. _keyring: https://pypi.org/project/keyring/
131131

news/9647.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add warning about ``--extra-index-url`` and dependency confusion

0 commit comments

Comments
 (0)