Switch to basedpyright
Some checks failed
CI / validation (push) Has been cancelled
CI / unit-tests (push) Has been cancelled
CI / Produce Pull Request payload artifact (push) Has been cancelled

This commit is contained in:
ItsDrike 2024-07-10 17:30:22 +02:00
parent 06cbefb631
commit 824d6273a6
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 44 additions and 27 deletions

View file

@ -34,7 +34,7 @@ jobs:
restore-keys: "precommit-${{ runner.os }}-${{ steps.poetry_setup.outputs-python-version}}-" restore-keys: "precommit-${{ runner.os }}-${{ steps.poetry_setup.outputs-python-version}}-"
- name: Run pre-commit hooks - name: Run pre-commit hooks
run: SKIP=ruff-linter,ruff-formatter,slotscheck,pyright pre-commit run --all-files run: SKIP=ruff-linter,ruff-formatter,slotscheck,basedpyright pre-commit run --all-files
- name: Run ruff linter - name: Run ruff linter
run: ruff check --output-format=github --show-fixes --exit-non-zero-on-fix . run: ruff check --output-format=github --show-fixes --exit-non-zero-on-fix .
@ -45,5 +45,5 @@ jobs:
- name: Run slotscheck - name: Run slotscheck
run: slotscheck -m mcproto run: slotscheck -m mcproto
- name: Run pyright type checker - name: Run basedpyright type checker
run: pyright . run: basedpyright .

View file

@ -35,10 +35,10 @@ repos:
- repo: local - repo: local
hooks: hooks:
- id: pyright - id: basedpyright
name: Pyright name: BasedPyright
description: Run pyright type checker description: Run BasedPyright type checker
entry: poetry run pyright entry: poetry run basedpyright
language: system language: system
types: [python] types: [python]
pass_filenames: false # pyright runs for the entire project, it can't run for single files pass_filenames: false # pyright runs for the entire project, it can't run for single files

50
poetry.lock generated
View file

@ -20,6 +20,20 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin
test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"]
trio = ["trio (>=0.23)"] trio = ["trio (>=0.23)"]
[[package]]
name = "basedpyright"
version = "1.13.3"
description = "static type checking for Python (but based)"
optional = false
python-versions = ">=3.8"
files = [
{file = "basedpyright-1.13.3-py3-none-any.whl", hash = "sha256:3162c5a5f4fc99f9d53d76cbd8e24d31ad4b28b4fb26a58ab8be6e8b634c99a7"},
{file = "basedpyright-1.13.3.tar.gz", hash = "sha256:728d7098250db8d18bc4b48df8f93dfd9c79d155c3c99d41256a6caa6a21232e"},
]
[package.dependencies]
nodejs-wheel-binaries = ">=20.13.1"
[[package]] [[package]]
name = "certifi" name = "certifi"
version = "2024.6.2" version = "2024.6.2"
@ -247,6 +261,22 @@ files = [
{file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"},
] ]
[[package]]
name = "nodejs-wheel-binaries"
version = "20.15.1"
description = "unoffical Node.js package"
optional = false
python-versions = ">=3.7"
files = [
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-macosx_10_15_x86_64.whl", hash = "sha256:a04537555f59e53021f8a2b07fa7aaac29d7793b7fae7fbf561bf9a859f4c67a"},
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:b5ff04efa56a3fcd1fd09b30f5236c12bd84c10fcb222f3c0e04e1d497342b70"},
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c3e172e3fde3c13e7509312c81700736304dbd250745d87f00e7506065f3a5"},
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9740f7456a43cb09521a1ac93a4355dc8282c41420f2d61ff631a01f39e2aa18"},
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:bf5e239676efabb2fbaeff2f36d0bad8e2379f260ef44e13ef2151d037e40af3"},
{file = "nodejs_wheel_binaries-20.15.1-py2.py3-none-win_amd64.whl", hash = "sha256:624936171b1aa2e1cc6d1718b1caa089e943b54df16568fa2f4576d145ac279a"},
{file = "nodejs_wheel_binaries-20.15.1.tar.gz", hash = "sha256:b2f25b4f0e9a827ae1af8218ab13a385e279c236faf7b7c821e969bb8f6b25e8"},
]
[[package]] [[package]]
name = "packaging" name = "packaging"
version = "24.1" version = "24.1"
@ -336,24 +366,6 @@ nodeenv = ">=0.11.1"
pyyaml = ">=5.1" pyyaml = ">=5.1"
virtualenv = ">=20.10.0" virtualenv = ">=20.10.0"
[[package]]
name = "pyright"
version = "1.1.369"
description = "Command line wrapper for pyright"
optional = false
python-versions = ">=3.7"
files = [
{file = "pyright-1.1.369-py3-none-any.whl", hash = "sha256:06d5167a8d7be62523ced0265c5d2f1e022e110caf57a25d92f50fb2d07bcda0"},
{file = "pyright-1.1.369.tar.gz", hash = "sha256:ad290710072d021e213b98cc7a2f90ae3a48609ef5b978f749346d1a47eb9af8"},
]
[package.dependencies]
nodeenv = ">=1.6.0"
[package.extras]
all = ["twine (>=3.4.1)"]
dev = ["twine (>=3.4.1)"]
[[package]] [[package]]
name = "pytest" name = "pytest"
version = "8.2.2" version = "8.2.2"
@ -570,4 +582,4 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.11" python-versions = "^3.11"
content-hash = "334a7105baa770bfd69d0391602995e317ccc0faa3d34539acbf7e9aa5355fee" content-hash = "0201fdc3d3cb37b96f743109c61ab1a08e353bbe168de410418208199ae1a345"

View file

@ -17,7 +17,7 @@ poethepoet = "^0.25.0"
[tool.poetry.group.lint.dependencies] [tool.poetry.group.lint.dependencies]
ruff = "^0.3.2" ruff = "^0.3.2"
pre-commit = "^3.6.2" pre-commit = "^3.6.2"
pyright = "^1.1.359" basedpyright = "^1.13.3"
[tool.poetry.group.test.dependencies] [tool.poetry.group.test.dependencies]
pytest = "^8.1.1" pytest = "^8.1.1"
@ -133,6 +133,7 @@ line-ending = "lf"
[tool.pyright] [tool.pyright]
pythonVersion = "3.11" pythonVersion = "3.11"
typeCheckingMode = "standard"
reportUntypedFunctionDecorator = "error" reportUntypedFunctionDecorator = "error"
reportUntypedClassDecorator = "error" reportUntypedClassDecorator = "error"
@ -202,6 +203,10 @@ help = "Run ruff formatter"
cmd = "pytest -v --failed-first" cmd = "pytest -v --failed-first"
help = "Run pytest tests" help = "Run pytest tests"
[tool.poe.tasks.pyright]
cmd = "basedpyright ."
help = "Run BasedPyright type-checker"
[tool.poe.tasks.retest] [tool.poe.tasks.retest]
cmd = "pytest -v --last-failed" cmd = "pytest -v --last-failed"
help = "Run previously failed tests using pytest" help = "Run previously failed tests using pytest"