Skip to content

Add PEP 735 dependency group support to UvBuilder - #9

Merged
ctrueden merged 5 commits into
apposed:mainfrom
yzx9:uv-builder-groups
Oct 9, 2026
Merged

ctrueden merged 5 commits into
apposed:mainfrom
yzx9:uv-builder-groups

Conversation

@yzx9

@yzx9 yzx9 commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor
  • Add group(String...) method to UvBuilder that maps to uv sync --group, enabling PEP 735 dependency groups selection
  • Groups are tracked in appose.json only when non-empty, preserving backward compatibility with existing environments
  • Validate that group() is only used with pyproject.toml scheme

closes apposed/appose#32

Example

Environment env = Appose.uv()
    .content(pyprojectContent)
    .scheme("pyproject.toml")
    .group("appose")
    .group("cowsay")  # support multiple groups
    .build();

Test plan

  • testUvPyprojectWithGroup: builds env with --group cowsay and verifies cowsay is available
  • testUvGroupRejectsWithoutPyproject: confirms IllegalArgumentException when using group() without pyproject.toml
  • testUvStateNoGroupField: verifies appose.json has no groups field when none specified (backward compat)
  • testUvStateGroupFieldPresent: verifies appose.json contains groups when specified

All 7 UvBuilderTest tests pass

yzx9 and others added 3 commits October 9, 2026 00:12
Keep the two-argument Uv.sync for backward compatibility, and fold the
appose.json state checks into the existing pyproject tests, to avoid
building two extra environments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pyproject.toml-based uv environment keeps its venv in .venv, with no
pyvenv.cfg at the top level, so Appose.wrap fell back to SimpleBuilder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ctrueden
ctrueden force-pushed the uv-builder-groups branch 2 times, most recently from 0d5f211 to 337f0e5 Compare October 9, 2026 05:41
ctrueden and others added 2 commits October 9, 2026 00:57
Service.close() only begins the worker's shutdown. A test that deletes
the environment right afterward, e.g. to rebuild it, could then fail on
Windows, where the still-running python.exe cannot be deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Groups are not recorded in pyproject.toml, so wrapping a group-enabled
environment lost them: the environment then looked stale versus its
appose.json, and was immediately re-synced without the groups, removing
their packages. Restore them from appose.json instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ctrueden
ctrueden merged commit 8ab56b0 into apposed:main Oct 9, 2026
3 checks passed
@ctrueden

ctrueden commented Oct 9, 2026

Copy link
Copy Markdown
Member

Thank you very much, @yzx9! For the equivalent commits in appose-python, see:

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.

Feature Request: UV Builder support for dependency groups like Pixi's .environment()

2 participants