there appears to be no way to avoid a deprecation ...
# announce
w
there appears to be no way to avoid a deprecation for a goal like
./pants options
... if you set
transitive: False
you get:
Copy code
23:47:45 [WARN] /opt/twitter_mde/package/eepython36/68cc93925092a6fc31d254392558fa8c840f7bd5407db9435ca48ff1b8f6c07f/lib/python3.6/threading.py:884: DeprecationWarning: DEPRECATED: option 'transitive' in scope 'options' will be removed in version 1.27.0.dev0.
  This option has no impact on the goal `options`.
  self._bootstrap_inner()
if you don't set it, you get
Copy code
23:45:46 [WARN] /Users/stuhood/.pex/install/pantsbuild.pants-1.25.0.dev3+gitff562b70-cp36-abi3-macosx_10_11_x86_64.whl.07501c0a413887737ab82818343e3698b25224ee/pantsbuild.pants-1.25.0.dev3+gitff562b70-cp36-abi3-macosx_10_11_x86_64.whl/pants/task/console_task.py:80: DeprecationWarning: DEPRECATED: Pants defaulting to `--transitive` for `options` will be removed in version 1.27.0.dev0.
  Currently, Pants defaults to `--transitive`, which means that it will run against transitive dependencies for the targets you specify on the command line, rather than only the targets you specify. This is often useful, such as running `./pants dependencies --transitive`, but it is surprising to have this behavior by default.

To prepare for this change to the default value, set in `pants.ini` under the section `options` the value `transitive: False`. In Pants 1.27.0, you can safely remove the setting.
  targets = self.get_targets() if self.act_transitively else self.context.target_roots
we might want to remove the deprecation of the option itself until after the "is not set" deprecation is completed
h
Ha, we discovered this independently around the same time! See https://github.com/pantsbuild/pants/pull/9076
it was entirely an error in implementation
w
it looks like the option itself is still deprecated, so won't you get a warning if you set it?
requesting that people set it explicitly seems fine... it's just that you can't also deprecate the option if you're asking people to set it
but maybe i'm missing something.
h
This fixes it so that we no longer request you to explicitly set the option for the 11 tasks where the option doesn’t do anything
Now, by default,
./pants options
won’t have any deprecation warning. We only warn when explicitly setting
--transitive
as it makes no sense to configure it for
options
and we’ll be removing
--options-transitive
soon
To clarify a bit more, the deprecations depend upon which task we’re talking about. For something like
filedeps
, we do still deprecate when you rely on the default of
--transitive
For goals that ignore the option, we only deprecate when you explicitly use the option rather than the default
w
ok, makes sense for
options
i think.
For something like
filedeps
, we do still deprecate when you rely on the default of
--transitive
and in this case, the option itself is not deprecated...?
(yea, looks like it.)
ok, thanks!
h
Yes, exactly.
filedeps
was always behaving correctly. The issue was the 11 console tasks that ignore the value of
--transitive
, hence us deprecating the option outright