I just tried upgrading to 2.13.0a1 from 2.12.0 and...
# plugins
p
I just tried upgrading to 2.13.0a1 from 2.12.0 and now I need to upgrade my plugins. ๐Ÿ™‚ First off, this change feels significant with lots of stuff to wade through: https://github.com/pantsbuild/pants/pull/15538 AddressSpecs and DescendantAddresses were replaced, but I'm not quite sure with what. Using
SpecsWithoutFileOwners
doesn't sound right, so, what is the new way to do this:
Copy code
all_expanded_targets = await Get(Targets, AddressSpecs([DescendantAddresses("")]))
Ultimately I need to get a list of all targets in the repo that have my extension's field https://github.com/st2sandbox/st2/blob/pants/pants-plugins/stevedore_extensions/python_dependency_injection.py#L58-L61
โœ… 2
Should I use: 1:
Specs(recursive_globs=(RecursiveGlobSpec(""),))
2:
SpecsWithoutFileOwners(recursive_globs=(RecursiveGlobSpec(""),))
3:
SpecsWithFileOwners(recursive_globs=(RecursiveGlobSpec(""),))
iow: what's the diff between Specs, SpecsWithoutFileOwners, SpecsWithFileOwners
Hmm. Or maybe
RawSpecs
...
c
Sorry for not providing any answers regarding the specs (they can be a bit confusing) but, Why not just get the
AllTargets
or
AllUnexpandedTargets
? They are root types, so can use them as input params to your
@rule
.
./pants AllTargets --help-advanced
edit: oh, nvm about the helpโ€ฆ that type was not registered, so does not show up in help.
p
oh cool. When was that introduced?
c
I think
AllTargets
have existed for a long time.
but the help system for rules and api types are rather new-ish (a few months)
p
Ah ha. It was introduced in October 2021. I wrote this plugin in May 2021, and then picked it up again last month (ish)
๐Ÿ‘ 1
c
Ah, ok. So long is relative, it turns out ๐Ÿ˜›
h
Wait you're doing this while upgrading to 2.12? It should be a 2.13 change. I haven't updated the plugin upgrade guide yet
+1 to using
AllTargets
p
No. I went to 2.13. I already got to 2.12. Now I'm actually on 2.14.0.dev0 because
__defaults__
is too awesome to pass up.
๐ŸŽ‰ 1
โค๏ธ 3
h
oh cool!! I really want to stabilize 2.13 soon