You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 fix(pip): skip constrain_package_deps when constraints is set (#3948)
When both `constraints` and `constrain_package_deps = true` are
configured, tox passes two `-c` flags to pip during
`install_package_deps`: one for the user's constraints file and one for
the auto-generated constraints file. 🔧 pip merges constraints from
multiple files via specifier intersection, so overlapping packages with
different versions produce unsatisfiable constraints and a resolver
error.
The `constraints` option already applies to both `install_deps` and
`install_package_deps` phases, making `constrain_package_deps` redundant
when it is set. This change skips generating and applying the
auto-generated constraints file whenever user constraints are
configured. The three affected code paths (non-frozen write, frozen
write, and package_deps application) all gate on a new
`_has_constraints` property that checks whether the user provided
constraint content.
Users who currently set both options will see the same effective
behavior, minus the conflicting duplicate `-c` flag. If they relied on
auto-constraining for packages absent from their constraints file, they
should add those pins to their constraints file directly.
Fixes#3945
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments