Skip to content

LITE-34447: Drop spurious importlib-metadata dependency#85

Open
pcaro wants to merge 1 commit into
masterfrom
cr/LITE-34447-drop-importlib-metadata
Open

LITE-34447: Drop spurious importlib-metadata dependency#85
pcaro wants to merge 1 commit into
masterfrom
cr/LITE-34447-drop-importlib-metadata

Conversation

@pcaro

@pcaro pcaro commented Jun 26, 2026

Copy link
Copy Markdown

Summary

importlib-metadata was declared as a direct dependency (^6.6) solely as a fallback for the stdlib importlib.metadata import in connect/client/version.py.

Since the project requires Python >=3.9 and importlib.metadata has been in the standard library since 3.8, the except branch never executed and the <7 ceiling imposed by the caret (^6.6>=6.6,<7) was entirely artificial.

Changes

  • Remove importlib-metadata = "^6.6" from pyproject.toml.
  • Remove the try/except fallback in connect/client/version.py; import directly from importlib.metadata.
  • Re-lock poetry.lock.

Notes

  • The library has no runtime dependency on importlib-metadata, neither direct nor transitive. It only remains in the lock at 6.11.0 as a transitive dependency of the docs toolchain (mkdocs / mkdocstrings, python_version < "3.10"), which lives in the dev-only [tool.poetry.group.docs.dependencies] group and never ships to consumers of the package.
  • requirements/docs.txt is therefore unchanged: it is the Read the Docs build environment, where the mkdocs toolchain legitimately keeps pulling it in.
  • The poetry.lock diff also reflects a lock-version 2.0 → 2.1 reformat from the local Poetry 2.4.1; CI installs Poetry unpinned, so it's compatible.

Verification

  • pytest tests/client/test_version.py → 2 passed
  • flake8 connect/client/version.py → clean

importlib-metadata was declared as a direct dependency (^6.6) solely as a
fallback for the stdlib importlib.metadata import in connect/client/version.py.

Since the project requires Python >=3.9 and importlib.metadata has been in the
standard library since 3.8, the except branch never executed and the <7 ceiling
imposed by the caret was entirely artificial.

Remove the dependency from pyproject.toml and the try/except fallback in
version.py (now importing directly from importlib.metadata). importlib-metadata
remains in the lock at 6.11.0 as a transitive dependency of mkdocs (python<3.10),
so requirements/docs.txt is unaffected.

LITE-34447
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@pcaro pcaro marked this pull request as draft June 26, 2026 10:32
@pcaro pcaro marked this pull request as ready for review June 26, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants