Skip to content

Commit 341d40b

Browse files
committed
pyrefly
1 parent d239268 commit 341d40b

11 files changed

Lines changed: 32 additions & 69 deletions

.mypy.ini

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

.pre-commit-config.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,14 @@ repos:
5555
args: [
5656
--line-length=100
5757
]
58-
- repo: local
58+
- repo: https://github.com/facebook/pyrefly-pre-commit
59+
rev: 0.45.1
5960
hooks:
60-
- id: mypy
61-
name: mypy
62-
entry: mypy
61+
- id: pyrefly-check
62+
name: pyrefly check
63+
pass_filenames: false
6364
args: [
64-
"--install-types",
65-
"--non-interactive",
66-
"--ignore-missing-imports",
67-
"--namespace-packages",
68-
"--explicit-package-bases"
65+
"--ignore=missing-import",
66+
"--ignore=missing-source-for-stubs",
67+
"--project-excludes=tests"
6968
]
70-
files: \.py$
71-
exclude: ^tests/
72-
language: python

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## Build, Test, and Development Commands
1111
- `./activate.sh`: Create/activate local venv (Python 3.12) and install dev deps.
1212
- `make help`: List available Make targets.
13-
- `make check`: Run static checks (pre-commit/ruff/mypy via `sniff_check.py`).
13+
- `make check`: Run static checks (pre-commit/ruff/pyrefly via `sniff_check.py`).
1414
- `python -m pytest -vv --cov=src tests/`: Run tests with coverage (CI mirrors this).
1515
- `make docs` or `scripts/build-docs.sh`: Generate docs to `site/` and `docs/docstrings/`.
1616
- Docker (Linux): `docker run --net host -v $PWD/../amazon-dash-private:/amazon-dash-private:ro andgineer/amazon-dash-button-hack`.
@@ -19,7 +19,7 @@
1919
## Coding Style & Naming Conventions
2020
- Python ≥ 3.10 (CI targets 3.10–3.12).
2121
- Linting/formatting: `ruff` (line length ~100, double-quoted docstrings), run via pre-commit.
22-
- Types: `mypy` (ignore_missing_imports; prefer precise annotations in `src/`).
22+
- Types: `pyrefly` (prefer precise annotations in `src/`).
2323
- Naming: modules and functions `snake_case`, classes `PascalCase`, constants `UPPER_SNAKE_CASE`.
2424

2525
## Testing Guidelines

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ source ./activate.sh && make check
3131
source ./activate.sh && pre-commit run --all-files
3232
```
3333

34-
**IMPORTANT**: Always use `pre-commit run --all-files` for code quality checks. Never run ruff or mypy directly.
34+
**IMPORTANT**: Always use `pre-commit run --all-files` for code quality checks. Never run ruff or pyrefly directly.
3535

3636
### Development Workflow
3737
```bash
@@ -95,7 +95,7 @@ Required configuration files in `amazon-dash-private/`:
9595
### Code Quality Standards
9696

9797
- **Line length**: 100 characters (99 for tests)
98-
- **Type checking**: MyPy enabled for src/ (excluded for tests/)
98+
- **Type checking**: Pyrefly enabled for src/ (excluded for tests/)
9999
- **Linting**: Ruff with extensive rule set including Pylint, security checks, import ordering
100100
- **Formatting**: Ruff formatter
101101
- **Pre-commit hooks**: Automated code quality checks

GEMINI.md

Whitespace-only changes.

pyrightconfig.json

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

requirements.dev.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ requests-mock
1313
freezegun
1414

1515
# code quality
16-
pylint
17-
mypy
1816
pre-commit
1917

2018
# type stubs
2119
google-api-python-client-stubs
20+
types-requests
21+
types-python-dateutil
22+
types-httplib2
2223

2324
# docs
2425
lazydocs

