-
Notifications
You must be signed in to change notification settings - Fork 140
Migrate to uv #960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Migrate to uv #960
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,2 @@ | ||
| # Install a project in a editable mode | ||
| pip3 install -e . | ||
| pip3 install -e ./ext/dapr-ext-grpc/ | ||
| pip3 install -e ./ext/dapr-ext-fastapi/ | ||
| pip3 install -e ./ext/dapr-ext-workflow/ | ||
|
|
||
| # Install required packages | ||
| pip3 install -r ./dev-requirements.txt | ||
| # Install all packages and dev dependencies | ||
| uv sync --all-packages --group dev |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,19 +15,19 @@ jobs: | |
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.10' | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel tox | ||
| run: uv sync --frozen --all-packages --group dev | ||
| - name: Run Autoformatter | ||
| run: | | ||
| tox -e ruff | ||
| uv run ruff check --fix && uv run ruff format | ||
| statusResult=$(git status -u --porcelain) | ||
| if [ -z $statusResult ] | ||
| if [ -z "$statusResult" ] | ||
| then | ||
| exit 0 | ||
| else | ||
| echo "Source files are not formatted correctly. Run 'tox -e ruff' to autoformat." | ||
| echo "Source files are not formatted correctly. Run 'uv run ruff check --fix && uv run ruff format'." | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
@@ -44,16 +44,23 @@ jobs: | |
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python_ver }} | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel tox | ||
| run: uv sync --frozen --all-packages --group dev | ||
| - name: Check Typing | ||
| run: | | ||
| tox -e type | ||
| run: uv run mypy | ||
| - name: Run unit-tests | ||
| run: | | ||
| tox -e py`echo "${{ matrix.python_ver }}" | sed 's/\.//g'` | ||
| uv run coverage run -m unittest discover -v ./tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-workflow/tests | ||
| uv run coverage run -a -m pytest -m "not e2e" ./ext/dapr-ext-workflow/tests/durabletask/ | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-grpc/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-fastapi/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-langgraph/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-strands/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/flask_dapr/tests | ||
| uv run coverage xml | ||
|
Comment on lines
+55
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment here on can we put the ./ext dir instead of each subdir here? |
||
| - name: Upload test coverage | ||
| uses: codecov/codecov-action@v6 | ||
| publish: | ||
|
|
@@ -71,52 +78,52 @@ jobs: | |
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel twine tox | ||
| pip install build twine | ||
| - name: Build and publish Dapr Python SDK | ||
acroca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish dapr-ext-workflow | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/dapr-ext-workflow | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish Dapr Flask Extension | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/flask_dapr | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish dapr-ext-grpc | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/dapr-ext-grpc | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish dapr-ext-fastapi | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/dapr-ext-fastapi | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish dapr-ext-langgraph | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/dapr-ext-langgraph | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| - name: Build and publish dapr-ext-strands | ||
| env: | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }} | ||
| run: | | ||
| cd ext/dapr-ext-strands | ||
| python setup.py sdist bdist_wheel | ||
| python -m build | ||
| twine upload dist/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,19 +21,19 @@ jobs: | |
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.10' | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel tox | ||
| run: uv sync --frozen --all-packages --group dev | ||
| - name: Run Autoformatter | ||
| run: | | ||
| tox -e ruff | ||
| uv run ruff check --fix && uv run ruff format | ||
| statusResult=$(git status -u --porcelain) | ||
| if [ -z "$statusResult" ] | ||
| then | ||
| exit 0 | ||
| else | ||
| echo "Source files are not formatted correctly. Run 'tox -e ruff' to autoformat." | ||
| echo "Source files are not formatted correctly. Run 'uv run ruff check --fix && uv run ruff format'." | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
@@ -50,15 +50,22 @@ jobs: | |
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python_ver }} | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel tox | ||
| run: uv sync --frozen --all-packages --group dev | ||
| - name: Check Typing | ||
| run: | | ||
| tox -e type | ||
| run: uv run mypy | ||
| - name: Run unit-tests | ||
| run: | | ||
| tox -e py`echo "${{ matrix.python_ver }}" | sed 's/\.//g'` | ||
| uv run coverage run -m unittest discover -v ./tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-workflow/tests | ||
| uv run coverage run -a -m pytest -m "not e2e" ./ext/dapr-ext-workflow/tests/durabletask/ | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-grpc/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-fastapi/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-langgraph/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-strands/tests | ||
| uv run coverage run -a -m unittest discover -v ./ext/flask_dapr/tests | ||
|
Comment on lines
+61
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a way to not have to specify each subdir here? |
||
| uv run coverage xml | ||
| - name: Upload test coverage | ||
| uses: codecov/codecov-action@v6 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,10 +91,10 @@ jobs: | |
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python_ver }} | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel twine tox | ||
| run: uv sync --frozen --all-packages --group examples | ||
| - name: Set up Dapr CLI | ||
| run: | | ||
| wget -q "https://github.com/dapr/cli/releases/download/v${{ env.DAPR_CLI_VER }}/dapr_${{ env.GOOS }}_${{ env.GOARCH }}.tar.gz" -O /tmp/dapr.tar.gz | ||
|
|
@@ -153,4 +153,26 @@ jobs: | |
| cd .. | ||
| - name: Check Examples | ||
| run: | | ||
| tox -e examples | ||
| cd examples | ||
| ./validate.sh conversation | ||
| ./validate.sh crypto | ||
| ./validate.sh metadata | ||
| ./validate.sh error_handling | ||
| ./validate.sh pubsub-simple | ||
| ./validate.sh pubsub-streaming | ||
| ./validate.sh pubsub-streaming-async | ||
| ./validate.sh state_store | ||
| ./validate.sh state_store_query | ||
| ./validate.sh secret_store | ||
| ./validate.sh invoke-simple | ||
| ./validate.sh invoke-custom-data | ||
| ./validate.sh demo_actor | ||
| ./validate.sh invoke-binding | ||
| ./validate.sh grpc_proxying | ||
| ./validate.sh w3c-tracing | ||
| ./validate.sh distributed_lock | ||
| ./validate.sh configuration | ||
| ./validate.sh workflow | ||
| ./validate.sh jobs | ||
| ./validate.sh langgraph-checkpointer | ||
| ./validate.sh ../ | ||
|
Comment on lines
+156
to
+178
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i feel like this might make it easy to get out of sync and miss some... is there a way to use the examples dir instead and point to it? |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we specify the dir ./ext/ instead of every subdir here?