Add example for extending the install command
@@ -23,8 +23,15 @@ Some solutions and their drawbacks:
dependencies),
- use ``PIP_CONSTRAINTS`` inside :ref:`set_env` (tox will not know about the content of the constraint file and such
will not trigger a rebuild of the environment when its content changes),
-- specify the constraint file by extending the :ref:`install_command` (tox will not know about the content of the
- constraint file and such will not trigger a rebuild of the environment when its content changes).
+- specify the constraint file by extending the :ref:`install_command` as in the following example
+ (tox will not know about the content of the constraint file and such will not trigger a rebuild of the environment
+ when its content changes).
+
+.. code-block:: ini
+
+ [testenv:py39]
+ install_command = python -m pip install {opts} {packages} -c constraints.txt
+ extras = test
Note constraint files are a subset of requirement files. Therefore, it's valid to pass a constraint file wherever you
can specify a requirement file.
