Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/faq.rst: clarify how constrain_package_deps works #2902

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should one day we make this the default, we should probably do something like True if all in deps is valid package spec; otherwise False.

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