From d15d734f20d504d03d726efe08d03d755203c3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 12:01:38 +0200 Subject: [PATCH 1/8] chore: fix type hinting --- scaleway-core/scaleway_core/utils/resolve_one_of.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scaleway-core/scaleway_core/utils/resolve_one_of.py b/scaleway-core/scaleway_core/utils/resolve_one_of.py index 87f1dc5e..0accd2c3 100644 --- a/scaleway-core/scaleway_core/utils/resolve_one_of.py +++ b/scaleway-core/scaleway_core/utils/resolve_one_of.py @@ -15,6 +15,8 @@ class OneOfPossibility(Generic[T]): default: Optional[T | ProfileDefaults] = None marshal_func: Optional[Callable[[T, T | None], Dict[str, Any]]] = None + marshal_func: Optional[T] = None + def resolve_one_of( possibilities: List[OneOfPossibility[Any]], is_required: bool = False From c00df6075dbe40d463826fa1ff42e9c1e9fca0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 13:34:54 +0200 Subject: [PATCH 2/8] Fix --- scaleway-core/scaleway_core/utils/resolve_one_of.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scaleway-core/scaleway_core/utils/resolve_one_of.py b/scaleway-core/scaleway_core/utils/resolve_one_of.py index 0accd2c3..87f1dc5e 100644 --- a/scaleway-core/scaleway_core/utils/resolve_one_of.py +++ b/scaleway-core/scaleway_core/utils/resolve_one_of.py @@ -15,8 +15,6 @@ class OneOfPossibility(Generic[T]): default: Optional[T | ProfileDefaults] = None marshal_func: Optional[Callable[[T, T | None], Dict[str, Any]]] = None - marshal_func: Optional[T] = None - def resolve_one_of( possibilities: List[OneOfPossibility[Any]], is_required: bool = False From 919c036e61d88b59477d53d6e0350bb3edd64ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 13:36:24 +0200 Subject: [PATCH 3/8] fix format --- scaleway-core/scaleway_core/utils/resolve_one_of.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scaleway-core/scaleway_core/utils/resolve_one_of.py b/scaleway-core/scaleway_core/utils/resolve_one_of.py index 87f1dc5e..b7cd9bb6 100644 --- a/scaleway-core/scaleway_core/utils/resolve_one_of.py +++ b/scaleway-core/scaleway_core/utils/resolve_one_of.py @@ -16,6 +16,7 @@ class OneOfPossibility(Generic[T]): marshal_func: Optional[Callable[[T, T | None], Dict[str, Any]]] = None + def resolve_one_of( possibilities: List[OneOfPossibility[Any]], is_required: bool = False ) -> SupportsKeysAndGetItem[str, Any]: From fe412ef37f1ebf1fe53930e0d110bcf8147a7583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 17:54:31 +0200 Subject: [PATCH 4/8] chore: add support for ty and pyrefly --- .github/workflows/typing.yml | 52 ++++++++++++++++++++++++++++++++++ scaleway-async/poetry.lock | 53 +++++++++++++++++++++++++++++++++-- scaleway-async/pyproject.toml | 11 ++++++++ scaleway-core/poetry.lock | 53 +++++++++++++++++++++++++++++++++-- scaleway-core/pyproject.toml | 8 ++++++ scaleway/poetry.lock | 53 +++++++++++++++++++++++++++++++++-- scaleway/pyproject.toml | 19 +++++++++++++ 7 files changed, 240 insertions(+), 9 deletions(-) diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml index 0f865ca3..df6c26b2 100644 --- a/.github/workflows/typing.yml +++ b/.github/workflows/typing.yml @@ -36,3 +36,55 @@ jobs: run: poetry install - name: Check typing run: poetry run mypy --install-types --non-interactive --strict --no-warn-unused-ignores $(echo "${{ matrix.lib }}" | tr "-" "_") + + ty: + runs-on: ubuntu-latest + strategy: + matrix: + lib: + - scaleway-core + - scaleway + - scaleway-async + python-version: [ '3.10' ,'3.11', '3.12', '3.13' ] + defaults: + run: + working-directory: ${{ matrix.lib }} + steps: + - uses: actions/checkout@v4 + - name: Install poetry + run: pipx install poetry + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" + - name: Install dependencies and library + run: poetry install + - name: Check typing + run: poetry run ty check + + pyrefly: + runs-on: ubuntu-latest + strategy: + matrix: + lib: + - scaleway-core + - scaleway + - scaleway-async + python-version: [ '3.10' ,'3.11', '3.12', '3.13' ] + defaults: + run: + working-directory: ${{ matrix.lib }} + steps: + - uses: actions/checkout@v4 + - name: Install poetry + run: pipx install poetry + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" + - name: Install dependencies and library + run: poetry install + - name: Check typing with pyrefly + run: poetry run pyrefly check diff --git a/scaleway-async/poetry.lock b/scaleway-async/poetry.lock index b4b22791..3f85fd5c 100644 --- a/scaleway-async/poetry.lock +++ b/scaleway-async/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "certifi" @@ -208,6 +208,25 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] +[[package]] +name = "pyrefly" +version = "0.24.2" +description = "A fast Python type checker written in Rust" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pyrefly-0.24.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7e6bd1b88ec53b3f1ce2ece844016d7e7f0848a77022857a7fa6674a49abcc13"}, + {file = "pyrefly-0.24.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:83aa9013f2299dfc8ce11adec30a63be71528484c45e603375efe7496cb0538e"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3bf1689032b78f8f653244cd323ee1e06a0efb6192c4d7a415d1e85aedd37905"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8404b804a5a1bc4a54cc8e58bceacdf49d7221531843c068547241d8f476af24"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14d09f166a46e43655ea812611887ca16a0c54386296f4c9333f3f5fc7236709"}, + {file = "pyrefly-0.24.2-py3-none-win32.whl", hash = "sha256:6c602df48dcfa3240f9076c7d1e9cf9dc2d94c90ee5b4c6745f3734125a2cf3a"}, + {file = "pyrefly-0.24.2-py3-none-win_amd64.whl", hash = "sha256:9ed4690716eb47077082d4e99624e0a1165b9ac93300c8d823f42cae12ec1ef4"}, + {file = "pyrefly-0.24.2-py3-none-win_arm64.whl", hash = "sha256:96ba49c02f374d716b8674409aa653093dad5263cf4e429a1d5ec603064db715"}, + {file = "pyrefly-0.24.2.tar.gz", hash = "sha256:671b9933c2a3f646983de68bc0422736f7ce364c4f645f742559423b0b9b5150"}, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -374,7 +393,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -410,6 +429,34 @@ files = [ {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] +[[package]] +name = "ty" +version = "0.0.1a15" +description = "An extremely fast Python type checker, written in Rust." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "ty-0.0.1a15-py3-none-linux_armv6l.whl", hash = "sha256:6110b5afee7ae1b0c8d00770eef4937ed0b700b823da04db04486bc661dc0f80"}, + {file = "ty-0.0.1a15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:855401e2fc1d4376f007ef7684dd9173e6a408adc2bc4610013f40c2a1d68d0f"}, + {file = "ty-0.0.1a15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a20b21ea9683d92d541de4a534b68b4b595c2d04bf77be0ebfe05c9768ef47e7"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7648b0931177233e31d952723f068f2925696e464c436ed8bd820b775053474b"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c9c6b70ae331585984b79a4574f28619d5ff755515b93b5454d04f5c521ca864"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38cae5d28b2882e66f4786825e87d500cfbb806c30bbcac745f20e459cf92482"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1a8de6d3185afbf7cc199932d7fc508887e7ddad95a15c930efc4b5445eae6de"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5a38db0c2ceb2f0c20241ef6a1a5b0996dad45532bb50661faf46f28b64b9f0"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0045fe7905813296fa821dad4aaabbe0f011ce34915fdfabf651db5b5f7b9d72"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32deff2b8b05e8a8b8bf0f48ca1eef72ec299b9cc546ef9aba7185a033de28b1"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:60c330a9f37b260ebdf7d3e7e05ec483fab15116f11317ffd76b0e09598038b0"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:745355c15574d50229c3644e47bad1192e261faaf3a11870641b4902a8d9d8fe"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:07d53cb7c9c322be41dc79c373024422f6c6cd9e96f658e4b1b3289fe6130274"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26b28ed6e6ea80766fdd2608ea6e4daeb211e8de2b4b88376f574667bb90f489"}, + {file = "ty-0.0.1a15-py3-none-win32.whl", hash = "sha256:42f8d40aa30ef0c2187b70528151e740b74db47eb84a568fbc636c7294a1046e"}, + {file = "ty-0.0.1a15-py3-none-win_amd64.whl", hash = "sha256:2563111b072ea132443629a5fe0ec0cefed94c610cc694fc1bd2f48e179ca966"}, + {file = "ty-0.0.1a15-py3-none-win_arm64.whl", hash = "sha256:9ea13096dda97437284b61915da92384d283cd096dbe730a3f63ee644721d2d5"}, + {file = "ty-0.0.1a15.tar.gz", hash = "sha256:b601eb50e981bd3fb857eb17b473cad3728dab67f53370b6790dfc342797eb20"}, +] + [[package]] name = "typing-extensions" version = "4.12.2" @@ -443,4 +490,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "0929215bf56c3fbdf60357b77f94a38720a389d7b41ab22260fbe6d0ead4844a" +content-hash = "169b6e7eb1c10988bc21662216646417c7fa1e7b639f4132bb970ee5479c407f" diff --git a/scaleway-async/pyproject.toml b/scaleway-async/pyproject.toml index 411edcd8..5f4028c3 100644 --- a/scaleway-async/pyproject.toml +++ b/scaleway-async/pyproject.toml @@ -30,6 +30,8 @@ scaleway-core = "*" scaleway-core = { path = "../scaleway-core", develop = true } ruff = ">=0.5.0,<0.12.5" mypy = "^1.5.1" +ty = "^0.0.1a15" +pyrefly = "^0.24.2" [build-system] requires = ["poetry-core"] @@ -37,3 +39,12 @@ build-backend = "poetry.core.masonry.api" [tool.ruff.lint] ignore = ["E501"] + +[tool.ty.rules] +missing-argument = "ignore" +invalid-argument-type = "ignore" + +[tool.pyrefly.errors] +import-error = false +missing-argument = false +bad-argument-type = false diff --git a/scaleway-core/poetry.lock b/scaleway-core/poetry.lock index 41d06002..a856daa3 100644 --- a/scaleway-core/poetry.lock +++ b/scaleway-core/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "certifi" @@ -208,6 +208,25 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] +[[package]] +name = "pyrefly" +version = "0.24.2" +description = "A fast Python type checker written in Rust" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pyrefly-0.24.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7e6bd1b88ec53b3f1ce2ece844016d7e7f0848a77022857a7fa6674a49abcc13"}, + {file = "pyrefly-0.24.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:83aa9013f2299dfc8ce11adec30a63be71528484c45e603375efe7496cb0538e"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3bf1689032b78f8f653244cd323ee1e06a0efb6192c4d7a415d1e85aedd37905"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8404b804a5a1bc4a54cc8e58bceacdf49d7221531843c068547241d8f476af24"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14d09f166a46e43655ea812611887ca16a0c54386296f4c9333f3f5fc7236709"}, + {file = "pyrefly-0.24.2-py3-none-win32.whl", hash = "sha256:6c602df48dcfa3240f9076c7d1e9cf9dc2d94c90ee5b4c6745f3734125a2cf3a"}, + {file = "pyrefly-0.24.2-py3-none-win_amd64.whl", hash = "sha256:9ed4690716eb47077082d4e99624e0a1165b9ac93300c8d823f42cae12ec1ef4"}, + {file = "pyrefly-0.24.2-py3-none-win_arm64.whl", hash = "sha256:96ba49c02f374d716b8674409aa653093dad5263cf4e429a1d5ec603064db715"}, + {file = "pyrefly-0.24.2.tar.gz", hash = "sha256:671b9933c2a3f646983de68bc0422736f7ce364c4f645f742559423b0b9b5150"}, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -355,7 +374,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -391,6 +410,34 @@ files = [ {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] +[[package]] +name = "ty" +version = "0.0.1a15" +description = "An extremely fast Python type checker, written in Rust." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "ty-0.0.1a15-py3-none-linux_armv6l.whl", hash = "sha256:6110b5afee7ae1b0c8d00770eef4937ed0b700b823da04db04486bc661dc0f80"}, + {file = "ty-0.0.1a15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:855401e2fc1d4376f007ef7684dd9173e6a408adc2bc4610013f40c2a1d68d0f"}, + {file = "ty-0.0.1a15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a20b21ea9683d92d541de4a534b68b4b595c2d04bf77be0ebfe05c9768ef47e7"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7648b0931177233e31d952723f068f2925696e464c436ed8bd820b775053474b"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c9c6b70ae331585984b79a4574f28619d5ff755515b93b5454d04f5c521ca864"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38cae5d28b2882e66f4786825e87d500cfbb806c30bbcac745f20e459cf92482"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1a8de6d3185afbf7cc199932d7fc508887e7ddad95a15c930efc4b5445eae6de"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5a38db0c2ceb2f0c20241ef6a1a5b0996dad45532bb50661faf46f28b64b9f0"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0045fe7905813296fa821dad4aaabbe0f011ce34915fdfabf651db5b5f7b9d72"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32deff2b8b05e8a8b8bf0f48ca1eef72ec299b9cc546ef9aba7185a033de28b1"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:60c330a9f37b260ebdf7d3e7e05ec483fab15116f11317ffd76b0e09598038b0"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:745355c15574d50229c3644e47bad1192e261faaf3a11870641b4902a8d9d8fe"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:07d53cb7c9c322be41dc79c373024422f6c6cd9e96f658e4b1b3289fe6130274"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26b28ed6e6ea80766fdd2608ea6e4daeb211e8de2b4b88376f574667bb90f489"}, + {file = "ty-0.0.1a15-py3-none-win32.whl", hash = "sha256:42f8d40aa30ef0c2187b70528151e740b74db47eb84a568fbc636c7294a1046e"}, + {file = "ty-0.0.1a15-py3-none-win_amd64.whl", hash = "sha256:2563111b072ea132443629a5fe0ec0cefed94c610cc694fc1bd2f48e179ca966"}, + {file = "ty-0.0.1a15-py3-none-win_arm64.whl", hash = "sha256:9ea13096dda97437284b61915da92384d283cd096dbe730a3f63ee644721d2d5"}, + {file = "ty-0.0.1a15.tar.gz", hash = "sha256:b601eb50e981bd3fb857eb17b473cad3728dab67f53370b6790dfc342797eb20"}, +] + [[package]] name = "types-python-dateutil" version = "2.9.0.20250708" @@ -436,4 +483,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "887f8543f9f03e0f355090e8683155da031a952ad373f0c3cff54f0a2f9f7354" +content-hash = "aabeacd754732e38d64bf1a62e8297805a7928d1eea17c5df0bdc04c630ea430" diff --git a/scaleway-core/pyproject.toml b/scaleway-core/pyproject.toml index 9907545b..f0bf8ede 100644 --- a/scaleway-core/pyproject.toml +++ b/scaleway-core/pyproject.toml @@ -32,6 +32,8 @@ python-dateutil = "^2.8.2" types-python-dateutil = "^2.8.19" ruff = ">=0.5.0,<0.12.5" mypy = "^1.5.1" +ty = "^0.0.1a15" +pyrefly = "^0.24.2" [build-system] requires = ["poetry-core"] @@ -39,3 +41,9 @@ build-backend = "poetry.core.masonry.api" [tool.ruff.lint] ignore = ["E501"] + +[tool.pyrefly.errors] +import-error = false +not-callable = false +bad-return = false +bad-assignment = false diff --git a/scaleway/poetry.lock b/scaleway/poetry.lock index b4b22791..2dc1cfab 100644 --- a/scaleway/poetry.lock +++ b/scaleway/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "certifi" @@ -208,6 +208,25 @@ files = [ {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] +[[package]] +name = "pyrefly" +version = "0.24.2" +description = "A fast Python type checker written in Rust" +optional = false +python-versions = ">=3.8" +groups = ["main", "dev"] +files = [ + {file = "pyrefly-0.24.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7e6bd1b88ec53b3f1ce2ece844016d7e7f0848a77022857a7fa6674a49abcc13"}, + {file = "pyrefly-0.24.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:83aa9013f2299dfc8ce11adec30a63be71528484c45e603375efe7496cb0538e"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3bf1689032b78f8f653244cd323ee1e06a0efb6192c4d7a415d1e85aedd37905"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8404b804a5a1bc4a54cc8e58bceacdf49d7221531843c068547241d8f476af24"}, + {file = "pyrefly-0.24.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14d09f166a46e43655ea812611887ca16a0c54386296f4c9333f3f5fc7236709"}, + {file = "pyrefly-0.24.2-py3-none-win32.whl", hash = "sha256:6c602df48dcfa3240f9076c7d1e9cf9dc2d94c90ee5b4c6745f3734125a2cf3a"}, + {file = "pyrefly-0.24.2-py3-none-win_amd64.whl", hash = "sha256:9ed4690716eb47077082d4e99624e0a1165b9ac93300c8d823f42cae12ec1ef4"}, + {file = "pyrefly-0.24.2-py3-none-win_arm64.whl", hash = "sha256:96ba49c02f374d716b8674409aa653093dad5263cf4e429a1d5ec603064db715"}, + {file = "pyrefly-0.24.2.tar.gz", hash = "sha256:671b9933c2a3f646983de68bc0422736f7ce364c4f645f742559423b0b9b5150"}, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -374,7 +393,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -410,6 +429,34 @@ files = [ {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] +[[package]] +name = "ty" +version = "0.0.1a15" +description = "An extremely fast Python type checker, written in Rust." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "ty-0.0.1a15-py3-none-linux_armv6l.whl", hash = "sha256:6110b5afee7ae1b0c8d00770eef4937ed0b700b823da04db04486bc661dc0f80"}, + {file = "ty-0.0.1a15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:855401e2fc1d4376f007ef7684dd9173e6a408adc2bc4610013f40c2a1d68d0f"}, + {file = "ty-0.0.1a15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a20b21ea9683d92d541de4a534b68b4b595c2d04bf77be0ebfe05c9768ef47e7"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7648b0931177233e31d952723f068f2925696e464c436ed8bd820b775053474b"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c9c6b70ae331585984b79a4574f28619d5ff755515b93b5454d04f5c521ca864"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38cae5d28b2882e66f4786825e87d500cfbb806c30bbcac745f20e459cf92482"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1a8de6d3185afbf7cc199932d7fc508887e7ddad95a15c930efc4b5445eae6de"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d5a38db0c2ceb2f0c20241ef6a1a5b0996dad45532bb50661faf46f28b64b9f0"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0045fe7905813296fa821dad4aaabbe0f011ce34915fdfabf651db5b5f7b9d72"}, + {file = "ty-0.0.1a15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32deff2b8b05e8a8b8bf0f48ca1eef72ec299b9cc546ef9aba7185a033de28b1"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:60c330a9f37b260ebdf7d3e7e05ec483fab15116f11317ffd76b0e09598038b0"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:745355c15574d50229c3644e47bad1192e261faaf3a11870641b4902a8d9d8fe"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:07d53cb7c9c322be41dc79c373024422f6c6cd9e96f658e4b1b3289fe6130274"}, + {file = "ty-0.0.1a15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:26b28ed6e6ea80766fdd2608ea6e4daeb211e8de2b4b88376f574667bb90f489"}, + {file = "ty-0.0.1a15-py3-none-win32.whl", hash = "sha256:42f8d40aa30ef0c2187b70528151e740b74db47eb84a568fbc636c7294a1046e"}, + {file = "ty-0.0.1a15-py3-none-win_amd64.whl", hash = "sha256:2563111b072ea132443629a5fe0ec0cefed94c610cc694fc1bd2f48e179ca966"}, + {file = "ty-0.0.1a15-py3-none-win_arm64.whl", hash = "sha256:9ea13096dda97437284b61915da92384d283cd096dbe730a3f63ee644721d2d5"}, + {file = "ty-0.0.1a15.tar.gz", hash = "sha256:b601eb50e981bd3fb857eb17b473cad3728dab67f53370b6790dfc342797eb20"}, +] + [[package]] name = "typing-extensions" version = "4.12.2" @@ -443,4 +490,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "0929215bf56c3fbdf60357b77f94a38720a389d7b41ab22260fbe6d0ead4844a" +content-hash = "e6c0ec0e480fa432442e060a9a7749cda063117c2b9f4240f13729ef6b88ec8a" diff --git a/scaleway/pyproject.toml b/scaleway/pyproject.toml index 951d467e..7201c800 100644 --- a/scaleway/pyproject.toml +++ b/scaleway/pyproject.toml @@ -25,11 +25,14 @@ classifiers = [ [tool.poetry.dependencies] python = ">=3.10" scaleway-core = "*" +pyrefly = "^0.24.2" [tool.poetry.group.dev.dependencies] scaleway-core = { path = "../scaleway-core", develop = true } ruff = ">=0.5.0,<0.12.5" mypy = "^1.5.1" +ty = "^0.0.1a15" +pyrefly = "^0.24.2" [build-system] requires = ["poetry-core"] @@ -37,3 +40,19 @@ build-backend = "poetry.core.masonry.api" [tool.ruff.lint] ignore = ["E501"] + +[tool.pyrefly.errors] +missing-attribute = false +no-access = false +no-matching-overload = false +import-error = false +bad-assignment = false +bad-return = false +missing-argument = false +bad-argument-type = false + +[tool.ty.rules] +invalid-assignment = "ignore" +invalid-argument-type = "ignore" +missing-argument = "ignore" +unresolved-reference = "ignore" From d70978e458e9089970bf24a70061ab3d4c4c3bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 15:11:37 +0200 Subject: [PATCH 5/8] remove unmarshall logic --- Makefile | 6 +++++- scaleway-core/scaleway_core/utils/resolve_one_of.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index da8da6bf..7a49e7ac 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,11 @@ typing: for lib in $(LIBRARIES); do \ cd ${WORKDIR}/$$lib && \ poetry run mypy --version && \ - poetry run mypy --install-types --non-interactive --strict $$(echo $$lib | tr "-" "_"); \ + poetry run mypy --install-types --non-interactive --strict $$(echo $$lib | tr "-" "_") && \ + poetry run ty version && \ + poetry run ty check && \ + poetry run pyrefly --version && \ + poetry run pyrefly check; \ done lint: diff --git a/scaleway-core/scaleway_core/utils/resolve_one_of.py b/scaleway-core/scaleway_core/utils/resolve_one_of.py index b7cd9bb6..87f1dc5e 100644 --- a/scaleway-core/scaleway_core/utils/resolve_one_of.py +++ b/scaleway-core/scaleway_core/utils/resolve_one_of.py @@ -16,7 +16,6 @@ class OneOfPossibility(Generic[T]): marshal_func: Optional[Callable[[T, T | None], Dict[str, Any]]] = None - def resolve_one_of( possibilities: List[OneOfPossibility[Any]], is_required: bool = False ) -> SupportsKeysAndGetItem[str, Any]: From d696f4b7bdf3039a0030f622b278a761814ea30e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 18:01:15 +0200 Subject: [PATCH 6/8] Fix ignore --- scaleway-async/pyproject.toml | 1 + scaleway/pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/scaleway-async/pyproject.toml b/scaleway-async/pyproject.toml index 5f4028c3..f60c8927 100644 --- a/scaleway-async/pyproject.toml +++ b/scaleway-async/pyproject.toml @@ -48,3 +48,4 @@ invalid-argument-type = "ignore" import-error = false missing-argument = false bad-argument-type = false +invalid-argument = false diff --git a/scaleway/pyproject.toml b/scaleway/pyproject.toml index 7201c800..5dfc23fc 100644 --- a/scaleway/pyproject.toml +++ b/scaleway/pyproject.toml @@ -50,6 +50,7 @@ bad-assignment = false bad-return = false missing-argument = false bad-argument-type = false +invalid-argument = false [tool.ty.rules] invalid-assignment = "ignore" From 773764bf1f8e3b390fdf6f3d7956d735570bdcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Mon, 21 Jul 2025 18:05:48 +0200 Subject: [PATCH 7/8] Fix --- scaleway-core/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/scaleway-core/pyproject.toml b/scaleway-core/pyproject.toml index f0bf8ede..eb9e3836 100644 --- a/scaleway-core/pyproject.toml +++ b/scaleway-core/pyproject.toml @@ -47,3 +47,4 @@ import-error = false not-callable = false bad-return = false bad-assignment = false +bad-argument-type = false From a8e77ceb060aea521731ff315f5cc1bbdc3246cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 22 Jul 2025 11:15:03 +0200 Subject: [PATCH 8/8] Fix --- scaleway-core/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scaleway-core/pyproject.toml b/scaleway-core/pyproject.toml index eb9e3836..3706641c 100644 --- a/scaleway-core/pyproject.toml +++ b/scaleway-core/pyproject.toml @@ -48,3 +48,6 @@ not-callable = false bad-return = false bad-assignment = false bad-argument-type = false + +[tool.ty.rules] +unsupported-operator = "ignore"