Skip to content
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Draft Release

on:
pull_request:
types: [closed]
branches:
- main
types:
- closed

jobs:
update:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Pull Request Labeler

on:
pull_request:
types: [opened, synchronize, reopened]
types:
- opened
- reopened
- synchronize

permissions:
contents: read
pull-requests: write

jobs:
labeler:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v6
19 changes: 11 additions & 8 deletions .github/workflows/pr-agent.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
name: PR Agent

on:
pull_request:
types: [opened, synchronize]
issue_comment:
types: [created]
types:
- created
pull_request:
types:
- opened
- synchronize

permissions:
contents: write
issues: write
pull-requests: write

jobs:
pr_agent_job:
runs-on: ubuntu-latest

if: ${{ github.event.sender.type != 'Bot' }}

permissions:
issues: write
pull-requests: write
contents: write

steps:
- name: PR Agent Action Step
uses: qodo-ai/pr-agent@v0.31
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: Publish App to GHCR

on:
push:
branches: [main]
tags:
- "v*"
branches:
- main
paths:
- ".github/workflows/publish-app.yml"
- ".python-version"
- "Dockerfile"
tags:
- "v*"

workflow_dispatch:

Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/publish-devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: Publish Devcontainer to GHCR

on:
push:
branches: [main]
tags:
- "v*"
branches:
- main
paths:
- ".devcontainer/Dockerfile"
- ".github/workflows/publish-devcontainer.yml"
- ".python-version"
tags:
- "v*"

workflow_dispatch:

Expand All @@ -34,9 +35,9 @@ jobs:
- name: Login to Container Registry
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Metadata
id: meta
Expand All @@ -50,14 +51,14 @@ jobs:
type=raw,value=latest,enable={{is_default_branch}}
labels: |
maintainer=a5chin <a5chin.origin+contact@gmail.com>
org.opencontainers.image.url=https://github.com/${{ github.repository }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.vendor=a5chin <a5chin.origin+contact@gmail.com>
org.opencontainers.image.title=python-uv
org.opencontainers.image.authors=a5chin <a5chin.origin+contact@gmail.com>
org.opencontainers.image.description=Dev Container for Python development with uv-based dependency management and environment configuration.
org.opencontainers.image.documentation=https://a5chin.github.io/python-uv/
org.opencontainers.image.authors=a5chin <a5chin.origin+contact@gmail.com>
org.opencontainers.image.licenses=MIT
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.title=python-uv
org.opencontainers.image.url=https://github.com/${{ github.repository }}
org.opencontainers.image.vendor=a5chin <a5chin.origin+contact@gmail.com>

- name: Build and Push Devcontainer Image
uses: docker/build-push-action@v6
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ name: Release

on:
pull_request:
types: [closed]
branches:
- main
types:
- closed

permissions:
contents: write
pull-requests: read

jobs:
publish:
if: github.event.pull_request.merged == true && contains(github.head_ref, 'release/')

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: read

steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Test

on:
push:
branches: [main]
pull_request:
paths:
- ".github/actions/setup-python-with-uv/action.yml"
- ".github/workflows/test.yml"
Expand All @@ -11,11 +10,13 @@ on:
- ".env**"
- ".python-version"
- "tests"
- "codecov.yaml"
- "pyproject.toml"
- "pytest.ini"
- "uv.lock"

pull_request:
push:
branches:
- main
paths:
- ".github/actions/setup-python-with-uv/action.yml"
- ".github/workflows/test.yml"
Expand All @@ -24,17 +25,18 @@ on:
- ".env**"
- ".python-version"
- "tests"
- "codecov.yaml"
- "pyproject.toml"
- "pytest.ini"
- "uv.lock"

permissions:
contents: read

jobs:
coverage:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -44,13 +46,19 @@ jobs:

- name: Run pytest
run: |
uv run nox -s test -- --cov_report xml
uv run nox -s test -- --cov_report xml --junitxml junit.xml

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
files: ./junit.xml,!./cache
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
flags: unittests
files: ./coverage.xml,!./cache
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ipython",
"isort",
"jaxtyping",
"junitxml",
"kevinrose",
"kwargs",
"levelname",
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uv run nox -s test
uv run pytest tests/tools/test__logger.py

