Conversation
caseyduquettesc
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
| name = "pytest_requirements", | ||
| python_interpreter_target = interpreter, | ||
| quiet = False, | ||
| requirements_lock = "@rules_python_pytest//:e2e/smoke/requirements.txt", |
There was a problem hiding this comment.
I don't think we want production code depending on test code. Are these requirements something we can bring into python_pytest/?
There was a problem hiding this comment.
Nope, we don't. This proves the concept. Can certainly reshape this to be its own target. Any suggestions?
| load("@pytest_requirements//:requirements.bzl", "install_deps") | ||
| install_deps() | ||
|
|
||
| ################################################# |
There was a problem hiding this comment.
Can we add a bzlmod example?
There was a problem hiding this comment.
I'll have to cook one up. Haven't done much with bazelmod yet. It's been high friction so far.
There was a problem hiding this comment.
I think it's a bad idea for requirements to be installed by external packages. They aren't constraint-solved with the user's app code, they don't see the lockfile, and they don't have control over the version.
Just expect the user to provide a pytest label (can default to @pip//pytest for convenience)
This adds tooling to setup the pytest requirements() automatically.