-
-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 1.5.0.dev0 deprecations #5363
Remove 1.5.0.dev0 deprecations #5363
Conversation
Individual commits should be useful to review independently. |
91ca298
to
ad9f559
Compare
ad9f559
to
cde01ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Stu!
# eagerly evaluate all the globs, which would be a performance drag for goals that | ||
# otherwise wouldn't do that (like `list`). | ||
for spec in Java.global_instance().injectables_specs_for_key('plugin'): | ||
yield spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would've expected this bit to stay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option it was fed by was deprecated and moved elsewhere.
build_ignore_patterns, | ||
exclude_target_regexps, | ||
subproject_build_roots) | ||
return MutableBuildGraph(address_mapper), address_mapper, None, spec_roots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎆 🍾 🎉 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!... note that I don't actually delete MutableBuildGraph, as it is still used in BaseTest (#4867). Which is... even scarier now.
@property | ||
@deprecated('1.5.0.dev0', 'Use `Target.compute_dependency_specs()` instead.') | ||
def traversable_dependency_specs(self): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤘 🤘 🤘
'one or more explicit target specs (e.g. `./pants {0} ::`).'.format(goal_name)) | ||
if not self.context.target_roots and not self.get_options().enable_v2_engine: | ||
# For the v1 path, continue the behavior of e.g. `./pants list` implies `./pants list ::`. | ||
return self.context.scan().targets(predicate=predicate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤘
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such an awesome change! I'm particularly happy to see the old python backend go away. My only comments (apart from gasps of approval) are around removing comments that reference the past. Thanks for doing this.
@@ -133,6 +133,15 @@ python_library( | |||
] | |||
) | |||
|
|||
python_library( | |||
name = 'tasks2', | |||
sources = ['tasks2.py'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat way to deprecate all imports from the former tasks2 package in one go!
@@ -36,7 +35,6 @@ def __init__(self, | |||
sources=None, | |||
provides=None, | |||
excludes=None, | |||
resources=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me so happy! That bit of cruft was a thorn in our side for so long.
removal_version='1.5.0.dev0', removal_hint='Use --interpreter-constraints instead.', | ||
help='The interpreter requirement string for this python environment.') | ||
# Note: This will replace two options: | ||
# Note: This replaces two options: | ||
# A) The global --interpreter option in the old python tasks. | ||
# That flag is only relevant in the python backend, and should never have been | ||
# global to begin with. | ||
# B) The --interpreter-requirement option above. That flag merely served to set the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment makes no sense now, since the options it mentions are now gone. Why did you choose to keep it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just due to a lack of context as to whether leaving some of the history here might be useful to someone debugging something here.
@@ -232,13 +232,6 @@ def register_options(cls, register): | |||
# TODO: After moving to the new options system these abstraction leaks can go away. | |||
register('-k', '--kill-nailguns', advanced=True, type=bool, | |||
help='Kill nailguns before exiting') | |||
register('-i', '--interpreter', advanced=True, default=[], type=list, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this fills me with great joy.
'default recursive inclusion of files in directory', | ||
'A non-recursive/literal glob should no longer include child paths.' | ||
) | ||
# NB: The behaviour of this test changed as scheduled in 1.5.0.dev0, because the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why leave this comment? It seems weird to reference the past. The reader won't know (and hopefully shouldn't care) what this refers to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal here would be that if someone opens a bug against the 1.5.0 dev series indicating that something is broken, someone would find this and determine (more easily) that the change was intentional... I know that these types of historical comments should eventually be deleted, but in the near term they seem helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, I feel like that's what git history is for. Let's at least put a "deprecation message" with a version on the comments, so that they get deleted in the find-and-replace sweep for a future version. And let's make sure they're reworded in past tense, so the reader doesn't go looking for options that no longer exist.
Only the OSX shard is outstanding. Merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed a minor issue...
] | ||
) | ||
|
||
python_tests( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it looks like the python isort tests were nuked when they should have remained (they had stayed in the old tasks dir instead of being in tasks2, because they weren't affected by the new pipeline changes).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, | ||
unicode_literals, with_statement) | ||
|
||
from pants.backend.python.tasks import (GatherSources, PytestPrep, PytestRun, PythonBinaryCreate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noticing now that this is broken:
A) These imports are all invalid, as those classes are defined in modules inside tasks
, not in tasks
itself.
B) Even if we fix that, any existing import statements that try to import from modules in tasks2
will now fail, instead of showing the deprecation message but succeeding.
I see no alternative but to restore the modules in tasks2
and have each one just import from the sibling module in tasks
and show a deprecation message.
Or am I missing something? This definitely caused pants to fail when I tried to register a tasks2
task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...hm, of course. sheesh... not sure how I missed that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll tackle that today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Problem The `tasks2` deprecations from #5363 did not each have their own modules, and thus were not importable ([see](https://github.com/pantsbuild/pants/pull/5363/files#r164906101)). ### Solution Move the deprecations into their own modules/files.
This is unneeded since pantsbuild#5363 removed the deprecated behavior.
Their time has come.