Skip to content
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
20 changes: 20 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Setup"
description: "Setup tools for run"

runs:
using: "composite"
steps:

- name: Install UV
uses: astral-sh/setup-uv@v5
id: setup-uv
with:
enable-cache: false
prune-cache: true
version: '0.5.21'
cache-dependency-glob: '**/uv.lock'

- name: Install dependencies
shell: bash
run: |
uv sync --frozen
44 changes: 44 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: pre-commit

on:
pull_request:
branches:
- "main"

jobs:
pre-commit:
# changing the following value will significantly affect github's billing. Be careful and consult with the team before changing it.
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup backend
id: setup
uses: ./.github/actions/setup

- name: Setup-pre-commit
run: uv tool install pre-commit --with pre-commit-uv --force-reinstall

- uses: actions/cache@v4
with:
path: |
~/.cache/pre-commit
~/.cache/uv
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('\.pre-commit-config.yaml') }}

- name: Run pre-commit
run: uv run --frozen pre-commit run --show-diff-on-failure --color=always --all-files --source ${{ github.event.pull_request.base.sha }} --origin ${{ github.event.pull_request.head.sha }} --show-diff-on-failure --color=always
shell: bash

- uses: stefanzweifel/git-auto-commit-action@v5
# Always commit changes even if pre-commit failed
if: always()
with:
commit_message: "Automated pre-commit update"
20 changes: 1 addition & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,8 @@ repos:
- id: codespell
additional_dependencies:
- tomli
files: "docs/.*/.*.mdx"
files: ".*"

- repo: https://github.com/fpgmaas/deptry.git
rev: "0.23.0"
hooks:
- id: deptry
pass_filenames: false
always_run: true
entry: bash -c "uv run --frozen --all-extras --dev deptry src --ignore DEP001"
- repo: "local"
hooks:
- id: disallowed-words-check
name: Check for disallowed words
entry: scripts/disallowed-words-check.sh
language: script
files: '' # Check all files
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.120.4
hooks:
- id: renovate-config-validator
- repo: https://github.com/astral-sh/uv-pre-commit
rev: "0.5.24"
hooks:
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.0"
readme = "README.md"
requires-python = ">=3.12, <3.14"
dependencies = [
"codegen==0.5.3"
"codegen==0.5.3",
]
license = {file = "LICENSE"}
classifiers = [
Expand All @@ -28,10 +28,14 @@ dev-dependencies = [
"pre-commit>=4.0.1",
"pre-commit-uv>=4.1.4",
"uv>=0.4.25",
"jupyterlab==4.3.4",
"deptry>=0.22.0",
]

[tool.pre-commit-uv]
cache-keys = [{ git = { commit = true, tags = true } }]
requirements = [
"strict-requirements",
]

[tool.deptry]
package_module_name_map.codegen = "codegen"
Loading
Loading