Skip to content

Commit

Permalink
fix: ci (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
egorchakov authored Sep 24, 2024
1 parent 9a1e594 commit 9348cd1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,32 @@ 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
with:
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 9 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 7 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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]
Expand Down

0 comments on commit 9348cd1

Please sign in to comment.