Skip to content

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Oct 3, 2025

Before this patch, LNT would use the pkg_resources package to extract metadata about the current installation. However, that package has been deprecated in recent Python versions, which produces a warning. Fixing this either requires switching to the recommended alternative, or pinning the setuptools dependency to a version < 81.

This patch switches to the recommended alternative (importlib.metadata) and bumps the Python requirement to 3.8, which is when importlib.metadata was introduced.

This version bump is fairly gentle and makes us match the Python requirement used by the rest of LLVM (which is IMO overdue for a bump as well), so I think it's reasonable.

Before this patch, LNT would use the pkg_resources package to extract
metadata about the current installation. However, that package has been
deprecated in recent Python versions, which produces a warning. Fixing
this either requires switching to the recommended alternative, or
pinning the setuptools dependency to a version < 81.

This patch switches to the recommended alternative (importlib.metadata)
and bumps the Python requirement to 3.8, which is when importlib.metadata
was introduced.

This version bump is fairly gentle and makes us match the Python
requirement used by the rest of LLVM (which is IMO overdue for a
bump as well), so I think it's reasonable.
@ldionne
Copy link
Member Author

ldionne commented Oct 3, 2025

Note that the reason I started looking into this issue is that the tox tests that use FileCheck are failing due to the warning message that gets emitted when we use the deprecated pkg_resources package. Also, it's just generally annoying to have a warning message when using the tool.

@ldionne ldionne merged commit 1bdfa48 into llvm:main Oct 3, 2025
2 checks passed
@ldionne ldionne deleted the review/use-importlib-metadata branch October 3, 2025 15:08
lukel97 added a commit that referenced this pull request Oct 6, 2025
To help get the ball rolling with deploying LNT, this adds a GitHub action to build and push images to the GitHub container registry, which is free for public repos. This will push a new image to ghcr.io/llvm-project/llvm-lnt:latest whenever anything is pushed to the main branch.

It also includes a fix for the Dockerfile after the minimum python version was bumped to 3.8 in #48. 3.10 is as high as we can go before we need to upgrade psycopg to 3.x, which in turn requires upgrading sqlalchemy to god knows what. We also need to upgrade psycopg 2.x anyway to get it to build with the newer python bindings.
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.

2 participants