# Run with JUnit XML output for CI
uv run nox -s test -- --cov_report=xml
uv run nox -s test -- --cov_report xml --junitxml junit.xml

# Run pytest directly (bypasses nox)
uv run pytest
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
[![ty](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)

[![Versions](https://img.shields.io/badge/python-3.11%20|%203.12%20|%203.13%20|%203.14%20-green.svg)](https://github.com/a5chin/python-uv)
![code coverage](https://raw.githubusercontent.com/a5chin/python-uv/coverage-badge/coverage.svg?raw=true)
[![codecov](https://codecov.io/github/a5chin/python-uv/graph/badge.svg?token=M9JIB8T6R4)](https://codecov.io/github/a5chin/python-uv)

[![Docker](https://github.com/a5chin/python-uv/actions/workflows/docker.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/docker.yml)
[![Format](https://github.com/a5chin/python-uv/actions/workflows/format.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/format.yml)
[![Lint](https://github.com/a5chin/python-uv/actions/workflows/lint.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/lint.yml)
[![codecov](https://codecov.io/github/a5chin/python-uv/graph/badge.svg?token=M9JIB8T6R4)](https://codecov.io/github/a5chin/python-uv)

</div>

Expand Down Expand Up @@ -164,7 +163,7 @@ uv run nox -s lint -- --ruff
uv run nox -s test

# Run tests with JUnit XML output (for CI)
uv run nox -s test -- --cov_report=xml
uv run nox -s test -- --cov_report xml --junitxml junit.xml
```

You can also run tools directly:
Expand Down
19 changes: 19 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
codecov:
require_ci_to_pass: yes

component_management:
default_rules:
statuses:
- type: project
target: auto
individual_components:
- component_id: config
name: config
paths:
- tools/config/**/*.py
- component_id: logger
name: logger
paths:
- tools/logger/**/*.py
- component_id: tracer
name: tracer
paths:
- tools/tracer/**/*.py

coverage:
precision: 2
round: down
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ uv run nox -s lint -- --ty # ty only
uv run nox -s test

# Run tests with JUnit XML output (for CI)
uv run nox -s test -- --cov_report=xml
uv run nox -s test -- --cov_report xml --junitxml junit.xml
```

### Why nox?
Expand Down
5 changes: 4 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CLIArgs(
"""CLIArgs is a class that extends BaseSettings to handle command line arguments."""

cov_report: str = ""
junitxml: str = ""
ruff: bool = False
sqlfluff: bool = False
ty: bool = False
Expand Down Expand Up @@ -96,14 +97,16 @@ def test(session: nox.Session) -> None:
session (nox.Session): The Nox session object.

Examples:
>>> uv run nox -s test
>>> uv run nox -s test -- --cov_report xml --junitxml junit.xml

"""
args = CLIArgs.parse(session.posargs)

command = ["uv", "run", "pytest", "--cov", "--cov-branch"]
if args.cov_report:
command.append(f"--cov-report={args.cov_report}")
if args.junitxml:
command.append(f"--junitxml={args.junitxml}")

session.run(*command)

Expand Down
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ readme = "README.md"
license = { file = "LICENSE" }

dependencies = [
"beartype>=0.22.6",
"google-cloud-logging>=3.12.1",
"jaxtyping>=0.3.3",
"pydantic>=2.12.0",
"pydantic-settings>=2.11.0",
"beartype>=0.22.9",
"google-cloud-logging>=3.13.0",
"jaxtyping>=0.3.6",
"pydantic>=2.12.5",
"pydantic-settings>=2.12.0",
]

[dependency-groups]
Expand All @@ -24,14 +24,14 @@ dev = [
"cookiecutter-data-science>=2.3.0",
"ipykernel>=7.1.0",
"jupyter>=1.1.1",
"mkdocs-material>=9.6.21",
"nox>=2025.5.1",
"pre-commit>=4.3.0",
"pytest>=8.4.2",
"mkdocs-material>=9.7.1",
"nox>=2025.11.12",
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"pytest-cov>=7.0.0",
"ruff>=0.14.0",
"sqlfluff>=3.5.0",
"ty>=0.0.9",
"ruff>=0.14.14",
"sqlfluff>=4.0.0",
"ty>=0.0.14",
]

[tool.hatch.build.targets.wheel]
Expand Down
Loading
Loading