Skip to content

feat: implement testonly dependency generation - #294

Merged
jvolkman merged 5 commits into
mainfrom
dev/testonly
Jul 19, 2026
Merged

feat: implement testonly dependency generation#294
jvolkman merged 5 commits into
mainfrom
dev/testonly

Conversation

@jvolkman

@jvolkman jvolkman commented Jul 18, 2026

Copy link
Copy Markdown
Owner
  • Replace create_transitive_aliases boolean with inclusion of a transitive entry in dependency_groups.
  • Add ability to specify that groups are test-only using the ;testonly suffix
dependency_groups = ['default', 'group:dev;testonly', 'transitive;testonly']

For #228

@jvolkman jvolkman changed the title Implement testonly dependency generation () Implement testonly dependency generation Jul 18, 2026
@jvolkman jvolkman changed the title Implement testonly dependency generation feat: implement testonly dependency generation Jul 18, 2026
@jvolkman
jvolkman force-pushed the dev/testonly branch 6 times, most recently from b51bec4 to e7ef883 Compare July 19, 2026 00:02
- Parse testonly and transitive entries from dependency_groups across all
  translation backends (uv, poetry, pdm, pylock).
- Implement BFS reachability in lock_resolver.bzl to compute packages
  exclusively reachable from testonly groups.
- Apply testonly = True to pycross_library_proxy targets in thin repos.
- Replace create_transitive_aliases with dependency_groups = ["transitive"].
@jvolkman
jvolkman force-pushed the dev/testonly branch 8 times, most recently from 35b2eb5 to 954c8dd Compare July 19, 2026 04:57
jvolkman added 2 commits July 19, 2026 05:16
- Extract compute_requested_dependency_groups to translator_common.bzl
- Accept a single flat list of prefixed available groups (e.g. 'optional:foo',
  'group:dev') instead of separate bucket lists, letting translators decide
  the prefix taxonomy
- Extract project_name once per translator instead of inline
- Use shared canonicalize_name in pylock instead of private copy
- Add create_transitive_aliases removal to CHANGELOG breaking changes
testonly is only applied to proxy aliases (@pypi//...:pkg), not to
the underlying package targets in __pkgs. Since a testonly proxy can
freely point at a non-testonly actual target, there is no need for
reachability analysis. When transitive;testonly is set, simply mark
all transitive pins as testonly.
Tests now use include_transitive=True and verify that all transitive
pins are marked testonly when transitive_testonly is set, without
reachability analysis.

TAG=agy
@jvolkman
jvolkman merged commit db294c2 into main Jul 19, 2026
60 checks passed
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.

1 participant