-
Notifications
You must be signed in to change notification settings - Fork 9
Use uv as the unified project manager
#38
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 all commits
8c5b8e9
a6d1088
9d9f695
91f9c9d
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 |
|---|---|---|
|
|
@@ -2,9 +2,9 @@ name: Unit Tests | |
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| branches: [main] | ||
| push: | ||
| branches: [ main ] | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
|
|
@@ -15,46 +15,25 @@ jobs: | |
| fail-fast: false | ||
| matrix: | ||
| python-version: | ||
| - '3.10' | ||
| - '3.11' | ||
| - '3.12' | ||
| - '3.13' | ||
| poetry-version: ["1.8.3"] | ||
| - "3.10" | ||
| - "3.11" | ||
| - "3.12" | ||
| - "3.13" | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| fetch-depth: 0 # need all versions to be able to access server tree commit logs | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # latest | ||
| with: | ||
| packages: python3-dev libldap2-dev libsasl2-dev | ||
| version: 1.0 | ||
| - name: Load cached Poetry Binary | ||
| id: cached-poetry-binary | ||
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
| with: | ||
| path: ~/.local | ||
| key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }} | ||
| - name: Install Poetry | ||
| if: steps.cached-poetry-binary.outputs.cache-hit != 'true' | ||
| uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 | ||
| with: | ||
| version: ${{ matrix.poetry-version }} | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
| - name: Load cached venv | ||
| id: cached-poetry-dependencies | ||
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
| - name: Install dependencies | ||
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| run: poetry install --no-interaction --no-root ${{ inputs.install-args }} | ||
| - name: Test with pytest | ||
| run: | | ||
| poetry run pytest -rA | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # need all versions to be able to access server tree commit logs | ||
| persist-credentials: false | ||
| - name: Install uv and set the Python version | ||
| uses: astral-sh/setup-uv@v7 | ||
|
Contributor
Author
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. Would you mind reviewing this change where I use the
Member
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. If we want to keep the original caching behavior, we could try https://github.com/astral-sh/setup-uv/blob/main/docs/caching.md. But if the CI isn't run as often, I think we're good to keep it as is. |
||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| enable-cache: true # enable built-in caching of uv | ||
| - uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # latest | ||
|
Contributor
Author
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 think this is not |
||
| with: | ||
| packages: python3-dev libldap2-dev libsasl2-dev | ||
| version: 1.0 | ||
| - name: Install dependencies | ||
| run: uv sync --locked --all-extras --group test | ||
| - name: Test with pytest | ||
| run: uv run pytest -rA | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| .PHONY: example-dev example-run | ||
|
|
||
| example-dev: | ||
| @poetry run python3 examples/snippets/simple_app.py | ||
| @uv run examples/snippets/simple_app.py | ||
|
|
||
| example-run: | ||
| @poetry run hypercorn examples.snippets.simple_app:app | ||
| @uv run hypercorn examples.snippets.simple_app:app |
Uh oh!
There was an error while loading. Please reload this page.