mysterious-motherboard-97366
06/07/2022, 7:30 AMresolve
for all python_sources
targets. Is it possible to configure ./pants tailor
to do that when adding more targets? I tried to make a macro, for use with https://www.pantsbuild.org/docs/reference-tailor#section-alias-mapping, but I got an error: Exception: Error parsing prelude file pants-plugins/macros.py: name 'parametrize' is not defined
My underlying motivation is very similar to https://pantsbuild.slack.com/archives/C046T6T9U/p1651762568623679?thread_ts=1651755337.307249&cid=C046T6T9U but for torch instead of jax.happy-kitchen-89482
06/07/2022, 8:37 AMhappy-kitchen-89482
06/07/2022, 8:37 AMbitter-ability-32190
06/07/2022, 9:58 AMmysterious-motherboard-97366
06/07/2022, 6:35 PMAre the torch packages like mxnet, in that they have different package names, but same module name?They have different versions (for example, 1.10.2 vs 1.10.2+cpu). Only one of the variants is on PyPI, the others require extra indices to access.
mysterious-motherboard-97366
06/07/2022, 6:39 PMCan you share your macro code?This is what I tried for the macro:
def python_sources_parametrized(resolve=parametrize("python-default", "torch-cpu"), **kwargs):
kwargs["resolve"] = parametrize("python-default", "torch-cpu")
python_sources(resolve=parametrize("python-default", "torch-cpu"), **kwargs)
Would you suggest creating multiple targets instead (i.e. calling python_sources
twice)? I noticed that https://www.pantsbuild.org/docs/macros says “A macro can create multiple targets—although often it’s better to use `parametrize`”bitter-ability-32190
06/07/2022, 6:45 PMThey have different versionsThat stinks. My hacks won't work then
happy-kitchen-89482
06/07/2022, 7:39 PM