-
-
Notifications
You must be signed in to change notification settings - Fork 539
Add [testenv] constraints
option
#3556
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
Conversation
Signed-off-by: Stephen Finucane <[email protected]>
3ab1c98
to
1e2cdf0
Compare
Signed-off-by: Stephen Finucane <[email protected]>
The minimum version is Python 3.9 now. Signed-off-by: Stephen Finucane <[email protected]>
This allows users to override constraints files for all installations. Without this, it is not possible to use constraints files that include the package under test without introducing a separate pre-tox processing step to scrub said package from the constraints file. Signed-off-by: Stephen Finucane <[email protected]>
Can you explain how this differs from just setting the PIP_Constraint environment variable via set env? |
Sure. Consider https://github.com/openstack/openstacksdk. Like all OpenStack projects, it uses constraints to ensure co-installability. We currently pass the diff --git tox.ini tox.ini
index ca14f55af..3c6e6d6a1 100644
--- tox.ini
+++ tox.ini
@@ -15,8 +15,8 @@ setenv =
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
+ PIP_CONSTRAINT={env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
- -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = I then run
This will always happen if you are developing a project that is itself included in constraints file, which is neither uncommon nor unreasonable (IMO) since those projects need to evolve too. I considered simply ignoring the
Suggesting I lose the ability to auto-regenerate when constraints change, which tox (4) is otherwise very good at. Thus, here is my proposed solution. An alternative would be to ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This incorrectly links #3350 from the change log. FYI @gaborbernat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing as draft to ensure this is a sane direction. I still need to add tests. I also think I should subclassPythonConstraints
fromRequirementsFile
rather thanPythonDeps
since we don't need a lot of the logic in the latter.I've done both of these now.
Add a new option allowing us to specify constraints file(s) that will be applied when installing all dependencies except the package under test. For example, given the following
tox.ini
:The all requirements in
deps
, all requirements in thetest
extra, and all dependencies of the package itself will be installed with-c upper-constraints.txt
. The package itself will not.Closes #3550
tox -e fix
)docs/changelog
folder