heroku / heroku/heroku-buildpack-python

Add support for selecting UV dependency groups during build via environment variable

Open
#1,865 7 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
993
Forks
1.8k
Avg merge
10h 50m
Merged PRs (30d)
10

Description

Currently, the Heroku Python buildpack uses `uv sync --locked --no-default-groups` when installing dependencies in a non-CI build environment.
While this works for most setups, it assumes that all runtime dependencies are declared in the [project.dependencies] section.

In some cases, teams organize dependencies differently. For example, by having a `prod` group for runtime dependencies and a `dev` or `local` group for development tools.
With the current buildpack logic, `prod` is never installed because it is excluded along with `dev`.

I propose to use an environment variable like `UV_GROUPS`.

```
# This config
UV_GROUPS="prod,extra"

# Would give this command
uv sync --locked --no-default-groups --group prod --group extra
```

If`UV_GROUPS` is not set, behavior remains unchanged.

If `INSTALL_TEST` is set (Heroku CI), the existing logic for default groups remains untouched.

I will be happy to attempt a PR if needed

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.