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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- run: uv sync --locked
- run: uv run ruff check
- run: uv run ruff format --check
- run: uv run ty check
- run: uv run pytest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ build/
*.egg-info/
.pytest_cache/
.ruff_cache/
.coverage
node_modules/
1 change: 1 addition & 0 deletions ZERO_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.10.0
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@ classifiers = [
]
dependencies = []

[dependency-groups]
dev = [
"hypothesis>=6.169",
"pytest>=9.1",
"pytest-asyncio>=1.4",
"pytest-cov>=7.1",
"ruff>=0.17",
"ty>=0.0.87",
]

[build-system]
requires = ["uv_build>=0.11,<0.12"]
build-backend = "uv_build"

[tool.ruff]
line-length = 120
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "ASYNC", "PT"]

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
addopts = "--cov=zero_python --cov-branch --cov-report=term-missing"

[tool.coverage.report]
fail_under = 100
skip_covered = true
exclude_also = ["if TYPE_CHECKING:", "@overload", "raise NotImplementedError", "\\.\\.\\."]
15 changes: 15 additions & 0 deletions tests/test_pin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent


def test_zero_version_is_one_semver() -> None:
version = (ROOT / "ZERO_VERSION").read_text().strip()
major, minor, patch = version.split(".")
assert all(part.isdigit() for part in (major, minor, patch))


def test_package_imports() -> None:
import zero_python

assert zero_python.__version__.count(".") == 2
Loading
Loading