Migrate from optional-dependencies to dependency-groups#168
Migrate from optional-dependencies to dependency-groups#168harupy wants to merge 2 commits intogithub:mainfrom
Conversation
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the Python SDK’s dev dependency handling from pip/extras (optional-dependencies) to uv’s dependency groups, and updates documentation and lockfile accordingly.
Changes:
- Switches from
[project.optional-dependencies]to[dependency-groups]for Python dev dependencies inpyproject.toml. - Regenerates
uv.lockto represent dev dependencies viadev-dependenciesandmetadata.requires-devinstead of extras. - Updates the Python README install instructions to reference
uv syncrather than the old".[dev]"extras pattern.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/pyproject.toml | Defines a dependency-groups.dev group holding the former dev extras, aligning the project with uv’s dependency group model. |
| python/uv.lock | Reflects the new dev dependency representation ([package.dev-dependencies] and [package.metadata.requires-dev]) for the github-copilot-sdk package. |
| python/README.md | Updates installation instructions toward uv-based workflows, though the new pip example currently uses an invalid --group flag and needs correction; also note that CONTRIBUTING.md still references the old ".[dev]" extras pattern and should be updated separately. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
python/README.md
Outdated
|
|
||
| ```bash | ||
| pip install -e ".[dev]" | ||
| pip install -e --group dev . |
There was a problem hiding this comment.
The updated installation snippet mixes pip install with a --group flag, but pip itself doesn’t support --group—that flag is specific to uv and will cause this command to fail. To keep the instructions working after switching to dependency groups, this line should either use a valid pip command (without --group) or be rewritten to use uv in a way that correctly installs the dev group (similar to the uv sync example below).
| pip install -e --group dev . | |
| pip install -e . |
There was a problem hiding this comment.
pip >= v25.1 supports --group: https://pip.pypa.io/en/latest/news/#v25-1
|
@friggeri would you mind taking a look? |
|
@brettcannon do you mind opining? |
| pip install -e . --group dev | ||
| # or | ||
| uv pip install -e ".[dev]" | ||
| uv sync |
There was a problem hiding this comment.
Do note that due to the uv.lock file that is checked in that this is not equivalent to the command it's replacing.
(Sorry for the brevity; sick toddler.) |
Summary
Migrates the Python SDK from pip's optional-dependencies pattern to uv's dependency-groups pattern for dev dependencies.
Changes
[project.optional-dependencies]to[dependency-groups]uv syncinstead ofpip install -e ".[dev]"