The Pixi builder supports selecting named environments from pixi.toml via .environment():
Environment env = Appose.pixi("pixi.toml")
.environment("cuda")
.build();
This maps to pixi install -e cuda and enables optional dependency selection without modifying the manifest.
The UV builder has no equivalent. When using .content(pyprojectContent).scheme("pyproject.toml"), only [project.dependencies] is resolved. PEP 735 [dependency-groups] are ignored, so there is no way to install optional groups.
Proposed solution
Add a group(String...) method to UvBuilder that maps to uv sync --group <name>:
Environment env = Appose.uv()
.content(pyprojectContent)
.scheme("pyproject.toml")
.python("3.12")
.group("appose") // maps to: uv sync --group appose
.group("cuda") // maps to: uv sync --group appose --group cuda
.build();
This would bring UV builder to parity with Pixi builder's .environment() for optional dependency selection
If you’re interested, I can propose a PR
Current workaround
Consumers can modify the pyproject.toml content string before passing it to the builder:
String content = Files.readString(pyprojectFile.toPath());
content = content.replaceFirst("(dependencies\\s*=\\s*\\[)", "$1\"appose>=0.5.1\",");
The Pixi builder supports selecting named environments from
pixi.tomlvia.environment():This maps to
pixi install -e cudaand enables optional dependency selection without modifying the manifest.The UV builder has no equivalent. When using
.content(pyprojectContent).scheme("pyproject.toml"), only[project.dependencies]is resolved. PEP 735 [dependency-groups] are ignored, so there is no way to install optional groups.Proposed solution
Add a
group(String...)method toUvBuilderthat maps touv sync --group <name>:This would bring UV builder to parity with Pixi builder's
.environment()for optional dependency selectionIf you’re interested, I can propose a PR
Current workaround
Consumers can modify the
pyproject.tomlcontent string before passing it to the builder: