Skip to content

Migrate to uv#960

Open
acroca wants to merge 19 commits intodapr:mainfrom
acroca:migrate-to-uv
Open

Migrate to uv#960
acroca wants to merge 19 commits intodapr:mainfrom
acroca:migrate-to-uv

Conversation

@acroca
Copy link
Copy Markdown
Member

@acroca acroca commented Mar 13, 2026

Summary

  • Replace tox.ini, setup.cfg, mypy.ini, and dev-requirements.txt with pyproject.toml (PEP 621) and a uv workspace
  • Add per-extension pyproject.toml files with [tool.uv.sources] workspace references
  • Update all CI workflows to use uv sync --frozen / uv run for lint, typecheck, tests, and example validation
  • Migrate tag-based publish steps from python setup.py sdist bdist_wheel to PEP 517 python -m build
  • Fix dapr-dev dependency rewrite using packaging.requirements.Requirement instead of fragile startswith check
  • Fix shell quoting bugs in CI autoformatter steps ($statusResult"$statusResult")
  • Add input validation and proper quoting to examples/validate.sh

@acroca acroca force-pushed the migrate-to-uv branch 2 times, most recently from c705df2 to 4158f64 Compare March 13, 2026 14:30
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.32%. Comparing base (bffb749) to head (bf3b2e3).
⚠️ Report is 105 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
- Coverage   86.63%   81.32%   -5.31%     
==========================================
  Files          84      139      +55     
  Lines        4473    13475    +9002     
==========================================
+ Hits         3875    10958    +7083     
- Misses        598     2517    +1919     

☔ 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.

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

This PR migrates the repository’s Python packaging and CI/dev workflows from tox + setup.cfg/requirements files to a uv-managed workspace driven by pyproject.toml, updating docs and GitHub Actions accordingly.

Changes:

  • Replace tox/dev-requirements.txt/mypy.ini/setup.cfg with pyproject.toml (PEP 621 + dependency groups + mypy/ruff config) and a uv workspace.
  • Add per-extension pyproject.toml files and adjust extension setup.py scripts for dev vs release publishing.
  • Update CI workflows and docs to use uv sync / uv run (including example validation via mechanical-markdown).

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tox.ini Removed tox-based env orchestration.
setup.py Stops declaring py.typed via package_data (moved to pyproject.toml).
setup.cfg Removed legacy setuptools metadata/deps (moved to pyproject.toml).
pyproject.toml Adds project metadata/deps, uv workspace + dependency groups, ruff + mypy config.
mypy.ini Removed mypy config file (moved to pyproject.toml).
ext/flask_dapr/setup.py Removes setup.cfg parsing; introduces hard-coded stable_requires + dev overrides.
ext/flask_dapr/setup.cfg Removed legacy extension metadata/deps.
ext/flask_dapr/pyproject.toml New PEP 621 metadata/deps for flask extension + uv workspace source.
ext/dapr-ext-workflow/setup.py Same migration pattern for workflow extension.
ext/dapr-ext-workflow/setup.cfg Removed legacy extension metadata/deps.
ext/dapr-ext-workflow/pyproject.toml New PEP 621 metadata/deps for workflow extension + uv workspace source.
ext/dapr-ext-strands/setup.py Same migration pattern for strands extension.
ext/dapr-ext-strands/setup.cfg Removed legacy extension metadata/deps.
ext/dapr-ext-strands/pyproject.toml New PEP 621 metadata/deps for strands extension + uv workspace source.
ext/dapr-ext-langgraph/setup.py Same migration pattern for langgraph extension.
ext/dapr-ext-langgraph/setup.cfg Removed legacy extension metadata/deps.
ext/dapr-ext-langgraph/pyproject.toml New PEP 621 metadata/deps for langgraph extension + uv workspace source.
ext/dapr-ext-grpc/setup.py Same migration pattern for grpc extension.
ext/dapr-ext-grpc/setup.cfg Removed legacy extension metadata/deps.
ext/dapr-ext-grpc/pyproject.toml New PEP 621 metadata/deps for grpc extension + uv workspace source.
ext/dapr-ext-fastapi/setup.py Same migration pattern for fastapi extension.
ext/dapr-ext-fastapi/setup.cfg Removed legacy extension metadata/deps.
ext/dapr-ext-fastapi/pyproject.toml New PEP 621 metadata/deps for fastapi extension + uv workspace source.
examples/validate.sh Runs mechanical-markdown via uv run.
dev-requirements.txt Removed (replaced by dependency groups in pyproject.toml).
README.md Updates dev instructions to uv-based workflow.
AGENTS.md Updates repo contributor instructions to uv-based workflow.
.github/workflows/validate_examples.yaml Uses uv to install deps and runs examples/validate.sh directly.
.github/workflows/build.yaml Uses uv for lint/typecheck/tests.
.github/workflows/build-tag.yaml Uses uv for lint/typecheck/tests; removes tox install in publish env.
.github/workflows/build-push-to-main.yaml Uses uv for lint/typecheck/tests; removes tox install in publish env.
.codecov.yml Updates ignored environment directory from .tox to .venv.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ext/dapr-ext-strands/setup.py Outdated
Comment thread ext/flask_dapr/setup.py
Comment thread README.md Outdated
Comment thread examples/validate.sh Outdated
Comment thread ext/dapr-ext-grpc/setup.py
Comment thread ext/dapr-ext-fastapi/setup.py
Comment thread ext/dapr-ext-workflow/setup.py
Comment thread ext/dapr-ext-langgraph/setup.py
@acroca acroca force-pushed the migrate-to-uv branch 2 times, most recently from a3ff39d to 4f777db Compare March 18, 2026 13:25
@acroca acroca requested a review from Copilot March 18, 2026 13:26
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

