From 9a26c115a44f37c47fb0c9301f6879dbf3ebf3bc Mon Sep 17 00:00:00 2001 From: Evgenii Gorchakov Date: Tue, 24 Sep 2024 12:05:44 +0200 Subject: [PATCH] fix: ci --- .github/workflows/ci.yaml | 27 +++++++++++++++------------ .pre-commit-config.yaml | 2 +- justfile | 14 +++++++++----- pyproject.toml | 15 +++++++-------- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f99ec58..a1d0a69 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,21 +30,26 @@ jobs: with: python-version-file: "pyproject.toml" - - name: install uv + - name: setup just + uses: extractions/setup-just@v2 + + - name: setup ytt + uses: carvel-dev/setup-action@v2 + with: + only: ytt + + - name: setup uv uses: astral-sh/setup-uv@v3 with: version: "latest" enable-cache: true cache-dependency-glob: "**/pyproject.toml" - - name: uv sync - run: uv sync --all-extras --dev - - - name: run build hooks - run: uvx --from hatch hatch build --clean --hooks-only --target sdist + - name: sync + run: just sync - - name: install pre-commit - run: uv tool install --upgrade pre-commit + - name: install tools + run: just install-tools - name: restore pre-commit cache uses: actions/cache@v4 @@ -52,7 +57,5 @@ jobs: path: ~/.cache/pre-commit key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - - name: run pre-commit - run: uvx pre-commit run --all-files --color=always - env: - SKIP: just-format,generate-example-config + - name: pre-commit + run: just pre-commit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b2221ee..b227e2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,6 +49,6 @@ repos: name: generate-example-config language: system stages: [commit] - entry: ytt --ignore-unknown-comments --file examples/config_templates --output-files examples/config --output yaml --strict + entry: just generate-example-config pass_filenames: false always_run: true diff --git a/justfile b/justfile index 2efdc64..b1022ed 100644 --- a/justfile +++ b/justfile @@ -4,22 +4,26 @@ export HATCH_BUILD_CLEAN := "1" _default: @just --list --unsorted -setup: - git submodule update --init --recursive --remote - uv sync --all-extras +sync: + uv sync --all-extras --dev + +install-tools: for tool in basedpyright ruff pre-commit; do uv tool install --force --upgrade $tool; done + +setup: sync install-tools + git submodule update --init --recursive --remote uvx pre-commit install --install-hooks clean: uvx --from hatch hatch clean build: - uvx --from build pyproject-build --installer uv + uv build build-protos: uvx --from hatch hatch build --clean --hooks-only --target sdist -pre-commit *ARGS: +pre-commit *ARGS: build-protos uvx pre-commit run --all-files --color=always {{ ARGS }} generate-example-config: diff --git a/pyproject.toml b/pyproject.toml index 622e498..6a80ff5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "tqdm>=4.66.5", ] readme = "README.md" -requires-python = ">=3.12" +requires-python = ">=3.12,<3.13" license = { text = "Apache-2.0" } classifiers = [ "Development Status :: 3 - Alpha", @@ -34,12 +34,7 @@ classifiers = [ ] [project.optional-dependencies] -build = [ - "hatchling>=1.25.0", - "grpcio-tools", - "protoletariat==3.2.19", - "protobuf", -] +build = ["hatchling>=1.25.0", "grpcio-tools>=1.62.0", "protoletariat==3.2.19"] visualize = ["rerun-sdk>=0.18.2"] mcap = [ "mcap>=1.1.1", @@ -58,7 +53,11 @@ rbyte-read-frames = 'rbyte.scripts.read_frames:main' rbyte-visualize = 'rbyte.scripts.visualize:main' [build-system] -requires = ["hatchling>=1.25.0"] +requires = [ + "hatchling>=1.25.0", + "grpcio-tools>=1.62.0", + "protoletariat==3.2.19", +] build-backend = "hatchling.build" [tool.uv]