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
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Summary

<!-- What does this PR do and why? Link the related issue: "Closes #<issue-number>" -->

## Changes

<!-- Brief bullet list of what changed and where. -->

-

## Test plan

<!-- How did you verify this works? Run the checks below and tick each one. -->

- [ ] `uv run pytest` passes
- [ ] Manual test (describe what you tried):
34 changes: 34 additions & 0 deletions .github/release_drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
semver-increment: minor
when:
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
when:
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧰 Maintenance"
when:
label: "chore"
- type: "pre-exclude"
when:
label: "skip-changelog"
- type: "version-resolver"
semver-increment: "major"
when:
label: "major"
- type: "version-resolver"
semver-increment: "patch"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
tag-prefix: "v"
template: |
## Changes

$CHANGES
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Publish release to PyPI"

on:
push:
tags:
# Publish on any tag starting with a `v`, e.g., v0.1.0
- v*

jobs:
run:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Install Python 3.13
run: uv python install 3.13
- name: Build
run: uv build
# Check that basic features work and we didn't miss to include crucial files
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
- name: Publish
run: uv publish
17 changes: 17 additions & 0 deletions .github/workflows/release_drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
workflow_dispatch:

# Permissions for default token (secrets.GITHUB_TOKEN)
permissions:
contents: write
pull-requests: read

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v7
with:
config-name: release-drafter.yml # the default, loads '.github/release-drafter.yml'
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ cython_debug/
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/
# Temporary file for partial code execution
Expand Down
133 changes: 133 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# .pre-commit-config.yaml
#
# Setup:
# pip install pre-commit # or: uv tool install pre-commit
# pre-commit install # installs the git hook
# pre-commit install --hook-type commit-msg # only if you enable commitizen below
# pre-commit run --all-files # run once across the whole repo
#
# Maintenance:
# pre-commit autoupdate # bump all `rev:` pins to latest
#
# Docs: https://pre-commit.com | Hook index: https://pre-commit.com/hooks.html

minimum_pre_commit_version: "3.5.0"

default_language_version:
python: python3.11

# Keep commits fast: only run on the commit stage by default.
default_stages: [pre-commit]

# Don't run hooks on generated / vendored / data paths.
exclude: |
(?x)^(
\.git/.*|
\.venv/.*|
build/.*|
dist/.*|
docs/_build/.*|
.*\.egg-info/.*|
data/.*|
datasets/.*|
.*\.ipynb_checkpoints/.*
)$

# Configure pre-commit.ci to autofix pre-commit errors in PRs
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false

repos:
# ---------------------------------------------------------------------------
# Core hygiene: cheap, fast, catch-everything checks.
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: debug-statements # blocks stray breakpoint()/pdb
- id: detect-private-key # blocks committed private keys
- id: check-added-large-files
args: [--maxkb=1024]

# ---------------------------------------------------------------------------
# Ruff: linter + formatter (replaces flake8, isort, black, pyupgrade, etc.).
# Lint (with --fix) MUST run before the formatter.
# ---------------------------------------------------------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.17
hooks:
- id: ruff-check
args: [--fix]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]

# ---------------------------------------------------------------------------
# Static type checking (run on the package source only, to stay fast).
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.1.0
hooks:
- id: mypy
files: ^src/
args: [--ignore-missing-imports, --install-types, --non-interactive]

# ---------------------------------------------------------------------------
# Spelling: catches typos in code, docstrings, and docs.
# ---------------------------------------------------------------------------
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies: [tomli]
# Configure ignores in pyproject.toml under [tool.codespell].

# ---------------------------------------------------------------------------
# Notebooks: strip outputs before commit (clean diffs, no data leakage).
# Essential for ML repos that carry .ipynb files.
# ---------------------------------------------------------------------------
- repo: https://github.com/kynan/nbstripout
rev: 0.9.1
hooks:
- id: nbstripout

# ---------------------------------------------------------------------------
# Secret scanning (baseline-driven). Generate the baseline once with:
# detect-secrets scan > .secrets.baseline
# ---------------------------------------------------------------------------
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: [--baseline, .secrets.baseline]


# ---------------------------------------------------------------------------
# uv lock file update to make sure it is properly synced even if the
# dependencies have been updated.
# ---------------------------------------------------------------------------
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.11.21
hooks:
- id: uv-lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
127 changes: 127 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "GitLabTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "IPPublicDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "OpenAIDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "PypiTokenDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TelegramBotTokenDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2026-06-17T12:55:45Z"
}
Loading