Skip to content
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

fix: ci #8

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading