Make test dependencies required instead of optional#1551
Draft
Make test dependencies required instead of optional#1551
Conversation
This change moves pytest and anyio from optional dev dependencies to required dependencies to prevent issues when running `uv sync` without `--all-extras`. Changes: - Moved pytest and anyio to main dependencies in pyproject.toml - Removed `--all-extras` flag from CI workflow since it's no longer needed - This prevents developers from accidentally running sync without test deps The `--all-extras` flag was previously required in CI and local development, which was error-prone since running `uv sync` would remove test dependencies, breaking the ability to run tests.
Contributor
Author
|
Marked this as draft as I'm not actually sure this is the best approach here. Basically, I was annoyed having to remember to type --all-extras, and was thinking it just makes more sense to include the optional dependencies in the dev dependencies by default. Otherwise, maybe would it be better to just mark the tests that rely on those optional dependencies to skip if they're not installed? But what if that just masks issues down the road? |
Kludex
reviewed
Oct 31, 2025
Comment on lines
+63
to
+67
| # Optional dependencies needed for testing | ||
| "rich>=13.9.4", | ||
| "typer>=0.16.0", | ||
| "python-dotenv>=1.0.0", | ||
| "websockets>=15.0.1", |
Member
There was a problem hiding this comment.
This is the same as: https://github.com/Kludex/starlette/pull/2999/files#r2327181201
Suggested change
| # Optional dependencies needed for testing | |
| "rich>=13.9.4", | |
| "typer>=0.16.0", | |
| "python-dotenv>=1.0.0", | |
| "websockets>=15.0.1", | |
| # Optional dependencies needed for testing | |
| "mcp[rich, cli, ws]" |
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.
Summary
This PR adds
rich,typer,python-dotenv, andwebsocketsto the required dev dependencies.Motivation and Context
Previously, these dependencies were only available when specific optional features were enabled (e.g.,
[cli],[sse]). This meant runninguv syncwithout--all-extraswouldn't install them, which was problematic because:uv syncwithout--all-extras--all-extrasflag had to be remembered and used consistently across development workflows--all-extrasto function properlyThis change makes development more ergonomic by ensuring all dependencies needed for testing are always present.
How Has This Been Tested?
uv syncnow includes rich, typer, python-dotenv, and websockets--all-extras) still work correctlyBreaking Changes
None - this only affects development workflow, not the published package.
Types of changes
Checklist
Additional context
The main benefit is that
uv syncnow "just works" without needing to remember--all-extras. The CI workflow has been updated to remove the--all-extrasflag since it's no longer needed.