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
32 changes: 22 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
# 3.10 is the oldest Python that still receives security fixes (3.9 reached end of life in October 2025).
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout code
Expand All @@ -36,10 +37,17 @@ jobs:
pip install -e ".[dev]"

- name: Run linting
run: python -m ruff check src/lettermint
run: |
python -m ruff check src tests scripts
python -m ruff format --check src tests scripts

- name: Run type checking
run: python -m mypy src/lettermint --strict
run: python -m mypy

- name: Check the generated code
run: |
python scripts/unasync.py --check
python scripts/generate.py --check

- name: Run tests
run: python -m pytest tests/ -v --tb=short
Expand All @@ -62,18 +70,22 @@ jobs:
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build twine

- name: Build package
run: python -m build

- name: Check build output
- name: Check the package
run: |
if [ ! -d "dist" ]; then
echo "Build output directory 'dist' not found"
exit 1
fi
ls -la dist/
python -m twine check --strict dist/*
python -m venv /tmp/smoke
/tmp/smoke/bin/pip install dist/*.whl
cd /tmp && /tmp/smoke/bin/python - <<'PY'
import importlib.resources, lettermint
assert (importlib.resources.files("lettermint") / "UPGRADE.md").is_file(), "UPGRADE.md is not in the wheel"
assert (importlib.resources.files("lettermint") / "py.typed").is_file()
print("lettermint", lettermint.__version__, repr(lettermint.Lettermint("lm_smoke")))
PY

- name: Upload build artifacts
uses: actions/upload-artifact@v7
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fix-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:

- name: Fix code style issues
run: |
python -m ruff check --fix src/lettermint || true
python -m ruff format src/lettermint || true
python -m ruff check --fix src tests scripts || true
python -m ruff format src tests scripts || true

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v7
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,28 @@ jobs:
pip install -e ".[dev]"
pip install build

- name: Update version in pyproject.toml
run: |
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.version }}\"/" pyproject.toml

- name: Update version in __init__.py
# pyproject.toml reads the version from src/lettermint/_version.py (hatch dynamic version).
- name: Set the version from the tag
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
sed -i "s/^__version__ = .*/__version__ = \"${{ steps.version.outputs.version }}\"/" src/lettermint/__init__.py
sed -i "s/^__version__ = .*/__version__ = \"${VERSION}\"/" src/lettermint/_version.py
grep -qx "__version__ = \"${VERSION}\"" src/lettermint/_version.py

- name: Run tests
run: python -m pytest tests/ -v

- name: Build package
run: python -m build

- name: Check the built version
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
ls dist/
normalized=$(python -c 'import sys; from packaging.version import Version; print(Version(sys.argv[1]))' "$VERSION")
test -f "dist/lettermint-${normalized}-py3-none-any.whl"
test -f "dist/lettermint-${normalized}.tar.gz"

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading
Loading