This PR migrates the repository’s packaging, dependency management, and CI/test execution from tox/setup.cfg/dev-requirements.txt to a uv + pyproject.toml-driven workflow, including converting each extension into a uv workspace member with its own pyproject.toml.

Changes:

  • Replace setup.cfg/mypy.ini/dev-requirements.txt/tox.ini with pyproject.toml configuration and uv dependency groups/workspace.
  • Update GitHub Actions workflows to install dependencies via uv sync and run lint/typecheck/tests/examples via uv run.
  • Add pyproject.toml files for extensions and adjust extension setup.py logic for dev builds.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tox.ini Removed tox-based env orchestration (lint/typecheck/tests/examples/docs).
setup.py Drops explicit package_data in favor of pyproject.toml setuptools config.
setup.cfg Removed; metadata/deps moved to pyproject.toml.
pyproject.toml Adds PEP 621 project metadata, setuptools config, uv workspace + dependency groups, and mypy config.
mypy.ini Removed; configuration moved under [tool.mypy] in pyproject.toml.
dev-requirements.txt Removed; replaced by uv dependency groups.
examples/validate.sh Runs mechanical-markdown via uv run --group examples.
README.md Updates local dev/test/typecheck/examples/docs instructions to use uv.
AGENTS.md Updates contributor guidance for uv workspace, commands, and CI references.
.github/workflows/validate_examples.yaml Switches example validation to uv sync and direct ./validate.sh invocations.
.github/workflows/build.yaml Migrates lint/typecheck/tests to uv-driven commands.
.github/workflows/build-tag.yaml Migrates lint/typecheck/tests to uv-driven commands; publish step still uses setup.py.
.github/workflows/build-push-to-main.yaml Migrates lint/typecheck/tests to uv-driven commands; publish step still uses setup.py.
.codecov.yml Updates ignored env dir from .tox to .venv.
ext/*/setup.py Removes setup.cfg parsing; adjusts dev install requirements handling.
ext/*/setup.cfg Removed; replaced by extension pyproject.toml.
ext/*/pyproject.toml Adds PEP 621 metadata/deps and setuptools config per extension.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/validate_examples.yaml Outdated
Comment thread README.md
@acroca acroca force-pushed the migrate-to-uv branch 2 times, most recently from 8502379 to 483f1ef Compare March 18, 2026 13:39
@acroca acroca requested a review from Copilot March 18, 2026 13:40
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

Migrates the repository’s Python packaging and developer workflow from tox/setup.cfg/dev-requirements to a uv + pyproject.toml-driven setup, and updates CI/docs to match.

Changes:

  • Move core package metadata/dependencies into pyproject.toml (PEP 621) and define a uv workspace + dependency groups.
  • Remove legacy tooling/config (tox.ini, setup.cfg, mypy.ini, dev-requirements.txt) and update docs/scripts to run via uv.
  • Update GitHub Actions workflows to install uv, sync dependency groups, and run tests/examples without tox.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tox.ini Removed legacy tox-based orchestration.
setup.cfg Removed core package metadata/dependency source (migrated to pyproject.toml).
setup.py Keeps dev-version suffix behavior; removed package_data argument.
pyproject.toml Adds PEP 621 project metadata, setuptools config, uv workspace/groups, and mypy config.
mypy.ini Removed; mypy config moved into pyproject.toml.
dev-requirements.txt Removed; dev deps moved into uv dependency groups.
examples/validate.sh Runs mechanical-markdown via uv run --group examples.
README.md Updates contributor commands to use uv instead of tox/pip.
AGENTS.md Updates agent/developer guidance to uv + pyproject-based workflow.
.github/workflows/build.yaml CI now installs uv, syncs groups, runs ruff/mypy/tests via uv.
.github/workflows/build-tag.yaml Same CI migration for tag builds; publish job still uses python setup.py ....
.github/workflows/build-push-to-main.yaml Same CI migration for main branch; publish job still uses python setup.py ....
.github/workflows/validate_examples.yaml Uses uv to install deps and runs example validation without tox.
.codecov.yml Updates ignore path from .tox to .venv.
ext/*/setup.cfg Removed extension metadata/dependency sources (migrated to per-extension pyproject.toml).
ext/*/setup.py Reworked to compute dev name/version and rewrite daprdapr-dev for dev builds.
ext/*/pyproject.toml New per-extension package metadata/dependencies + workspace source mapping.
ext/dapr-ext-workflow/AGENTS.md / examples/AGENTS.md Documentation cleanups related to examples/workflow guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ext/dapr-ext-langgraph/setup.py Outdated
Comment thread README.md Outdated
Comment thread AGENTS.md Outdated
Comment thread .github/workflows/build-tag.yaml
Comment thread .github/workflows/build-push-to-main.yaml
Comment thread ext/flask_dapr/setup.py Outdated
Comment thread ext/dapr-ext-workflow/setup.py Outdated
Comment thread ext/dapr-ext-fastapi/setup.py Outdated
Comment thread ext/dapr-ext-strands/setup.py
Comment thread ext/dapr-ext-grpc/setup.py Outdated
@acroca acroca force-pushed the migrate-to-uv branch 2 times, most recently from ca71a28 to 924ed1f Compare March 18, 2026 14:34
@acroca acroca requested a review from Copilot March 18, 2026 14:34
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

