Skip to content

fix(framework): Make Starlette a core dependency#7511

Open
mohammadnaseri wants to merge 1 commit into
mainfrom
make-starlette-core-dependency
Open

fix(framework): Make Starlette a core dependency#7511
mohammadnaseri wants to merge 1 commit into
mainfrom
make-starlette-core-dependency

Conversation

@mohammadnaseri

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 1, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 starlette to a required dependency and remove the rest optional extra.
  • Regenerate/update uv.lock to reflect the dependency graph and extras list changes.
  • Update exit-code help text and docs for [601] COMMON_MISSING_EXTRA_REST to instruct upgrading/reinstalling flwr.

Critical issues

  • Removing the rest extra breaks internal e2e packages still depending on flwr[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 requests symbols before the guarded import requests, causing import-time failure before flwr_exit(...) can run.
  • Localized docs catalogs (framework/docs/locales/*/*.po) still include the old “install with rest extra” 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.

Comment thread framework/pyproject.toml
Comment on lines 69 to 73
[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'",
]
Comment on lines 179 to 183
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`:

Comment on lines +9 to +19
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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread framework/pyproject.toml
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions github-actions Bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Used to determine what PRs (mainly) come from Flower maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants