https://pantsbuild.org/ logo
#general
Title
# general
g

gentle-room-19215

03/20/2020, 7:10 AM
Could somebody help with
DEPRECATED: Target.compute_injectable_specs() will be removed in version 1.27.0.dev0
How could I fix it?
w

witty-crayon-22786

03/20/2020, 3:00 PM
the whole error should be:
Copy code
warn_or_error(
            removal_version="1.27.0.dev0",
            deprecated_entity_description="Target.compute_injectable_specs()",
            hint="Use `Target.compute_injectable_address_specs()` instead. The API is the same as "
            "before. This change is to prepare for Pants eventually supporting file system specs, "
            "e.g. `./pants cloc foo.py`. In preparation, we renamed `Spec` to `AddressSpec`.",
        )
is this warning coming from a plugin that you control, or somewhere else?
g

gentle-room-19215

03/23/2020, 5:29 AM
Looks like it comes from
[jar-dependency-management]
Full log is:
Copy code
[jar-dependency-management]05:25:43 [WARN] /home/user/.cache/pants/setup/bootstrap-Linux-x86_64/1.25.0_py36/lib/python3.6/site-packages/pants/build_graph/target.py:622: DeprecationWarning: DEPRECATED: Target.compute_injectable_specs() will be removed in version 1.27.0.dev0.
  Use `Target.compute_injectable_address_specs()` instead. The API is the same as before. This change is to prepare for Pants eventually supporting file system specs, e.g. `./pants cloc foo.py`. In preparation, we renamed `Spec` to `AddressSpec`.
  cls._compute_injectable_specs_warn_or_error()
h

hundreds-father-404

03/23/2020, 4:37 PM
Hm, which Pants version are you on?
w

witty-crayon-22786

03/23/2020, 4:39 PM
looks like
1.25.0
based on filenames
๐Ÿ‘ 2
g

gentle-room-19215

03/23/2020, 4:39 PM
Yes, 1.25
w

witty-crayon-22786

03/23/2020, 4:39 PM
but i think that this might be
src/python/pants/backend/jvm/targets/managed_jar_dependencies.py
... it still has a definition of that method
๐Ÿ‘ 1
although the deprecation* is gone now in master
h

hundreds-father-404

03/23/2020, 4:43 PM
Oh, hm, youโ€™re right. We should fix that in 1.25.1rc1. In the mean time, @gentle-room-19215, you can ignore the deprecation message by adding this to pants.ini
Copy code
[GLOBAL]
ignore_pants_warnings: ['Target.compute_injectable_specs() will be removed']
w

witty-crayon-22786

03/23/2020, 4:44 PM
might need escapes there: it's a regex
๐Ÿ‘ 1
might be
'DEPRECATED: Target.compute_injectable_specs.. will be removed'
๐Ÿ‘ 1
g

gentle-room-19215

03/23/2020, 4:46 PM
Thank you guys!
โค๏ธ 1
h

hundreds-father-404

03/23/2020, 4:47 PM
Thanks for flagging the issue!