This PR migrates the repository from tox/setup.cfg-driven workflows to a uv + pyproject.toml (PEP 621) setup, updating CI and contributor docs accordingly.

Changes:

  • Move core + extension package metadata/dependencies into pyproject.toml files and delete setup.cfg/mypy.ini/dev-requirements.txt/tox.ini.
  • Update GitHub Actions workflows to install via uv sync and run lint/typecheck/tests/examples via uv run.
  • Update contributor documentation and example validation scripts to use uv.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
tox.ini Removed tox-based test/lint/typecheck/examples orchestration.
setup.py Simplified core setup script; relies on pyproject for metadata; removed package_data.
setup.cfg Removed legacy core package metadata/deps config.
pyproject.toml Added PEP 621 project metadata, dependencies, setuptools config, uv workspace/groups, ruff+mypy config.
mypy.ini Removed legacy mypy config (now in pyproject.toml).
ext/flask_dapr/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/flask_dapr/setup.cfg Removed legacy extension metadata/deps config.
ext/flask_dapr/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
ext/dapr-ext-workflow/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/dapr-ext-workflow/setup.cfg Removed legacy extension metadata/deps config.
ext/dapr-ext-workflow/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
ext/dapr-ext-workflow/AGENTS.md Updated docs to reference pyproject.toml instead of setup.cfg.
ext/dapr-ext-strands/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/dapr-ext-strands/setup.cfg Removed legacy extension metadata/deps config.
ext/dapr-ext-strands/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
ext/dapr-ext-langgraph/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/dapr-ext-langgraph/setup.cfg Removed legacy extension metadata/deps config.
ext/dapr-ext-langgraph/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
ext/dapr-ext-grpc/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/dapr-ext-grpc/setup.cfg Removed legacy extension metadata/deps config.
ext/dapr-ext-grpc/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
ext/dapr-ext-fastapi/setup.py Stop reading deps from setup.cfg; hardcode deps and dev dapr-dev rewrite logic.
ext/dapr-ext-fastapi/setup.cfg Removed legacy extension metadata/deps config.
ext/dapr-ext-fastapi/pyproject.toml Added extension PEP 621 metadata + deps + setuptools config + uv workspace source.
examples/validate.sh Run mechanical-markdown via uv run --group examples.
examples/AGENTS.md Updated example-running guidance to reflect CI workflow (not tox).
dev-requirements.txt Removed legacy dev dependency list (moved to uv dependency group).
README.md Updated build/test/docs instructions to use uv commands.
AGENTS.md Updated repo contributor guide to use uv and pyproject-based tooling.
.github/workflows/validate_examples.yaml Switched examples CI job from tox to uv sync + direct validate.sh calls.
.github/workflows/build.yaml Switched CI to uv sync + uv run for ruff/mypy/tests/coverage.
.github/workflows/build-tag.yaml Switched CI to uv; publish now uses python -m build (PEP 517).
.github/workflows/build-push-to-main.yaml Switched CI to uv; publish now uses python -m build (PEP 517).
.codecov.yml Update ignored env directory from .tox to .venv.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build-push-to-main.yaml Outdated
Comment thread pyproject.toml
Comment thread ext/dapr-ext-grpc/pyproject.toml Outdated
Comment thread ext/dapr-ext-strands/pyproject.toml Outdated
Comment thread ext/dapr-ext-workflow/pyproject.toml Outdated
Comment thread AGENTS.md
Comment thread ext/dapr-ext-langgraph/pyproject.toml Outdated
Comment thread .github/workflows/build.yaml Outdated
Comment thread ext/dapr-ext-fastapi/pyproject.toml Outdated
Comment thread .github/workflows/validate_examples.yaml Outdated
@acroca acroca force-pushed the migrate-to-uv branch 4 times, most recently from 02c4da1 to 75f185b Compare March 24, 2026 13:53
Signed-off-by: Albert Callarisa <albert@diagrid.io>
acroca added 2 commits April 1, 2026 14:41
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
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 40 out of 41 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread setup.py
Comment thread .github/workflows/build-push-to-main.yaml
Comment thread ext/dapr-ext-grpc/pyproject.toml Outdated
Comment thread ext/flask_dapr/setup.py
Comment thread ext/dapr-ext-workflow/setup.py
Comment thread ext/dapr-ext-strands/setup.py
Comment thread ext/dapr-ext-langgraph/setup.py
Comment thread ext/dapr-ext-grpc/setup.py
Comment thread ext/dapr-ext-fastapi/setup.py
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Copy link
Copy Markdown
Contributor

