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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.14']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
fail-fast: false

steps:
Expand All @@ -30,7 +30,7 @@ jobs:
enable-cache: true

- name: Install dependencies
run: uv sync
run: uv sync --extra dev

- name: Run tests
run: PYTHONPATH=. uv run pytest tests/
Expand Down
73 changes: 67 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,74 @@
# Bit compiled files
*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.so

tags
dist
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
/build

# emacs backup files
# Virtual environments
.venv/
venv/
ENV/
env/

# IDE / Editor files
.vscode/
.idea/
*.swp
*.swo
*~
tags
.DS_Store

# Testing
.pytest_cache/
.coverage
.coverage.*
htmlcov/
.tox/
.nox/
coverage.xml
*.cover
.hypothesis/

# Type checking
.mypy_cache/
.pytype/
.pyre/
.pyright/

# Linting
.ruff_cache/

# Documentation builds
doc/build/
docs/_build/
docs/_static/
docs/_templates/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# Ignore test export folders
tests/export_test/test_export*
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Pre-commit hooks for kmos
# Install: uv run pre-commit install
# Run manually: uv run pre-commit run --all-files
# Update hooks: uv run pre-commit autoupdate

repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^tests/
- id: end-of-file-fixer
exclude: ^tests/
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- id: mixed-line-ending

# Ruff - Fast Python linter and formatter (replaces black, isort, flake8, etc.)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Formatter
- id: ruff-format
58 changes: 0 additions & 58 deletions .travis.yml

This file was deleted.

115 changes: 0 additions & 115 deletions INSTALL.rst

This file was deleted.

62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.PHONY: help install install-dev test test-verbose test-coverage clean lint format type-check docs docs-serve build all pre-commit

help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'

install: ## Install the package in development mode
uv sync

install-dev: ## Install package with all development dependencies
uv sync --all-extras

test: ## Run tests
PYTHONPATH=. uv run pytest tests/

test-verbose: ## Run tests with verbose output
PYTHONPATH=. uv run pytest tests/ -v

test-coverage: ## Run tests with coverage report
PYTHONPATH=. uv run pytest tests/ --cov=kmos --cov-report=html --cov-report=term

clean: ## Clean build artifacts and caches
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name '*.pyc' -delete
find . -type f -name '*.pyo' -delete
find . -type f -name '*~' -delete

lint: ## Lint code with ruff
uv run ruff check kmos/ tests/

format: ## Format code with ruff
uv run ruff format kmos/ tests/

format-check: ## Check code formatting without modifying files
uv run ruff format --check kmos/ tests/

type-check: ## Run type checking with mypy
uv run mypy kmos/

docs: ## Build documentation
cd doc && uv run make html

docs-serve: ## Build and serve documentation locally
cd doc && uv run make html && python -m http.server 8000 --directory build/html

build: ## Build distribution packages
uv build

all: clean install-dev lint format type-check test ## Run full CI pipeline locally

pre-commit: ## Run pre-commit checks on all files
uv run pre-commit run --all-files
Loading
Loading