requirements.dev.txt

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ annotated-types==0.7.0
88
# via
99
# -r requirements.txt
1010
# pydantic
11-
astroid==4.0.2
12-
# via pylint
1311
bracex==2.6
1412
# via wcmatch
1513
build==1.3.0
@@ -37,8 +35,6 @@ click==8.3.1
3735
# typer
3836
coverage[toml]==7.13.0
3937
# via pytest-cov
40-
dill==0.4.0
41-
# via pylint
4238
distlib==0.4.0
4339
# via virtualenv
4440
filelock==3.20.0
@@ -85,14 +81,10 @@ idna==3.11
8581
# requests
8682
iniconfig==2.3.0
8783
# via pytest
88-
isort==7.0.0
89-
# via pylint
9084
jinja2==3.1.6
9185
# via mkdocs
9286
lazydocs==0.4.8
9387
# via -r requirements.dev.in
94-
librt==0.7.3
95-
# via mypy
9688
markdown==3.10
9789
# via mkdocs
9890
markdown-it-py==4.0.0
@@ -101,8 +93,6 @@ markupsafe==3.0.3
10193
# via
10294
# jinja2
10395
# mkdocs
104-
mccabe==0.7.0
105-
# via pylint
10696
mdurl==0.1.2
10797
# via markdown-it-py
10898
mergedeep==1.3.4
@@ -117,10 +107,6 @@ mkdocs-awesome-pages-plugin==2.10.1
117107
# via -r requirements.dev.in
118108
mkdocs-get-deps==0.2.0
119109
# via mkdocs
120-
mypy==1.19.0
121-
# via -r requirements.dev.in
122-
mypy-extensions==1.1.0
123-
# via mypy
124110
natsort==8.4.0
125111
# via mkdocs-awesome-pages-plugin
126112
nodeenv==1.9.1
@@ -133,15 +119,12 @@ packaging==25.0
133119
# mkdocs
134120
# pytest
135121
pathspec==0.12.1
136-
# via
137-
# mkdocs
138-
# mypy
122+
# via mkdocs
139123
pip-tools==7.5.2
140124
# via -r requirements.dev.in
141125
platformdirs==4.5.1
142126
# via
143127
# mkdocs-get-deps
144-
# pylint
145128
# virtualenv
146129
pluggy==1.6.0
147130
# via
@@ -184,8 +167,6 @@ pygments==2.19.2
184167
# via
185168
# pytest
186169
# rich
187-
pylint==4.0.4
188-
# via -r requirements.dev.in
189170
pyparsing==3.2.5
190171
# via
191172
# -r requirements.txt
@@ -239,17 +220,20 @@ six==1.17.0
239220
# -r requirements.txt
240221
# oauth2client
241222
# python-dateutil
242-
tomlkit==0.13.3
243-
# via pylint
244223
typer==0.20.0
245224
# via lazydocs
246225
types-httplib2==0.31.0.20250913
247-
# via google-api-python-client-stubs
226+
# via
227+
# -r requirements.dev.in
228+
# google-api-python-client-stubs
229+
types-python-dateutil==2.9.0.20251115
230+
# via -r requirements.dev.in
231+
types-requests==2.32.4.20250913
232+
# via -r requirements.dev.in
248233
typing-extensions==4.15.0
249234
# via
250235
# -r requirements.txt
251236
# google-api-python-client-stubs
252-
# mypy
253237
# pydantic
254238
# pydantic-core
255239
# typer
@@ -266,6 +250,7 @@ urllib3==2.6.1
266250
# via
267251
# -r requirements.txt
268252
# requests
253+
# types-requests
269254
virtualenv==20.35.4
270255
# via pre-commit
271256
watchdog==6.0.0

src/amazon_dash.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from datetime import datetime, timedelta
1010
from typing import Any
1111

12-
from scapy.all import ( # pyright: ignore [reportMissingImports, reportMissingTypeStubs]
12+
from scapy.all import (
1313
Packet,
1414
sniff,
1515
)
16-
from scapy.layers.dhcp import DHCP # pyright: ignore [reportMissingImports, reportMissingTypeStubs]
17-
from scapy.layers.l2 import ARP # pyright: ignore [reportMissingImports, reportMissingTypeStubs]
16+
from scapy.layers.dhcp import DHCP
17+
from scapy.layers.l2 import ARP
1818

1919
import models
2020
from action import Action

src/google_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from typing import Any
66

77
import httplib2
8-
from googleapiclient import discovery # pyright: ignore [reportMissingImports]
8+
from googleapiclient import discovery
99
from oauth2client.service_account import (
10-
ServiceAccountCredentials, # pyright: ignore [reportMissingImports, reportMissingTypeStubs]
10+
ServiceAccountCredentials,
1111
)
1212

1313
import models
@@ -30,7 +30,7 @@ def get_credentials_http(self) -> httplib2.Http:
3030
try:
3131
credentials = ServiceAccountCredentials.from_json_keyfile_name(
3232
self.settings.credentials_file_name,
33-
[ # pyright: ignore [reportArgumentType]
33+
[
3434
"https://www.googleapis.com/auth/calendar",
3535
"https://www.googleapis.com/auth/spreadsheets",
3636
"https://www.googleapis.com/auth/drive.metadata.readonly",
@@ -51,7 +51,7 @@ def get_service(self, api: str, version: str) -> Any:
5151
return discovery.build(api, version, http=self.http)
5252

5353
@cached_property
54-
def service(self) -> Any: # do not use discovery.Resource as workaround for mypy
54+
def service(self) -> Any: # do not use discovery.Resource as workaround for pyrefly
5555
"""Get service."""
5656
return self.get_service(self.api, self.version)
5757

0 commit comments

Comments
 (0)