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
3 changes: 3 additions & 0 deletions changelog.d/20260930_170131_kurtmckee_pyrefly.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Development
-----------
* Use Pyrefly to test type annotations.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ strict = true
sqlite_cache = true


# pyrefly
# -------

[tool.pyrefly]
project-includes = ["src/"]
preset = "strict"


# pytest
# ------

Expand Down
9 changes: 9 additions & 0 deletions requirements/pyrefly/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.poetry]
package-mode = false

[project]
name = "dependencies"
requires-python = ">=3.10"
dependencies = [
"pyrefly",
]
1 change: 1 addition & 0 deletions requirements/pyrefly/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyrefly==1.3.2 ; python_version >= "3.10"
2 changes: 1 addition & 1 deletion src/chipshot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load(path: str | pathlib.Path | None = None) -> dict[str, t.Any]:
if isinstance(path, str):
path = pathlib.Path(path)

custom_config = {}
custom_config: dict[str, t.Any] = {}
if path is not None:
log.debug(f"Loading config file '{path}'")
custom_config = _load_toml(path)
Expand Down
11 changes: 10 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ envlist =
coverage-report
build{, -minimum}
mypy-py{3.14, 3.13, 3.12, 3.11, 3.10}
pyrefly
docs
labels =
update=update-{requirements, pre_commit, headers}
Expand Down Expand Up @@ -70,12 +71,18 @@ commands =
twine check --strict {envdir}/dist/*

[testenv:mypy-py{3.14, 3.13, 3.12, 3.11, 3.10}]
description = Test type annotations on Python {py_dot_ver}
description = Test type annotations using mypy on Python {py_dot_ver}
deps = -r requirements/mypy/requirements.txt
setenv =
MYPY_FORCE_COLOR=1
commands = mypy {posargs}

[testenv:pyrefly]
description = Test type annotations using Pyrefly
deps = -r requirements/pyrefly/requirements.txt
commands =
pyrefly check --preset strict

[testenv:docs]
description = Test building the documentation
base_python = py3.13
Expand Down Expand Up @@ -119,6 +126,8 @@ commands =
poetry export --directory="requirements/docs" --output="requirements.txt" --without-hashes
poetry update --directory="requirements/mypy" --lock
poetry export --directory="requirements/mypy" --output="requirements.txt" --without-hashes
poetry update --directory="requirements/pyrefly" --lock
poetry export --directory="requirements/pyrefly" --output="requirements.txt" --without-hashes
poetry update --directory="requirements/test" --lock
poetry export --directory="requirements/test" --output="requirements.txt" --without-hashes
poetry export --directory="requirements/test" --output="requirements-coverage.txt" --without-hashes --only="coverage"
Expand Down
Loading