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

Move target.py rules to engine/internals/graph.py #10372

Merged
merged 1 commit into from Jul 15, 2020

Conversation

Eric-Arellano
Copy link
Contributor

Everything in the top-level engine.py is meant to be publically consumable by plugin authors. Meanwhile, engine/internals holds the implementation details and we never expect plugin authors to need to import from it.

Right now, the rules related to targets are in target.py, which is a leak - users don't need to access these rules directly.

Less philosophically, this allows us to circumvent an upcoming cycle between engine/targets.py and engine/internals/graph.py: the dependencies rule will need to use Owners, which is defined in graph.py, which imports target.py.

[ci skip-rust-tests]

Copy link
Contributor Author

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Almost all of this change is mechanical from Pycharm's "move" refactoring tool.

Comment on lines +1366 to +1374
try:
ensure_str_list(value_or_default)
except ValueError:
raise InvalidFieldTypeException(
address,
cls.alias,
value_or_default,
expected_type="an iterable of strings (e.g. a list of strings)",
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bug fix. We weren't doing any validation before.

@Eric-Arellano Eric-Arellano merged commit 742044b into pantsbuild:master Jul 15, 2020
@Eric-Arellano Eric-Arellano deleted the cleanup-target branch July 15, 2020 23:04
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.

None yet

2 participants