https://pantsbuild.org/ logo
g

gorgeous-winter-99296

03/16/2023, 11:30 AM
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

bitter-ability-32190

03/16/2023, 12:06 PM
I think you'd need multiple lockfiles + multiple resolves 😞
g

gorgeous-winter-99296

03/16/2023, 2:46 PM
Regenerating the lock in each CI variant seems easier. 😛
b

bitter-ability-32190

03/16/2023, 3:02 PM
Well its one-and-done
But whatever you feel like is easier is defintely the right choice for you 🙂
g

gorgeous-winter-99296

03/16/2023, 3:05 PM
I think - because I need to run with different PANTS_VERSION - I'd also need to triplicate the CI step etc.
b

bitter-ability-32190

03/16/2023, 3:07 PM
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

gorgeous-winter-99296

03/16/2023, 3:10 PM
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

bitter-ability-32190

03/16/2023, 3:14 PM
It uses the Pants referenced in the dependency... I think.... I'm like 84% sure
And thats high enough to try it out 😛
g

gorgeous-winter-99296

03/16/2023, 4:08 PM
🥳 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

bitter-ability-32190

03/16/2023, 4:09 PM
Look up
__defaults__
🙂
but also woohoo!
g

gorgeous-winter-99296

03/16/2023, 4:10 PM
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

bitter-ability-32190

03/16/2023, 5:30 PM
isort
is so wacky
I'd just adjust the config. Don't throw out the baby with the bathwater
g

gorgeous-winter-99296

03/16/2023, 5:35 PM
Seems like the config discovery gets confused. If I just set
Copy code
[isort]
config = "['pyproject.toml']"
it fixes itself.
3 Views