OK; hopefully last question :joy: I run matrix tes...
# plugins
g
OK; hopefully last question 😂 I run matrix tests for pants .14, .15, .16a0. However; the generated testutil dependency is hard-limited:
Copy code
['pantsbuild.pants.testutil<2.16,>=2.15.0a0', 'pantsbuild.pants<2.16,>=2.15.0a0']
I think the easiest is just to regenerate the lockfile before testing; but it seems a tiny bit terrible. I'd prefer not to run three branches for all the variants I support... 🙂 Any other options?
b
I think you'd need multiple lockfiles + multiple resolves 😞
g
Regenerating the lock in each CI variant seems easier. 😛
b
Well its one-and-done
But whatever you feel like is easier is defintely the right choice for you 🙂
g
I think - because I need to run with different PANTS_VERSION - I'd also need to triplicate the CI step etc.
b
Probably not? I think each test would parametrize on resolve, with each possible pants version as a resolve. And those each have the lockfile with the pants version. So Pants would run your tests in parallel across all pants versions each in its own process. Does that make sense?
g
No! But does run_pants run a different pants than the one I'm running the test from?
Otherwise I don't see how it'd work. 😛
b
It uses the Pants referenced in the dependency... I think.... I'm like 84% sure
And thats high enough to try it out 😛
g
🥳 It works! I have to make every python_source be parametrised over every variant of Pants which is eh, maybe suboptimal...
Copy code
pants-plugins/oci/pants_backend_oci/util_rules/layer.py@resolve=pants-plugins
pants-plugins/oci/pants_backend_oci/util_rules/layer.py@resolve=pants-214
pants-plugins/oci/pants_backend_oci/util_rules/layer.py@resolve=pants-215
pants-plugins/oci/pants_backend_oci/util_rules/layer.py@resolve=pants-216
pants-plugins/oci/pants_backend_oci/util_rules/oci_sha.py@resolve=pants-216
pants-plugins/oci/pants_backend_oci/util_rules/oci_sha.py@resolve=pants-plugins
pants-plugins/oci/pants_backend_oci/util_rules/oci_sha.py@resolve=pants-214
pants-plugins/oci/pants_backend_oci/util_rules/oci_sha.py@resolve=pants-215
pants-plugins/oci/pants_backend_oci/util_rules/pull_image_bundle.py@resolve=pants-plugins
pants-plugins/oci/pants_backend_oci/util_rules/pull_image_bundle.py@resolve=pants-214
pants-plugins/oci/pants_backend_oci/util_rules/pull_image_bundle.py@resolve=pants-215
pants-plugins/oci/pants_backend_oci/util_rules/pull_image_bundle.py@resolve=pants-216
pants-plugins/oci/pants_backend_oci/util_rules/unpack.py@resolve=pants-plugins
pants-plugins/oci/pants_backend_oci/util_rules/unpack.py@resolve=pants-214
pants-plugins/oci/pants_backend_oci/util_rules/unpack.py@resolve=pants-215
pants-plugins/oci/pants_backend_oci/util_rules/unpack.py@resolve=pants-216
b
Look up
__defaults__
🙂
but also woohoo!
g
Oh for sure, no way I'd add the resolve in every single directory 😛 Still quadruples the amount of targets
Oh, geez. NOPE. Parametrizing the sources with multiple pants variants breaks isort. It starts thinking pants is a first-party package...
b
isort
is so wacky
I'd just adjust the config. Don't throw out the baby with the bathwater
g
Seems like the config discovery gets confused. If I just set
Copy code
[isort]
config = "['pyproject.toml']"
it fixes itself.