photon-os-installer: fix pkg_resources deprecation#1642
Open
dcasota wants to merge 1 commit intovmware:5.0from
Open
photon-os-installer: fix pkg_resources deprecation#1642dcasota wants to merge 1 commit intovmware:5.0from
dcasota wants to merge 1 commit intovmware:5.0from
Conversation
Replace deprecated pkg_resources with importlib.metadata in photon_installer/__init__.py via patch. This prevents breakage when setuptools removes pkg_resources in a future release. The btrfs-progs auto-install is already in the upstream source tarball, so no tarball SHA change is needed. Change-Id: Ibebe410a4ea70269b77c6e43ab9167ff6772b2c4 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
611ed25 to
cf5d1d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The photon-os-installer v2.7 source tarball uses
pkg_resources(from setuptools) to resolve its own version inphoton_installer/__init__.py.pkg_resourcesis deprecated in setuptools 67.5+ and will be removed in a future release. On Photon OS 5.0 (subrelease >= 92) with Python 3.14 and setuptools 80.x,pkg_resourcesis still shipped but triggers deprecation warnings and is on the removal path.Fix
Patch:
fix-pkg-resources.patch(Patch1, Release 2.7-6):import pkg_resources/pkg_resources.get_distribution(__name__).versionwithfrom importlib.metadata import version/version(__name__), matching the approach already used in upstream master.The patch applies to the existing source tarball via
%autosetup -p1. No source tarball SHA change is needed.Testing
Tested on Photon 5.0 (pinned subrelease 91 and normal) and Photon 6.0, on VMware Workstation (UEFI, TPM 2.0, VM encryption).