fix(framework): Make Starlette a core dependency#7511
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes Starlette a core flwr framework dependency (instead of being gated behind the removed rest extra) and updates user-facing guidance for exit code 601 accordingly.
Changes:
- Promote
starletteto a required dependency and remove therestoptional extra. - Regenerate/update
uv.lockto reflect the dependency graph and extras list changes. - Update exit-code help text and docs for
[601] COMMON_MISSING_EXTRA_RESTto instruct upgrading/reinstallingflwr.
Critical issues
- Removing the
restextra breaks internal e2e packages still depending onflwr[simulation,rest](e.g.,framework/e2e/e2e-bare/pyproject.toml,framework/e2e/e2e-scikit-learn/pyproject.toml). Those need to be updated (or an alias extra provided) to avoid installation/CI failures.
Simplicity/readability suggestions
- None.
Consistency concerns
- The improved 601 guidance may not be shown in some cases because at least one REST module imports
requestssymbols before the guardedimport requests, causing import-time failure beforeflwr_exit(...)can run. - Localized docs catalogs (
framework/docs/locales/*/*.po) still include the old “install withrestextra” guidance and should be regenerated/updated after the English source change.
Whether the PR should be split
- No (changes are coherent around the dependency move), but follow-up commits are needed to update internal e2e dependency declarations and docs locales.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| framework/uv.lock | Adds Starlette to core dependencies and removes the rest extra from metadata. |
| framework/pyproject.toml | Makes Starlette a core dependency and removes the rest optional-dependency group. |
| framework/py/flwr/supercore/exit/exit_code.py | Updates exit code 601 help text to reflect removal of the rest extra. |
| framework/docs/source/ref-exit-codes/601.rst | Updates docs instructions for resolving exit code 601 after the packaging change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [project.optional-dependencies] | ||
| simulation = [ | ||
| "ray==2.55.1; python_version >= '3.11' and python_version < '3.13'", | ||
| "ray==2.55.1; python_version >= '3.13' and python_version < '3.15' and sys_platform != 'win32'", | ||
| ] |
| ExitCode.COMMON_MISSING_EXTRA_REST: """ | ||
| Extra dependencies required for using the REST-based Fleet API are missing. | ||
| Dependencies required for using the REST-based Fleet API are missing. | ||
|
|
||
| To use the REST API, install `flwr` with the `rest` extra: | ||
| To use the REST API, reinstall or upgrade `flwr`: | ||
|
|
| Dependencies required for using the REST-based Fleet API are missing. | ||
|
|
||
| **************** | ||
| How to Resolve | ||
| **************** | ||
|
|
||
| To enable the REST-based Fleet API, install ``flwr`` with the ``rest`` extra: | ||
| To enable the REST-based Fleet API, reinstall or upgrade ``flwr``: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| pip install "flwr[rest]" | ||
| pip install --upgrade flwr |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62ead4ae87
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "alembic>=1.18.1,<2.0.0", | ||
| "uvicorn[standard]>=0.49.0,<0.50.0", | ||
| "fastapi>=0.138.0,<0.139.0", | ||
| "starlette>=1.3.1,<1.4.0", |
There was a problem hiding this comment.
Preserve the rest extra for compatibility
Adding Starlette as a required dependency makes the extra empty, but removing the rest extra from package metadata breaks workflows that still select it explicitly, such as uv sync --extra rest from a source checkout, and the repo still has app configs declaring flwr[simulation,rest] in framework/e2e/e2e-bare/pyproject.toml and framework/e2e/e2e-scikit-learn/pyproject.toml. Keeping rest = [] while making Starlette core would preserve those existing install paths without changing dependencies.
Useful? React with 👍 / 👎.
No description provided.