From bbba03ac9d2c18f430bfc2953ee2775d32007e6e Mon Sep 17 00:00:00 2001 From: Anas Khan <83116240+anxkhn@users.noreply.github.com> Date: Sat, 4 Jul 2026 21:31:56 +0530 Subject: [PATCH] Build: Declare typing-extensions as a core dependency typing_extensions is imported unconditionally at module import time: `Self` in pyiceberg/typedef.py (a module imported transitively by nearly the whole package) and `override` in ten catalog and IO modules. Both are top-level runtime imports, not guarded by TYPE_CHECKING, and typing.Self / typing.override are only in the standard library on Python 3.11+ / 3.12+ while pyiceberg supports Python 3.10. However typing-extensions was declared only in the dev dependency group, so the distributed package under-declared a required import. It works today solely because pydantic pulls typing-extensions in transitively; if that transitive edge ever changes, `import pyiceberg` would fail with ModuleNotFoundError. Move it to [project.dependencies] with a floor of 4.4.0 (the release that added `override`; `Self` landed in 4.0.0). deptry (already a dev dependency) flags this as DEP004 at every import site. Regenerate uv.lock accordingly. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com> --- pyproject.toml | 3 ++- uv.lock | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 76c8526712..493c25baa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,8 @@ dependencies = [ "tenacity>=8.2.3", "pyroaring>=1.0.0", "cachetools>=5.5", - "zstandard>=0.13.0" + "zstandard>=0.13.0", + "typing-extensions>=4.4.0,<5.0.0", ] [project.urls] diff --git a/uv.lock b/uv.lock index 0aea046671..b519843709 100644 --- a/uv.lock +++ b/uv.lock @@ -1408,7 +1408,7 @@ name = "exceptiongroup" version = "1.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -4901,6 +4901,7 @@ dependencies = [ { name = "rich" }, { name = "strictyaml" }, { name = "tenacity" }, + { name = "typing-extensions" }, { name = "zstandard" }, ] @@ -5078,6 +5079,7 @@ requires-dist = [ { name = "thrift", marker = "extra == 'hive'", specifier = ">=0.13.0" }, { name = "thrift", marker = "extra == 'hive-kerberos'", specifier = ">=0.13.0" }, { name = "thrift-sasl", marker = "extra == 'hive-kerberos'", specifier = ">=0.4.3" }, + { name = "typing-extensions", specifier = ">=4.4.0,<5.0.0" }, { name = "zstandard", specifier = ">=0.13.0" }, ] provides-extras = ["pyarrow", "pandas", "duckdb", "ray", "bodo", "daft", "polars", "snappy", "hive", "hive-kerberos", "s3fs", "glue", "adlfs", "dynamodb", "bigquery", "sql-postgres", "sql-sqlite", "gcsfs", "rest-sigv4", "hf", "pyiceberg-core", "datafusion", "gcp-auth", "entra-auth", "geoarrow"]