-
Notifications
You must be signed in to change notification settings - Fork 1k
Switch from venv+pip to uv #2723
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
Changes from 4 commits
9dead77
f0f73b9
13cdf90
1624397
7e947fa
a91d3fd
3192278
2a548bc
5f632dc
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 |
|---|---|---|
|
|
@@ -54,75 +54,49 @@ jobs: | |
| - name: Checkout repo from github | ||
| uses: actions/[email protected] | ||
|
|
||
| - name: Set up Python ${{ matrix.python }} | ||
| uses: actions/setup-[email protected] | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| enable-cache: true | ||
|
|
||
| - name: Set venv path (NON Windows) | ||
| if: matrix.os != 'windows-latest' | ||
| - name: Create virtualenv and sync dependencies | ||
| run: | | ||
| echo "VIRTUAL_ENV=${{ github.workspace }}/venv" >> $GITHUB_ENV | ||
| echo ${{ github.workspace }}/venv/bin >> $GITHUB_PATH | ||
|
|
||
| - name: Set venv path (Windows) | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| echo "VIRTUAL_ENV=${{ github.workspace }}\\venv" >> $Env:GITHUB_ENV | ||
| echo "${{ github.workspace }}\\venv\\Scripts" >> $Env:GITHUB_PATH | ||
|
|
||
| - name: Restore base Python virtual environment | ||
| id: cache-venv | ||
| uses: actions/[email protected] | ||
| with: | ||
| path: ${{ env.VIRTUAL_ENV }} | ||
| key: >- | ||
| ${{ runner.os }}-${{ matrix.python }}-venv-${{ | ||
| hashFiles('pyproject.toml') }} | ||
|
|
||
| - name: Create venv (NEW CACHE) | ||
| if: steps.cache-venv.outputs.cache-hit != 'true' | ||
| run: | | ||
| python -m venv ${{ env.VIRTUAL_ENV }} | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[all]" | ||
| uv sync --all-extras | ||
|
|
||
| - name: codespell | ||
| if: matrix.run_doc == true | ||
| run: | | ||
| codespell | ||
| uv run codespell --skip "*.lock" | ||
|
|
||
| - name: dcoumentation | ||
| - name: documentation | ||
| if: matrix.run_doc == true | ||
| run: | | ||
| cd doc; ./build_html | ||
| run: cd doc && ./build_html | ||
|
|
||
| - name: pylint | ||
| if: matrix.run_lint == true | ||
| run: | | ||
| pylint --recursive=y examples pymodbus test | ||
| uv run pylint --recursive=y examples pymodbus test | ||
|
|
||
| - name: mypy | ||
| if: matrix.run_lint == true | ||
| run: | | ||
| mypy pymodbus examples | ||
| uv run mypy pymodbus examples | ||
|
|
||
| - name: ruff | ||
| if: matrix.run_lint == true | ||
| run: | | ||
| ruff check . | ||
| uv run ruff check . | ||
|
|
||
| - name: pytest | ||
| if: ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13') }} | ||
| run: | | ||
| env | ||
| pytest | ||
| if: ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13.0') }} | ||
| run: | | ||
| uv run pytest | ||
|
|
||
| - name: pytest coverage | ||
| if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13') }} | ||
| if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13.0') }} | ||
| run: | | ||
| env | ||
| pytest --cov | ||
| uv run pytest --cov | ||
|
|
||
| analyze: | ||
| name: Analyze Python | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,10 @@ zip -9 doc/source/_static/examples.zip examples/* | |
| tar -czf doc/source/_static/examples.tgz examples | ||
| popd | ||
|
|
||
| sphinx-build -M html "." "../build/html" | ||
| if command -v uv &> /dev/null; then | ||
|
||
| echo "Using: uv run sphinx-build" | ||
| uv run sphinx-build -M html "." "../build/html" | ||
| else | ||
| echo "Using: sphinx-build" | ||
| sphinx-build -M html "." "../build/html" | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.