Skip to content

Commit fb338d1

Browse files
authored
chore: add support for ty and pyrefly (#1107)
1 parent d4dc4c4 commit fb338d1

File tree

8 files changed

+251
-10
lines changed

8 files changed

+251
-10
lines changed

.github/workflows/typing.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,55 @@ jobs:
3636
run: poetry install
3737
- name: Check typing
3838
run: poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $(echo "${{ matrix.lib }}" | tr "-" "_")
39+
40+
ty:
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
lib:
45+
- scaleway-core
46+
- scaleway
47+
- scaleway-async
48+
python-version: [ '3.10' ,'3.11', '3.12', '3.13' ]
49+
defaults:
50+
run:
51+
working-directory: ${{ matrix.lib }}
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Install poetry
55+
run: pipx install poetry
56+
- name: Set up Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
cache: "poetry"
61+
- name: Install dependencies and library
62+
run: poetry install
63+
- name: Check typing
64+
run: poetry run ty check
65+
66+
pyrefly:
67+
runs-on: ubuntu-latest
68+
strategy:
69+
matrix:
70+
lib:
71+
- scaleway-core
72+
- scaleway
73+
- scaleway-async
74+
python-version: [ '3.10' ,'3.11', '3.12', '3.13' ]
75+
defaults:
76+
run:
77+
working-directory: ${{ matrix.lib }}
78+
steps:
79+
- uses: actions/checkout@v4
80+
- name: Install poetry
81+
run: pipx install poetry
82+
- name: Set up Python
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ matrix.python-version }}
86+
cache: "poetry"
87+
- name: Install dependencies and library
88+
run: poetry install
89+
- name: Check typing with pyrefly
90+
run: poetry run pyrefly check

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ typing:
3737
for lib in $(LIBRARIES); do \
3838
cd ${WORKDIR}/$$lib && \
3939
poetry run mypy --version && \
40-
poetry run mypy --install-types --non-interactive --strict $$(echo $$lib | tr "-" "_"); \
40+
poetry run mypy --install-types --non-interactive --strict $$(echo $$lib | tr "-" "_") && \
41+
poetry run ty version && \
42+
poetry run ty check && \
43+
poetry run pyrefly --version && \
44+
poetry run pyrefly check; \
4145
done
4246

4347
lint:

scaleway-async/poetry.lock

Lines changed: 50 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaleway-async/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,22 @@ scaleway-core = "*"
3030
scaleway-core = { path = "../scaleway-core", develop = true }
3131
ruff = ">=0.5.0,<0.12.5"
3232
mypy = "^1.5.1"
33+
ty = "^0.0.1a15"
34+
pyrefly = "^0.24.2"
3335

3436
[build-system]
3537
requires = ["poetry-core"]
3638
build-backend = "poetry.core.masonry.api"
3739

3840
[tool.ruff.lint]
3941
ignore = ["E501"]
42+
43+
[tool.ty.rules]
44+
missing-argument = "ignore"
45+
invalid-argument-type = "ignore"
46+
47+
[tool.pyrefly.errors]
48+
import-error = false
49+
missing-argument = false
50+
bad-argument-type = false
51+
invalid-argument = false

scaleway-core/poetry.lock

Lines changed: 50 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaleway-core/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,22 @@ python-dateutil = "^2.8.2"
3232
types-python-dateutil = "^2.8.19"
3333
ruff = ">=0.5.0,<0.12.5"
3434
mypy = "^1.5.1"
35+
ty = "^0.0.1a15"
36+
pyrefly = "^0.24.2"
3537

3638
[build-system]
3739
requires = ["poetry-core"]
3840
build-backend = "poetry.core.masonry.api"
3941

4042
[tool.ruff.lint]
4143
ignore = ["E501"]
44+
45+
[tool.pyrefly.errors]
46+
import-error = false
47+
not-callable = false
48+
bad-return = false
49+
bad-assignment = false
50+
bad-argument-type = false
51+
52+
[tool.ty.rules]
53+
unsupported-operator = "ignore"

0 commit comments

Comments
 (0)