One more question - Can somebody please help me to...
# general
e
One more question - Can somebody please help me to understand how the two multy-resolves (python-default, pytest) mode work when running tests? I’d assume they’re somehow merged during the testing, but it seems that the pytest resolve is not used unless explicitly specified in a BUILD file. Even when using default resolve, the pants just rollback to default pytest requirements. I like the idea of separated requirement files for testing, so I’d like to make it work, but when I add some testing dependency it’s not accessible in the test since it’s using default resolve.
c
Hi, you can keep your requirements in a dedicated test file, but still contribute to the default resolve. Pants is smart enough to not include your test only requirements in any packaged pex/dist for you, unless there is code depending on them being packaged. You can leverage depedency rules to safe guard against mistakes like that. https://www.pantsbuild.org/docs/validating-dependencies That is, pants prefers one big universe of requirements to work with, and will pick what’s needed for each target out of that. It is only when you have conflicting requirements for different parts of your project you’d need to go down the road of multiple resolves.
e
Hi, thanks for pointing me out. I like this solution much more 😉
👍 1