Skip to content

Commit

Permalink
docs/faq.rst: clarify how constrain_package_deps works (#2902)
Browse files Browse the repository at this point in the history
  • Loading branch information
masenf committed Jan 31, 2023
1 parent a77d137 commit 0a7ce8b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ install. While creating a test environment tox will invoke pip multiple times, i
1. install the dependencies of the package.
2. install the package itself.

Starting in tox 4.4.0, ``{env_dir}{/}constraints.txt`` is generated by default during ``install_deps`` based on the
package specifications listed under ``deps``. These constraints are subsequently passed to pip during the
``install_package_deps`` stage, causing an error to be raised when the package dependencies conflict with the test
environment dependencies. For stronger guarantees, set ``use_frozen_constraints = true`` in the test environment to
generate the constraints file based on the exact versions enumerated by the ``list_dependencies_command`` (``pip
freeze``). When using frozen constraints, if the package deps are incompatible with any previously installed
dependency, an error will be raised.

Ensure that ``constrain_package_deps = true`` is set in the test environment in order to use the constraints file
generated by processing the ``deps`` section when performing ``package_deps``.
Starting in tox 4.4.0, when ``constrain_package_deps = true`` is set in the test environment,
``{env_dir}{/}constraints.txt`` will be generated during ``install_deps`` based on the package specifications listed
under ``deps``. These constraints are subsequently passed to pip during the ``install_package_deps`` stage, causing an
error to be raised when the package dependencies conflict with the test environment dependencies.

For stronger guarantees, set ``use_frozen_constraints = true`` in the test environment to generate the constraints file
based on the exact versions enumerated by the ``list_dependencies_command`` (``pip freeze``). When using frozen
constraints, if the package deps are incompatible with any previously installed dependency, an error will be raised.
To use constraints with url, path, or "extras" (``.[tests]``) deps, then you must ``use_frozen_constraints``, as
these types of deps are not valid constraints as specified (see pypa/pip#8210).

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.
Expand Down

0 comments on commit 0a7ce8b

Please sign in to comment.