Skip to content

docs(examples): Conditional dev dependencies with dependency groups#845

Merged
arrdem merged 3 commits intomainfrom
arrdem/example-dev-deps
Mar 17, 2026
Merged

docs(examples): Conditional dev dependencies with dependency groups#845
arrdem merged 3 commits intomainfrom
arrdem/example-dev-deps

Conversation

@arrdem
Copy link
Copy Markdown
Contributor

@arrdem arrdem commented Mar 10, 2026

Case study requested in Bazel slack demonstrating conditional dev-dependency
inclusion using PEP 735 dependency groups, a Bazel string_flag, and select().

The example shows a py_dev_binary wrapper macro that includes dev-only
packages (ipdb, pytest) by default and strips them out in release builds
(bazel build //:app --config=release).

See examples/dev_deps/README.md for the full walkthrough.

Changes are visible to end-users: no

Test plan

  • Manual testing; please provide instructions so we can reproduce:
cd examples/dev_deps
bazel build //:app              # dev mode — ipdb/pytest included
bazel build //:app --config=release  # prod mode — ipdb/pytest excluded

arrdem and others added 2 commits March 10, 2026 00:08
…cies

Demonstrates using PEP 735 dependency groups with a string_flag and
select() to include dev-only packages (ipdb, pytest) in development
builds while excluding them from release builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Mar 10, 2026

Bazel 8 (Test)

All tests were cache hits

87 tests (100.0%) were fully cached saving 45s.


Bazel 9 (Test)

All tests were cache hits

87 tests (100.0%) were fully cached saving 1m 14s.


Bazel 8 (Test)

e2e

All tests were cache hits

25 tests (100.0%) were fully cached saving 13s.


Bazel 9 (Test)

e2e

All tests were cache hits

25 tests (100.0%) were fully cached saving 17s.


Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 444ms.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ arrdem
❌ aspect-marvin
You have signed the CLA already but the status is still pending? Let us recheck it.

@arrdem arrdem marked this pull request as ready for review March 17, 2026 19:38
@arrdem arrdem merged commit 4d68cba into main Mar 17, 2026
3 of 4 checks passed
@arrdem arrdem deleted the arrdem/example-dev-deps branch March 17, 2026 19:38
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.

3 participants