diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 1abd4c8600..3d3374d3be 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -61,6 +61,9 @@ jobs: - name: Run linters if: matrix.python == '3.11' run: make lint + - name: Run type checker + if: matrix.python == '3.11' + run: make typecheck - name: Run unit tests with coverage run: COVERAGE=1 make test - name: Generate coverage report (85%) # Coverage threshold should only increase over time — never decrease it! diff --git a/Makefile b/Makefile index 9f0282c65b..22e01972da 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -.PHONY: help install install-uv check-license lint \ +.PHONY: help install install-uv check-license lint typecheck \ test test-integration test-integration-setup test-integration-exec test-integration-cleanup test-integration-rebuild \ test-s3 test-adls test-gcs test-coverage coverage-report test test-notebook\ docs-serve docs-build notebook notebook-infra \ @@ -97,6 +97,9 @@ check-license: ## Check license headers lint: ## Run code linters via prek (pre-commit hooks) uv run $(PYTHON_ARG) prek run -a +typecheck: ## Run the ty type checker + uv run $(PYTHON_ARG) ty check --exit-zero-on-warning + # =============== # Testing Section # =============== diff --git a/pyproject.toml b/pyproject.toml index dc5f7df558..37ea062035 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,7 +128,7 @@ dev = [ "papermill>=2.6.0", "nbformat>=5.10.0", "ipykernel>=6.29.0", - "ty==0.0.92", + "ty==1.0.0", ] # for mkdocs docs = [ @@ -287,6 +287,26 @@ extra-paths = ["vendor"] # mkdocs_gen_files are only installed with the docs dependency group allowed-unresolved-imports = ["pyiceberg_core.datafusion", "griffe", "mkdocs_gen_files"] +[tool.ty.rules] +# Rules that currently report errors are disabled so ty can run in CI; re-enable each one as its errors are fixed +abstract-class-instantiation = "ignore" +incompatible-method-override = "ignore" +incompatible-mutable-override = "ignore" +invalid-argument-type = "ignore" +invalid-assignment = "ignore" +invalid-explicit-return = "ignore" +invalid-generic-class = "ignore" +invalid-type-form = "ignore" +lost-keyword-for-regular-parameter = "ignore" +missing-argument = "ignore" +missing-attribute = "ignore" +missing-module-member = "ignore" +missing-union-attribute = "ignore" +no-matching-overload = "ignore" +not-callable = "ignore" +not-subscriptable = "ignore" +unsupported-operator = "ignore" + [tool.coverage.run] source = ['pyiceberg/'] diff --git a/uv.lock b/uv.lock index 0b48446ccf..7032db305f 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 5 +revision = 3 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'win32'", @@ -1942,8 +1942,8 @@ name = "httpcore2" version = "2.13.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "h11" }, - { name = "truststore" }, + { name = "h11", marker = "sys_platform != 'emscripten'" }, + { name = "truststore", marker = "sys_platform != 'emscripten'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/cb/f3/1db7aa2bc2524062192bb0e0323969492d1883152a232fe36eea65f4e35c/httpcore2-2.13.1.tar.gz", hash = "sha256:e0aa977abe17e69a3b820a24542a6fa88702676d83880b8d194dcd18408e5103", size = 68071, upload-time = "2026-09-23T07:47:22.372Z" } wheels = [ @@ -3787,7 +3787,7 @@ name = "pexpect" version = "4.9.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "ptyprocess" }, + { name = "ptyprocess", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/42/92/cc564bf6381ff43ce1f4d06852fc19a2f11d180f23dc32d9588bee2f149d/pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f", size = 166450, upload-time = "2023-11-25T09:07:26.339Z" } wheels = [ @@ -4654,7 +4654,7 @@ dev = [ { name = "requests-mock", specifier = "==1.12.1" }, { name = "setuptools", specifier = ">=83.0.0" }, { name = "sqlalchemy", specifier = ">=2.0.18,<3" }, - { name = "ty", specifier = "==0.0.92" }, + { name = "ty", specifier = "==1.0.0" }, { name = "typing-extensions", specifier = "==4.16.0" }, ] docs = [ @@ -6023,27 +6023,27 @@ wheels = [ [[package]] name = "ty" -version = "0.0.92" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/45/f8/2629d3533019eec56b0008d93198b2cb1575795e017c52759d6ddbdad353/ty-0.0.92.tar.gz", hash = "sha256:d08ff5d89bb63780e30837446ea08ddae3db73ae0b872a441a5b514d37726459", size = 8071788, upload-time = "2026-10-26T03:13:58.999Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c4/cb/47bdaffb41500ebbd222952fdf5262b4efffca8c8df237b91915fd4f2849/ty-0.0.92-py3-none-linux_armv6l.whl", hash = "sha256:924af587c0d450e3589f4773de416d284483b68bb5cf5580159ad78c272e3298", size = 14365057, upload-time = "2026-10-26T03:13:07.962Z" }, - { url = "https://files.pythonhosted.org/packages/2e/68/1a18a4511b3cf12af9193f6466884f2cbe0ce2aed962ab9db6a1ddf586da/ty-0.0.92-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ce0232a3beee089de8ee120fdde4ea3b8ca02758e07128b83138970a4ded8db6", size = 13922188, upload-time = "2026-10-26T03:13:11.422Z" }, - { url = "https://files.pythonhosted.org/packages/18/6c/01c6680ea6d02e3b0a6a444dafbf549419fe4971cf7e139ea9c3f087a3c1/ty-0.0.92-py3-none-macosx_11_0_arm64.whl", hash = "sha256:b1753fdfa241af570c1dbd3fbfae9ff600d2c479ba60efe528bbb47ca15860b0", size = 13064190, upload-time = "2026-10-26T03:13:14.029Z" }, - { url = "https://files.pythonhosted.org/packages/4e/f2/79faf9b5ee7defd6df4fc97ff693502d21d34762e16b9031e1cbb4b3f51c/ty-0.0.92-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfaa6f4825144d0e873654d7223c72dda2ec8f9db6b1049e6897efbfb0a78680", size = 13852740, upload-time = "2026-10-26T03:13:17.019Z" }, - { url = "https://files.pythonhosted.org/packages/5c/aa/7e05fde03b145bac15164df206a844a806442570718fe4f478160607a2e3/ty-0.0.92-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e0041d6786f0d33768afd4f2d21650140534a2600a27576a0292812af49408ec", size = 14093792, upload-time = "2026-10-26T03:13:19.936Z" }, - { url = "https://files.pythonhosted.org/packages/49/21/cae3d9687922c4ce0e8c112634c3b43756cccad24733dca380ba1339fd71/ty-0.0.92-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c9d8060d840a291ae746ccfedd0e963786e09a7288599d370cde73168b208da", size = 14994799, upload-time = "2026-10-26T03:13:22.963Z" }, - { url = "https://files.pythonhosted.org/packages/34/77/bcf546f2fe4dd8eea9ff35b5eb6b9e0603dcc47b5c8a8f15d41f4a82030f/ty-0.0.92-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2088a253b98f04851e261e8e597b384988b790075451ff47b011e6018bf8bc80", size = 15473722, upload-time = "2026-10-26T03:13:26.062Z" }, - { url = "https://files.pythonhosted.org/packages/74/5e/c5c405a08d91874479887d8a8539ab4194a2322a47987785a3cf2c6a009b/ty-0.0.92-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a0a63965d320c569265ba65788fcfd4cd17f0b0d20c6e88bcfa21dc5fb509a4c", size = 15443218, upload-time = "2026-10-26T03:13:29.115Z" }, - { url = "https://files.pythonhosted.org/packages/26/77/6fd2ec1fd78eb783e93b89f1e1aee7fce9095b32dc5f6cc0fc831bd903f4/ty-0.0.92-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9b6b40225ddd0c049b299e0a655ce04d4de594c6cac3fb9c1e020b113494924", size = 14700747, upload-time = "2026-10-26T03:13:31.851Z" }, - { url = "https://files.pythonhosted.org/packages/fc/d3/b994c68a51f32029a60d56180ee33e9c708bb60997ea5f50b91b3027bd31/ty-0.0.92-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:020ccc79656c0d0f8f353e5e0760988775cdaa253fa4427e265ed96b4994e7fe", size = 14936345, upload-time = "2026-10-26T03:13:34.908Z" }, - { url = "https://files.pythonhosted.org/packages/d4/68/5e5732af9d38c1e00a31b7478f0a81b9e5557cca88f8848dc2573e00f665/ty-0.0.92-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:be5c1fc769335ab03d96f08ecc9878b598a57fd983c36cf5a04137d754828b63", size = 13781405, upload-time = "2026-10-26T03:13:37.684Z" }, - { url = "https://files.pythonhosted.org/packages/2f/6a/e833260c7bf85a5fdc3e08515d1351c6ce8e1186ee8f82cfeb93175f53df/ty-0.0.92-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a9f389840ec585075531ec1dfd62d25c73aeda0fb409a676ed996e426fb0a7bf", size = 14104200, upload-time = "2026-10-26T03:13:40.476Z" }, - { url = "https://files.pythonhosted.org/packages/66/94/79ea7b18132bcf33fb18cfe7ff5cd31f64ff34a13da56e2afe5ef4e81370/ty-0.0.92-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6a59f712c41b37f964b5b53f0c4207fcf25f4a0ae6cdd4db216f7c19d48c0673", size = 14410183, upload-time = "2026-10-26T03:13:43.707Z" }, - { url = "https://files.pythonhosted.org/packages/e6/da/a68a8dd13cee1df46270d68b2649eba40ae700d737c271bd44c03e9c3c90/ty-0.0.92-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:ca63bad30a6efb95a705de80db2b3d9fc8f120a03e0c7fe765a0413cd8e290e3", size = 14809277, upload-time = "2026-10-26T03:13:46.629Z" }, - { url = "https://files.pythonhosted.org/packages/03/3c/08d37a4c00675c3bd36a03ce3a18c3da284bbca02860df0f788617ceb7ee/ty-0.0.92-py3-none-win32.whl", hash = "sha256:7425c361755fb811e0067c9b29c4b8be65015f694fb2fcca63f99453f8966c30", size = 13311040, upload-time = "2026-10-26T03:13:50.558Z" }, - { url = "https://files.pythonhosted.org/packages/77/b1/f455ba90564e00fbef1e58ea8b29bfebaad6c67ea050a3386fba32db55ef/ty-0.0.92-py3-none-win_amd64.whl", hash = "sha256:646bed75c51c7ca3ae4cba015c699f384241bc873d6ad775e0c0d66629532312", size = 13942099, upload-time = "2026-10-26T03:13:53.17Z" }, - { url = "https://files.pythonhosted.org/packages/6e/70/8369564e77a7e896d37819570c27f52573fa356d1c225312bf16ee402524/ty-0.0.92-py3-none-win_arm64.whl", hash = "sha256:37eaf557f9a9723515bece5c4e8228eb0e2286184de6115c0071ce08d8a21267", size = 13411491, upload-time = "2026-10-26T03:13:56.15Z" }, +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e6/e9/d4d4e729d3a30ed05d6736dd64496ed73a1bbac0fef2cc33b6a469fbfdb3/ty-1.0.0.tar.gz", hash = "sha256:f44c2c8febc10a3ef0a6afddf694ded0d7a6ce07f5a8f586ba6989cfba9cfc40", size = 8486013, upload-time = "2026-12-01T16:47:31.676Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/ce/0e2254be3a541b88d1a272e2781fac8e51dabc2c7b03df653555f8b7c8cc/ty-1.0.0-py3-none-linux_armv6l.whl", hash = "sha256:85d054bb73d2231e7610319fc43f6298a1ff2c90f5611212091e59a1e51c6a82", size = 15576631, upload-time = "2026-12-01T16:46:51.033Z" }, + { url = "https://files.pythonhosted.org/packages/51/21/71bceb9dc5e42035e2ba107b8e2b2e8b6f888c712900b9485235b864b5f7/ty-1.0.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9dc24a9659f6a60f87f902000f840706db2fbce169152e77947314f2d22229ba", size = 15126686, upload-time = "2026-12-01T16:46:53.314Z" }, + { url = "https://files.pythonhosted.org/packages/8b/31/ad9ea55f8d274783745ace12f15a0bcf67860e4e27b30af4542245791751/ty-1.0.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53a529fd694b58430d90c446015800a22da2b082b1ac8b4c9b11bfd789137155", size = 14727282, upload-time = "2026-12-01T16:46:55.919Z" }, + { url = "https://files.pythonhosted.org/packages/5a/26/f857b930b2a345d82976881b9b8d79a86a337c32682eb8af16933febc8dd/ty-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6dbd54b073dfbc3366ba4fbee6f3c755b8f1e03dd3032611510d0da5c069f441", size = 15676104, upload-time = "2026-12-01T16:46:58.397Z" }, + { url = "https://files.pythonhosted.org/packages/62/15/9d37c4a299bd7ce13e347d57d177095e93870080352d7702ab3f630bbf5c/ty-1.0.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b17cfe36c3a447bf8ccee87f20e03e1a2fe90bb67165fb5f05408de428e1e6d6", size = 15300998, upload-time = "2026-12-01T16:47:00.65Z" }, + { url = "https://files.pythonhosted.org/packages/2a/60/42b64082a6bb0a48e04dd138f3ac31009600e0ac185ea7b7bfea6305c620/ty-1.0.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:156e9e7a684518e96faab0495102d00cb1543c01b13bd1aab80b7db822bc3463", size = 16333807, upload-time = "2026-12-01T16:47:03.574Z" }, + { url = "https://files.pythonhosted.org/packages/3e/38/e7fbb7724689f5a0c9aa1ff4781b6b789d471439131f46c90eaeef99f5bd/ty-1.0.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4398eccb49be132344412149fa65ca3b1033a3902ce6ecfd33590f9411b34483", size = 16761409, upload-time = "2026-12-01T16:47:06.111Z" }, + { url = "https://files.pythonhosted.org/packages/fd/29/cbc7a4a93f70cd015bb3efc6f70bbd898b19e5fc618b81d7fc0aa9aec86e/ty-1.0.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81f10ebd1e2790d9c52b7ae98a6b43667a7e48987c940774fb9d20daecab9ba4", size = 16592442, upload-time = "2026-12-01T16:47:08.597Z" }, + { url = "https://files.pythonhosted.org/packages/e7/89/5d7c69266d9e4be567c60afdab8ce67ecdf2f72a5fc20facf6894a45ea5c/ty-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6f6de937733b9f53d44d1bf38fd7c8c37eacb08df39c4ac74104d1369f3508e", size = 18056945, upload-time = "2026-12-01T16:47:11.228Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ab/df18c5a9c58bae6652187bafdd28caacdd4197d910bd53e204820cf7230f/ty-1.0.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:ab3cc13d8b44b006740a2b726818b530db1a07adb26965d598c456fb395c1b39", size = 16194867, upload-time = "2026-12-01T16:47:13.475Z" }, + { url = "https://files.pythonhosted.org/packages/95/63/cda9af06c60c3e4ce761e3e6d9856a7fbaa8a72de8a7a26bb6f4aa65e807/ty-1.0.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eb1f2ee59e06e99e7afc7d4b55b3c0f0374b961125a4abb2b4b537948a362164", size = 14986686, upload-time = "2026-12-01T16:47:15.569Z" }, + { url = "https://files.pythonhosted.org/packages/01/a3/d607dc4fea80ff8b9b28d253322d8c8e7a24fac1ab609d53fe4d2373c07b/ty-1.0.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4465087699fff93365de7456c354f7ca888d3ffa866c0e9c462459cc10e49b9a", size = 15312128, upload-time = "2026-12-01T16:47:17.949Z" }, + { url = "https://files.pythonhosted.org/packages/c5/0d/16d2b397b15ce81d583a5749381fb0442b8ea5ba6b6be9f8923d5808d3a7/ty-1.0.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e665d75055bd29c7b927079df0f1cab7467c8e35f6f46dbf5b7ef0f2bf795bf8", size = 15691625, upload-time = "2026-12-01T16:47:20.251Z" }, + { url = "https://files.pythonhosted.org/packages/b3/b0/eb5a879ba3ede632975b790a15824b32b37b178e943eb74629a7fe9360e1/ty-1.0.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:142d4246148aa81993b126778176e95f2ab2d5c2a18e5e39ef85c46f7cdf4187", size = 16015617, upload-time = "2026-12-01T16:47:22.707Z" }, + { url = "https://files.pythonhosted.org/packages/0a/c1/9125ccaa9fdb2bf01ed2049021cb38c3719f34975f50ef30b7e20fa12dec/ty-1.0.0-py3-none-win32.whl", hash = "sha256:12810598e01b77bfc450c46b0d80d6163743911265b15214c3367abdf4d42707", size = 14534799, upload-time = "2026-12-01T16:47:24.771Z" }, + { url = "https://files.pythonhosted.org/packages/68/b0/ecb8aa569131c81e9e0df99908cf578de47015550f1da377979f412940b0/ty-1.0.0-py3-none-win_amd64.whl", hash = "sha256:3766baad89e2de310bbcf641b1af6cd018c037ecddcfaf0cc65652ee48f12642", size = 15389185, upload-time = "2026-12-01T16:47:26.951Z" }, + { url = "https://files.pythonhosted.org/packages/ee/4c/bd2c62051747eaeec24cc9183dfd8f1e314c225bd4a4f56f4d79885974e1/ty-1.0.0-py3-none-win_arm64.whl", hash = "sha256:03a67077356e8eb9ecc2bd02d7ecd5782b45d00274d88c1cd707c6d6d7f61128", size = 14636001, upload-time = "2026-12-01T16:47:29.196Z" }, ] [[package]]