Skip to content

Commit 2560031

Browse files
committed
feat(hawk-sdk-python): production hardening — ruff, mypy, version bump
- Added ruff linter config (E, F, W, I, N, UP, B, A, SIM, TCH, RUF rules) - Added mypy strict type checking config - Added Makefile with standard targets (test, lint, format, typecheck) - Bumped version to 0.2.0 - Added pytest strict markers and short traceback config
1 parent c76a472 commit 2560031

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.PHONY: all test lint format typecheck clean help
2+
3+
all: lint typecheck test
4+
5+
test: ## Run tests
6+
python -m pytest
7+
8+
test-coverage: ## Run tests with coverage
9+
python -m pytest --cov=src/hawk --cov-report=term-missing
10+
11+
lint: ## Run ruff linter
12+
ruff check .
13+
14+
format: ## Format code
15+
ruff format .
16+
ruff check --fix .
17+
18+
typecheck: ## Run mypy type checker
19+
mypy src/
20+
21+
clean: ## Clean artifacts
22+
rm -rf dist/ build/ *.egg-info .pytest_cache .mypy_cache .ruff_cache
23+
24+
help: ## Show this help
25+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

pyproject.toml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "hawk-sdk"
7-
version = "0.1.0"
7+
version = "0.2.0"
88
description = "Python SDK for the Hawk daemon API"
99
readme = "README.md"
1010
license = "MIT"
@@ -35,6 +35,8 @@ dev = [
3535
"pytest>=7.0",
3636
"pytest-asyncio>=0.21",
3737
"respx>=0.21",
38+
"ruff>=0.4.0",
39+
"mypy>=1.0",
3840
]
3941

4042
[tool.hatch.build.targets.wheel]
@@ -43,3 +45,21 @@ packages = ["src/hawk"]
4345
[tool.pytest.ini_options]
4446
asyncio_mode = "auto"
4547
testpaths = ["tests"]
48+
addopts = "--strict-markers --tb=short -q"
49+
50+
[tool.ruff]
51+
target-version = "py39"
52+
line-length = 100
53+
54+
[tool.ruff.lint]
55+
select = ["E", "F", "W", "I", "N", "UP", "B", "A", "SIM", "TCH", "RUF"]
56+
ignore = ["E501"]
57+
58+
[tool.ruff.lint.isort]
59+
known-first-party = ["hawk"]
60+
61+
[tool.mypy]
62+
python_version = "3.9"
63+
strict = true
64+
warn_return_any = true
65+
warn_unused_configs = true

0 commit comments

Comments
 (0)