@sicoyle sicoyle left a comment

Choose a reason for hiding this comment

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

few comments so far - thank you bc this will be a great improvement 🙌

Comment thread .github/workflows/build-push-to-main.yaml Outdated
Comment thread .github/workflows/build-tag.yaml
Comment thread .github/workflows/build.yaml Outdated
Comment thread .github/workflows/validate_examples.yaml
import os
import sys

if sys.version_info >= (3, 11):
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.

i see python 3.10 supported elsewhere... so pls add 3.10 here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

3.10 is supported in the else. For 3.11+ we use the stdlib, but for 3.10 we use tomli

Comment thread ext/dapr-ext-grpc/pyproject.toml Outdated
Source = "https://github.com/dapr/python-sdk"

[build-system]
requires = ["setuptools>=61.0", "wheel", "packaging", "tomli; python_version < '3.11'"]
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.

3.10

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.

is this resolved? We support down to 3.10... so why is this 3.11?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

tomli is only added as an external dependency in 3.10 because it was added to the stdlib in 3.11. That's why the dependency has this condition, as well as the imports.

Comment thread ext/dapr-ext-grpc/setup.py
acroca added 2 commits April 8, 2026 13:17
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
@acroca acroca requested a review from sicoyle April 8, 2026 13:40
Comment thread ext/dapr-ext-fastapi/pyproject.toml Outdated
Comment thread ext/dapr-ext-grpc/pyproject.toml Outdated
Source = "https://github.com/dapr/python-sdk"

[build-system]
requires = ["setuptools>=61.0", "wheel", "packaging", "tomli; python_version < '3.11'"]
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.

is this resolved? We support down to 3.10... so why is this 3.11?

import os
import sys

if sys.version_info >= (3, 11):
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.

isnt this supposed to be 3.10 as lowest?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As mentioned in a separated related thread, 3.10 needs tomli as a dependency, but from 3.11 the stdlib includes it, so doesn't require the external dependency, and the import is different.

Copy link
Copy Markdown
Contributor

@sicoyle sicoyle left a comment

Choose a reason for hiding this comment

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

few more commetns pls

Comment thread ext/flask_dapr/pyproject.toml Outdated
"Programming Language :: Python :: 3.14",
]
dependencies = [
"Flask>=1.1",
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.

1.1 is super low. It also does not follow semantic conventions. There is a flask 3.1.3 can you bump us or at least use a major.minor.patch version?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would like to keep existing dependencies in this PR to keep it simpler

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread ext/flask_dapr/pyproject.toml Outdated
Comment thread AGENTS.md Outdated
acroca added 7 commits April 16, 2026 11:48
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Uses lower bound based on previous dependency, set a higher bound to the upcoming major version.

Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Copy link
Copy Markdown
Contributor

@CasperGN CasperGN left a comment

Choose a reason for hiding this comment

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

Don't specify the version when serving the dependency from a workspace member

Comment thread ext/dapr-ext-langgraph/pyproject.toml Outdated
Comment thread ext/dapr-ext-grpc/pyproject.toml Outdated
Comment thread ext/dapr-ext-fastapi/pyproject.toml Outdated
Comment thread ext/dapr-ext-strands/pyproject.toml Outdated
Comment thread ext/dapr-ext-workflow/pyproject.toml Outdated
Comment thread ext/flask_dapr/pyproject.toml Outdated
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.

5 participants