Skip to content
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

Merged
merged 12 commits into from
Jan 22, 2018

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Jan 20, 2018

Their time has come.

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jan 20, 2018

Individual commits should be useful to review independently.

@stuhood stuhood force-pushed the stuhood/1.5.0.dev0-deprecations branch 2 times, most recently from 91ca298 to ad9f559 Compare January 21, 2018 06:33
Copy link
Member

@kwlzn kwlzn left a 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
Copy link
Member

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?

Copy link
Sponsor Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎆 🍾 🎉 👍

Copy link
Sponsor Member Author

@stuhood stuhood Jan 22, 2018

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):
"""
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤘

Copy link
Sponsor Contributor

@benjyw benjyw left a 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'],
Copy link
Sponsor Contributor

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,
Copy link
Sponsor Contributor

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
Copy link
Sponsor Contributor

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?

Copy link
Sponsor Member Author

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,
Copy link
Sponsor Contributor

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
Copy link
Sponsor Contributor

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.

Copy link
Sponsor Member Author

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.

Copy link
Sponsor Contributor

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.

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jan 22, 2018

Only the OSX shard is outstanding. Merging.

@stuhood stuhood merged commit 4aae5dc into pantsbuild:master Jan 22, 2018
@stuhood stuhood deleted the stuhood/1.5.0.dev0-deprecations branch January 22, 2018 21:19
Copy link
Sponsor Contributor

@benjyw benjyw left a 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(
Copy link
Sponsor Contributor

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,
Copy link
Sponsor Contributor

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.

Copy link
Sponsor Member Author

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.

Copy link
Sponsor Member Author

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.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuhood stuhood mentioned this pull request Feb 2, 2018
stuhood pushed a commit that referenced this pull request Feb 2, 2018
### 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.
illicitonion added a commit to twitter/pants that referenced this pull request Jun 19, 2018
This is unneeded since pantsbuild#5363 removed the deprecated behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants