refactor: Enhance package dependency structure with PEP-compliant boundaries#1055
Open
eugengi wants to merge 1 commit into
Open
refactor: Enhance package dependency structure with PEP-compliant boundaries#1055eugengi wants to merge 1 commit into
eugengi wants to merge 1 commit into
Conversation
Enhance the pkg dependency definition with PEP 735 (dependency-groups) [Decisions] - Create clear boundaries between extras and local deps [Changes] - Update pip install cmds to match PEP 735 convention - Segregate examples deps into smaller install contracts [Note] - Examples adapter tests skipped in CI remain skipped - Creates environments with exactly what you need; nothing more or less - Group installs require pip `>=v25.1`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the package dependencies to align them with PEP 621 and PEP 735. By default, the package includes all local or non-runtime dependencies in the table
[project.optional-dependencies].optional-dependenciesis published package metadata for extras.Note
Extras are for optional package (runtime) functionality that ships with the distribution and becomes part of the public install contract.
PEP 621 also explicitly rejects the idea of recommending a
devextra for development-related dependencies. Therefore, includingdev,examples,test,docs, etc. (internal tooling) underoptional-dependenciesis an anti-pattern. The solution to this isdependency-groups(PEP 735) for dependency sets that are not published in built distributions. This contrasts with extras oroptional-dependencies, which are for consumer-facing, installable features that users can request if needed.Decisions
lint,test,examples-s3, etc.)include-groupmechanism for composability and aggregate group sets (i.e.,dev,examples)otelhas been retained underoptional-dependenciesas a valid extra exposed in the packages install contract:claude-agent-sdk-python[otel]Additional
Important
This update requires
pipminimum version25.1.0, which supports installing dependency-groups:pip install --group <group-set>pipinstall invocations, particularly in GHA workflows and Markdown files, have been updated to match the aboveReferences