Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: S. Co1 <sco1.git@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and sco1 authored Dec 2, 2024
1 parent 2312a14 commit eb3a412
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 149 deletions.
49 changes: 13 additions & 36 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,44 @@ jobs:
lint:
runs-on: ubuntu-latest

env:
UV_CACHE_DIR: /tmp/.uv-cache

steps:
- uses: actions/checkout@v4

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install dependencies
run: uv sync --all-extras --dev

- name: Run mypy
run: uv run mypy .
if: always()

- name: Minimize uv cache
run: uv cache prune --ci

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
fail-fast: false

env:
UV_CACHE_DIR: /tmp/.uv-cache

steps:
- uses: actions/checkout@v4

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up (release) Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -68,20 +58,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Set up (deadsnakes) Python ${{ matrix.python-version }}
uses: deadsnakes/action@v3.2.0
uses: deadsnakes/action@v3.1.0
if: endsWith(matrix.python-version, '-dev')
with:
python-version: ${{ matrix.python-version }}
tk: true

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}

- name: Install dependencies
run: |
Expand All @@ -99,9 +79,6 @@ jobs:
if-no-files-found: error
include-hidden-files: true

- name: Minimize uv cache
run: uv cache prune --ci

combine-cov:
runs-on: ubuntu-latest
needs: test
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,35 @@ jobs:
build:
name: Build dist & publish
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/zwolang
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.5.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Build package
run: uvx --from build pyproject-build --installer uv
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
uses: pypa/gh-action-pypi-publish@release/v1.10
with:
user: __token__
password: ${{ secrets.pypi_api_token }}
print-hash: true

- name: Upload wheel to release
env:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ repos:
- id: python-check-blanket-type-ignore
- id: python-use-type-annotations
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.1
hooks:
- id: ruff
Loading

0 comments on commit eb3a412

Please sign in to comment.