Skip to content

Commit 5368be6

Browse files
fix setenv usages in documentation examples
fixes #1999 Co-authored-by: Jürgen Gmach <[email protected]>
1 parent 8d6a324 commit 5368be6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/changelog/1999.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update examples in the documentation to use ``setenv`` in the ``[testenv]`` sections, not wrongly in the ``[tox]`` main section.
2+
- by :user:`AndreyNautilus`

docs/example/basic.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ This variable can be also set in ``tox.ini``:
172172

173173
.. code-block:: ini
174174
175-
[tox]
175+
[testenv]
176176
setenv =
177177
PIP_INDEX_URL = https://pypi.my-alternative-index.org
178178
179179
Alternatively, a configuration where ``PIP_INDEX_URL`` could be overriden from environment:
180180

181181
.. code-block:: ini
182182
183-
[tox]
183+
[testenv]
184184
setenv =
185185
PIP_INDEX_URL = {env:PIP_INDEX_URL:https://pypi.my-alternative-index.org}
186186
@@ -192,21 +192,25 @@ multiple PyPI servers, using ``PIP_EXTRA_INDEX_URL`` environment variable:
192192

193193
.. code-block:: ini
194194
195-
[tox]
195+
[testenv]
196196
setenv =
197197
PIP_EXTRA_INDEX_URL = https://mypypiserver.org
198-
199-
[testenv]
200198
deps =
201199
# docutils will be installed directly from PyPI
202200
docutils
203201
# mypackage missing at PyPI will be installed from custom PyPI URL
204202
mypackage
205203
206204
This configuration will install ``docutils`` from the default
207-
Python PYPI server and will install the ``mypackage`` from
205+
Python PyPI server and will install the ``mypackage`` from
208206
our index server at ``https://mypypiserver.org`` URL.
209207

208+
.. warning::
209+
210+
Using an extra PyPI index for installing private packages may cause security issues.
211+
For example, if ``mypackage`` is registered with the default PyPI index, pip will install ``mypackage``
212+
from the default PyPI index, not from the custom one.
213+
210214
Further customizing installation
211215
---------------------------------
212216

0 commit comments

Comments
 (0)