Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
run: |
make lint
make type-check
make type-coverage

# Different python versions are covered differently:
make unit
Expand Down
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ Main targets:
- `make format` — format and autofix code with `ruff`
- `make lint` — run all linting checks (`ruff` and `flake8`)
- `make type-check` — run `mypy` type checks
- `make type-coverage` — check public API type coverage with `pyrefly`
- `make unit` — run standard tests with `pytest`
- `make typesafety` — run type-safety tests (`pytest-mypy-plugins`)
- `make slots` — check `__slots__` correctness with `slotscheck`
- `make package` — check package dependencies with `pip check`
- `make test` — run all checks: lint, type-check, unit tests, slots, and package
- `make test` — run all checks: lint, type-check, type-coverage, unit tests, slots, and package


## Tests
Expand Down Expand Up @@ -158,6 +159,13 @@ make type-check

This step is mandatory during CI.

We also require the public API to be fully annotated.
We use `pyrefly` to check that its type coverage stays at 100%:

```bash
make type-coverage
```


## Submitting your code

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ type-check: ## Run type checking (mypy)
$(POETRY) run mypy --enable-error-code=unused-awaitable returns
$(POETRY) run mypy docs tests

.PHONY: type-coverage
type-coverage: ## Check public API type coverage (pyrefly)
$(POETRY) run pyrefly coverage check --public-only returns

.PHONY: unit
unit: ## Run unit tests with pytest
$(POETRY) run pytest returns docs/pages tests
Expand All @@ -43,4 +47,4 @@ package: ## Check package dependencies with pip
$(POETRY) run pip check

.PHONY: test
test: lint type-check unit slots package ## Run all checks (lint, type-check, unit, slots, package)
test: lint type-check type-coverage unit slots package ## Run all checks (lint, type-check, type-coverage, unit, slots, package)
24 changes: 23 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pytest-subtests = "^0.15"
pytest-shard = "^0.1"
pytest-codspeed = "^5.0"
covdefaults = "^2.3"
pyrefly = "^1.4"

[tool.poetry.group.docs]
optional = true
Expand Down
Loading