From 5e9a6977da9e4e39488c7262ccb66dcddfafb3ab Mon Sep 17 00:00:00 2001 From: zejn Date: Sat, 27 Mar 2021 13:48:42 +0100 Subject: [PATCH] Document how to replace deprecated indexserver configuration directive. (#1976) Co-authored-by: Gasper Zejn --- docs/config.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 31e963316..a455766ee 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -537,9 +537,11 @@ Complete list of settings that you can put into ``testenv*`` sections: .. versionadded:: 0.9 - (DEPRECATED, will be removed in a future version) Multi-line ``name = - URL`` definitions of python package servers. Dependencies can - specify using a specified index server through the + (DEPRECATED, will be removed in a future version) Use :conf:`setenv` + to configure PIP_INDEX_URL environment variable, see below. + + Multi-line ``name = URL`` definitions of python package servers. + You can specify an alternative index server for dependencies by applying the ``:indexservername:depname`` pattern. The ``default`` indexserver definition determines where unscoped dependencies and the sdist install installs from. Example: @@ -553,6 +555,17 @@ Complete list of settings that you can put into ``testenv*`` sections: will make tox install all dependencies from this PyPI index server (including when installing the project sdist package). + The recommended way to set a custom index server URL is to use :conf:`setenv`: + + .. code-block:: ini + + [testenv] + setenv = + PIP_INDEX_URL = {env:PIP_INDEX_URL:https://pypi.org/simple/} + + This will ensure the desired index server gets used for virtual environment + creation and allow overriding the index server URL with an environment variable. + .. conf:: envdir ^ PATH ^ {toxworkdir}/{envname} .. versionadded:: 1.5