Skip to content

Merge extensions into core package as PEP 771 extras#1054

Draft
seherv wants to merge 3 commits into
dapr:mainfrom
seherv:bundled-optional-exts
Draft

Merge extensions into core package as PEP 771 extras#1054
seherv wants to merge 3 commits into
dapr:mainfrom
seherv:bundled-optional-exts

Conversation

@seherv
Copy link
Copy Markdown
Contributor

@seherv seherv commented May 26, 2026

Description

Moves all the dapr-ext* packages into the main dapr package, and exposes them as extras.

pip install dapr-ext-pkgname is now pip install "dapr[pkgname]".

IMPORTANT: this is a breaking change, unlike the dapr*-dev removal. All the old extension packages must be uninstalled manually before re-installing dapr. More info in dapr/__init__.py, README.md and RELEASE.md.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1026

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

seherv added 2 commits May 26, 2026 09:45
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 65.44118% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.70%. Comparing base (bffb749) to head (e4df2af).
⚠️ Report is 134 commits behind head on main.

Files with missing lines Patch % Lines
dapr/__init__.py 51.94% 37 Missing ⚠️
dapr/ext/fastapi/__init__.py 60.00% 2 Missing ⚠️
dapr/ext/flask/__init__.py 60.00% 2 Missing ⚠️
dapr/ext/grpc/__init__.py 50.00% 2 Missing ⚠️
dapr/ext/langgraph/__init__.py 50.00% 2 Missing ⚠️
dapr/ext/strands/__init__.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1054      +/-   ##
==========================================
- Coverage   86.63%   81.70%   -4.93%     
==========================================
  Files          84      116      +32     
  Lines        4473     9276    +4803     
==========================================
+ Hits         3875     7579    +3704     
- Misses        598     1697    +1099     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JoshVanL JoshVanL requested a review from Copilot May 26, 2026 10:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@seherv seherv requested a review from Copilot May 27, 2026 08:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 121 out of 201 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

pyproject.toml:1

  • The dependency was renamed from msgpack-python (legacy, last release 0.5.6, capped at <1.0.0 in the deleted ext/*/pyproject.toml) to msgpack with >=1.0,<2.0. These are distinct PyPI projects with different APIs — msgpack 1.x removed encoding=/use_bin_type defaults and changed Unpacker/packb keyword arguments. Confirm that dapr/ext/langgraph/dapr_checkpointer.py and dapr/ext/strands/dapr_session_manager.py actually use the msgpack (1.x) API and not the msgpack-python (0.x) API; otherwise serialization of existing checkpoints/sessions in production state stores will break silently on upgrade.
    flask_dapr/init.py:1
  • Importing actor and app as names from dapr.ext.flask only works if those submodules have already been bound as attributes of the parent package. dapr/ext/flask/__init__.py does from .actor import DaprActor / from .app import DaprApp, which sets the attributes as a side effect — but only when those imports succeed. If the optional flask dependency is missing, dapr.ext.flask.__init__ raises a new ImportError before binding actor/app, and this line will then raise ImportError: cannot import name 'actor' from 'dapr.ext.flask', masking the intended FutureWarning-then-helpful-error path. Consider importing the submodules explicitly (from dapr.ext.flask import actor, app on its own line, or import dapr.ext.flask.actor as actor) and/or wrapping in a try/except that surfaces the original cause.

Comment thread dapr/__init__.py
Comment on lines +116 to +118
init_file = dapr_root / bundled_path_prefix[len('dapr/') :] / '__init__.py'
else:
init_file = site_root / bundled_path_prefix / '__init__.py'
Comment on lines +96 to +99
# --skip-existing makes the step retry-safe: if a previous attempt
# partially succeeded and the workflow is re-run, twine treats an
# already-uploaded file as success instead of failing the step.
twine upload --skip-existing dist/*
Comment thread AGENTS.md
├── dapr-ext-langgraph/ # LangGraph checkpointer ← see ext/dapr-ext-langgraph/AGENTS.md
├── dapr-ext-strands/ # Strands agent sessions ← see ext/dapr-ext-strands/AGENTS.md
└── flask_dapr/ # Flask integration ← see ext/flask_dapr/AGENTS.md
flask_dapr/ # Deprecation shim: re-exports dapr.ext.flask with FutureWarning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge dapr-ext-* packages into the SDK as core/extras

2 participants