-
Notifications
You must be signed in to change notification settings - Fork 8
Poetry -> UV #30
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: master
Are you sure you want to change the base?
Poetry -> UV #30
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 |
|---|---|---|
|
|
@@ -6,42 +6,54 @@ jobs: | |
| lint: | ||
| strategy: | ||
| matrix: | ||
| cmd: | ||
| - black | ||
| - ruff | ||
| - mypy | ||
| cmd: [ "black", "ruff-check", "mypy" ] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Install poetry | ||
| run: pipx install poetry | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| cache: "poetry" | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
|
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. I think you don't need separate |
||
| with: | ||
| python-version: 3.14 | ||
| - id: setup-uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| cache-suffix: 3.14 | ||
| version: "latest" | ||
| python-version: 3.14 | ||
| - name: Install deps | ||
| run: poetry install --all-extras | ||
| env: | ||
| UV_NO_MANAGED_PYTHON: 1 | ||
| run: uv sync --all-extras --python 3.14 | ||
|
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. No need to call |
||
| - name: Run lint check | ||
| run: poetry run pre-commit run -a ${{ matrix.cmd }} | ||
| run: uv run pre-commit run -a ${{ matrix.cmd }} | ||
| pytest: | ||
| strategy: | ||
| matrix: | ||
| py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
| runs-on: "ubuntu-latest" | ||
| py_version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ] | ||
| pydantic_ver: [ "<2", ">=2.5,<3" ] | ||
| os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
| runs-on: "${{ matrix.os }}" | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v2 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.py_version }} | ||
| - id: setup-uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: "${{ matrix.py_version }}" | ||
| - name: Update pip | ||
| run: python -m pip install -U pip | ||
| - name: Install poetry | ||
| run: python -m pip install poetry | ||
| enable-cache: true | ||
| cache-suffix: ${{ matrix.py_version }} | ||
| version: "latest" | ||
| python-version: ${{ matrix.py_version }} | ||
| - name: Install deps | ||
| run: poetry install | ||
| env: | ||
| POETRY_VIRTUALENVS_CREATE: false | ||
| UV_NO_MANAGED_PYTHON: 1 | ||
| run: uv sync --all-extras --python ${{ matrix.py_version }} | ||
| - name: Setup pydantic version | ||
| run: uv pip install "pydantic ${{ matrix.pydantic_ver }}" | ||
| - name: Run pytest check | ||
| run: poetry run pytest -vv -n auto --cov="taskiq_pipelines" . | ||
| run: uv run pytest -vv -n auto . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,60 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
|
|
||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v2.4.0 | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-ast | ||
| - id: trailing-whitespace | ||
| - id: check-added-large-files | ||
| - id: pretty-format-json | ||
| args: | ||
| - "--indent=2" | ||
| - "--autofix" | ||
| - id: check-json | ||
| - id: check-yaml | ||
| exclude: .github/ | ||
| - id: check-toml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
|
|
||
| - repo: https://github.com/asottile/add-trailing-comma | ||
| rev: v2.1.0 | ||
| rev: v4.0.0 | ||
| hooks: | ||
| - id: add-trailing-comma | ||
|
|
||
| - repo: local | ||
| - repo: https://github.com/crate-ci/typos | ||
| rev: v1 | ||
| hooks: | ||
| - id: black | ||
| name: Format with Black | ||
| entry: poetry run black | ||
| language: system | ||
| types: [python] | ||
| - id: typos | ||
|
|
||
| - id: ruff | ||
| name: Run ruff lints | ||
| entry: poetry run ruff | ||
| language: system | ||
| pass_filenames: false | ||
| types: [python] | ||
| args: | ||
| - "check" | ||
| - "--fix" | ||
| - "." | ||
| - repo: https://github.com/Yelp/detect-secrets | ||
| rev: v1.5.0 | ||
| hooks: | ||
| - id: detect-secrets | ||
|
|
||
| - repo: https://github.com/astral-sh/uv-pre-commit | ||
| rev: 0.11.2 | ||
| hooks: | ||
| - id: uv-lock | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.8 | ||
| hooks: | ||
| - id: ruff-format | ||
| - id: ruff-check | ||
| args: [ --fix, --unsafe-fixes ] | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: 'v1.19.1' | ||
| hooks: | ||
| - id: mypy | ||
| name: Validate types with MyPy | ||
| entry: poetry run mypy | ||
| additional_dependencies: [ "no_implicit_optional" ] | ||
| args: [ "--config-file=pyproject.toml", "--install-types", "--non-interactive" ] | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: black | ||
| name: Format with Black | ||
| entry: uv run black | ||
| language: system | ||
| types: [python] |
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.
You can just specify
python-versionhere instead of installing it in the next step: https://github.com/astral-sh/setup-uv#python-version