Skip to content

Commit 2a02bf4

Browse files
authored
Replace previous tooling by ruff and pyright (#571)
* Replace all previous tooling * Add missing dependencies * Do not run Test release automatically
1 parent 8a4f2be commit 2a02bf4

File tree

8 files changed

+446
-99
lines changed

8 files changed

+446
-99
lines changed

.flake8

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/test-pypi-release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Test release on PyPI
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
85

96
jobs:
107
test_pypi_release:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ __pycache__
55
.mypy_cache
66
env/
77
venv/
8+
.venv/
89
dist/
910
build/
1011
dev.py

.pre-commit-config.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

pyproject.toml

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,13 @@ recoverpy = "recoverpy.__init__:main"
8383

8484
[dependency-groups]
8585
dev = [
86-
"pytest-asyncio<0.25.0,>=0.20.3",
87-
"ruff<0.8.6,>=0.5.1",
88-
"coverage<8.0.0,>=7.6.1",
89-
"pytest<9.0.0,>=8.3.4",
90-
"pylint<4.0.0,>=3.2.7",
91-
"isort<6.0.0,>=5.13.2",
92-
"black<25.0,>=24.8",
93-
"flake8<8.0.0,>=7.1.1",
94-
"pre-commit<4.0.0,>=3.5.0",
95-
"flake8-bandit<5.0.0,>=4.1.1",
96-
"flake8-bugbear<25.0.0,>=24.12.12",
97-
"flake8-builtins<3.0.0,>=2.5.0",
98-
"flake8-comprehensions<4.0.0,>=3.15.0",
99-
"darglint<2.0.0,>=1.8.1",
100-
"flake8-docstrings<2.0.0,>=1.7.0",
101-
"flake8-isort<7.0.0,>=6.1.1",
102-
"flake8-pytest-style<3.0.0,>=2.0.0",
103-
"flake8-mutable<2.0.0,>=1.2.0",
104-
"flake8-html<1.0.0,>=0.4.1",
105-
"flake8-simplify<1.0.0,>=0.21.0",
106-
"flake8-aaa<1.0.0,>=0.17.0",
107-
"pytest-mock==3.14.0",
108-
"pytest-cov<6.0.0,>=5.0.0",
109-
"coverage-badge<2.0.0,>=1.1.2",
110-
"mypy<2.0,>=1.14",
111-
"types-PyYAML<7.0.0,>=6.0.12",
86+
"isort>=5.13.2",
87+
"pyright>=1.1.392.post0",
88+
"pytest-asyncio>=0.24.0",
89+
"pytest>=8.3.4",
90+
"ruff>=0.9.3",
91+
"pytest-mock>=3.14.0",
92+
"pytest-cov>=5.0.0",
11293
]
11394

11495
[build-system]
@@ -121,12 +102,14 @@ url = "https://test.pypi.org/simple/"
121102
publish-url = "https://test.pypi.org/legacy/"
122103
explicit = true
123104

124-
[tool.mypy]
125-
python_version = 3.8
126-
ignore_missing_imports = "true"
127-
disallow_untyped_calls = "false"
105+
[tool.pyright]
106+
include = ["recoverpy"]
107+
exclude = ["recoverpy/ui/widgets/directory_tree.py"]
108+
typeCheckingMode = "strict"
109+
reportUnknownArgumentType = "none"
110+
reportUnknownMemberType = "none"
128111

129112
[tool.pytest.ini_options]
130113
markers = [
131114
"incremental",
132-
]
115+
]

recoverpy/ui/screens/modal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def on_button_pressed(self) -> None:
3838

3939

4040
async def install_and_push_modal(
41-
app: App[None], name: str, message: str, callback: Optional[Callable] = None # type: ignore
41+
app: App[None],
42+
name: str,
43+
message: str,
44+
callback: Optional[Callable[[], None]] = None,
4245
) -> None:
4346
modal = Modal(name, message=message, callback=callback)
4447
app.install_screen(modal, name)

tests/integration/helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ async def assert_with_timeout(check_func, expected, actual, timeout=10.0, interv
3636
return
3737
if asyncio.get_event_loop().time() > end_time:
3838
func_src = inspect.getsource(check_func).strip()
39-
assert (
40-
False
41-
), f"Timeout reached before condition in `{func_src}` became true. Expected: {expected}, Actual: {actual}"
39+
assert False, (
40+
f"Timeout reached before condition in `{func_src}` became true. Expected: {expected}, Actual: {actual}"
41+
)
4242
await asyncio.sleep(interval)
4343

4444

uv.lock

Lines changed: 424 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)