Skip to content

Teach dependees how to work with generated subtargets #10354

@Eric-Arellano

Description

@Eric-Arellano

Right now, ./pants dependees will always return original addresses, rather than generated subtargets:

▶ ./pants dependees src/python/pants/util
build-support/migration-support:tests
pants-plugins/src/python/internal_backend/utilities:utilities
src/python/pants/auth:auth
src/python/pants/backend/native/config:config
src/python/pants/backend/native/subsystems:subsystems
src/python/pants/backend/native/subsystems/utils:utils
src/python/pants/backend/pants_info:pants_info
src/python/pants/backend/project_info:project_info
src/python/pants/backend/python:python
src/python/pants/backend/python/dependency_inference:dependency_inference
src/python/pants/backend/python/dependency_inference:tests
src/python/pants/backend/python/lint/bandit:bandit
src/python/pants/backend/python/lint/black:black
src/python/pants/backend/python/lint/docformatter:docformatter
src/python/pants/backend/python/lint/flake8:flake8
src/python/pants/backend/python/lint/isort:isort
src/python/pants/backend/python/lint/pylint:pylint
src/python/pants/backend/python/rules:integration
src/python/pants/backend/python/rules:rules
src/python/pants/backend/python/rules:tests
src/python/pants/backend/python/subsystems:subsystems
src/python/pants/backend/python/typecheck/mypy:mypy

In contrast, dependencies understands generated subtargets:

▶ ./pants dependencies src/python/pants/backend/python/lint/isort:integration
src/python/pants/backend/python/lint/isort/rules.py
src/python/pants/backend/python/target_types.py
src/python/pants/base/specs.py
src/python/pants/core/goals/fmt.py
src/python/pants/core/goals/lint.py
src/python/pants/core/util_rules/determine_source_files.py
src/python/pants/engine/addresses.py
src/python/pants/engine/fs.py
src/python/pants/engine/rules.py
src/python/pants/engine/selectors.py
src/python/pants/engine/target.py
src/python/pants/testutil/external_tool_test_base.py
src/python/pants/testutil/option/util.py

It would be helpful if dependees also understood generated subtargets. The output would be more consistent with the rest of Pants and it would result in finer grained caching when using --changed-dependees.

The tricky part is that the goal must continue to understand traditional targets that are not generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions