Skip to content

Commit 884ddea

Browse files
committed
Initial commit
1 parent 830f211 commit 884ddea

24 files changed

+4129
-3
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [main]
9+
schedule:
10+
- cron: "0 6 * * 4"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
analyze:
17+
permissions:
18+
actions: read # for github/codeql-action/init to get workflow details
19+
contents: read # for actions/checkout to fetch code
20+
security-events: write # for github/codeql-action/autobuild to send a status report
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
# Override automatic language detection by changing the below list
28+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
29+
language: ["python"]
30+
# Learn more...
31+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v5
36+
with:
37+
# We must fetch at least the immediate parents so that if this is
38+
# a pull request then we can checkout the head.
39+
fetch-depth: 2
40+
41+
# If this run was triggered by a pull request event, then checkout
42+
# the head of the pull request instead of the merge commit.
43+
- run: git checkout HEAD^2
44+
if: ${{ github.event_name == 'pull_request' }}
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v3
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v3
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 https://git.io/JvXDl
63+
64+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
65+
# and modify them (or add more) to build your code if your project
66+
# uses a compiled language
67+
68+
#- run: |
69+
# make bootstrap
70+
# make release
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v3

.github/workflows/quality.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: Quality
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
quality:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
21+
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
26+
- name: Install uv and set the python version
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
python-version: "3.13"
30+
- name: Install the project
31+
run: uv sync --group quality
32+
- name: Run pre-commit
33+
run: uv run pre-commit run -a --show-diff-on-failure

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: Tests
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
tests:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
16+
fail-fast: false
17+
18+
runs-on: ${{ matrix.os }}
19+
defaults:
20+
run:
21+
shell: bash
22+
steps:
23+
- name: Check out
24+
uses: actions/checkout@v5
25+
with:
26+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v6
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
allow-prereleases: true
35+
- name: Install the project
36+
run: uv sync --all-extras --dev
37+
38+
- name: Run tests
39+
run: uv run python -Xutf8 -m pytest --cov --cov-config=pyproject.toml --cov-report=xml tests

.github/workflows/typecheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# For documentation on GitHub Actions Workflows, see:
2+
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
name: TypeCheck
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
type-check:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
19+
fail-fast: false
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Check out
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0 # Needed for setuptools_scm to work correctly
28+
29+
- name: Install uv and set the python version
30+
uses: astral-sh/setup-uv@v6
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Check typing
35+
run: uv run mypy .

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ipython_config.py
9898
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101-
#uv.lock
101+
uv.lock
102102

103103
# poetry
104104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

@@ -205,3 +205,10 @@ cython_debug/
205205
marimo/_static/
206206
marimo/_lsp/
207207
__marimo__/
208+
209+
# Node stuff for prettier formatting
210+
node_modules/
211+
package-lock.json
212+
213+
# macOS
214+
.DS_Store

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v6.0.0"
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-toml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: "v0.13.1"
13+
hooks:
14+
- id: ruff-format
15+
args: [--config=ruff.toml]
16+
- id: ruff-check
17+
args: [--config=ruff.toml, --fix, --exit-non-zero-on-fix]
18+
19+
- repo: https://github.com/pre-commit/mirrors-prettier
20+
rev: "v3.1.0"
21+
hooks:
22+
- id: prettier
23+
additional_dependencies:
24+
- prettier@3.6.2
25+
- prettier-plugin-toml@2.0.6

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add any files or directories which should be exempted from prettier formatting

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"printWidth": 100,
3+
"proseWrap": "always",
4+
"overrides": [
5+
{
6+
"files": "*.md",
7+
"options": {
8+
"tabWidth": 4
9+
}
10+
}
11+
]
12+
}

GEMINI.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Instructions for Gemini CLI in a `uv` Python project
2+
3+
This `GEMINI.md` file provides context and instructions for the Gemini CLI when working with this
4+
Python project, which utilizes `uv` for environment and package management.
5+
6+
## General Instructions
7+
8+
- **Environment Management:** Prefer using `uv` for all Python environment management tasks.
9+
- **Package Installation:** Always use `uv` to install packages and ensure they are installed within
10+
the project's virtual environment.
11+
- **Running Scripts/Commands:**
12+
- To run Python scripts within the project's virtual environment, use `uv run ...`.
13+
- To run programs directly from a PyPI package (installing it on the fly if necessary), use
14+
`uvx ...` (shortcut for `uv tool run`).
15+
- **New Dependencies:** If a new dependency is required, please state the reason for its inclusion.
16+
17+
## Python Code Standards
18+
19+
To ensure Python code adheres to required standards, the following commands **must** be run before
20+
creating or modifying any `.py` files:
21+
22+
```bash
23+
make check
24+
```
25+
26+
To run unit tests use the following command:
27+
28+
```bash
29+
make test
30+
```
31+
32+
Both of the above commands should be run prior to committing code.

0 commit comments

Comments
 (0)