Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions SPECS/photon-os-installer/fix-pkg-resources.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Factory AI Bot <factory-droid[bot]@users.noreply.github.com>
Date: Mon, 30 Mar 2026 20:00:00 +0200
Subject: [PATCH] Replace deprecated pkg_resources with importlib.metadata

Python 3.14 deprecates pkg_resources. Use importlib.metadata.version()
instead, matching the fix already present in upstream master.

---
photon_installer/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/photon_installer/__init__.py b/photon_installer/__init__.py
--- a/photon_installer/__init__.py
+++ b/photon_installer/__init__.py
@@ -5,7 +5,7 @@

import sys
import glob
-import pkg_resources
+from importlib.metadata import version as _get_version
from os.path import dirname, basename, isfile, join


@@ -13,4 +13,4 @@ modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
sys.path.append(dirname(__file__))

-__version__ = pkg_resources.get_distribution(__name__).version
+__version__ = _get_version(__name__)
5 changes: 4 additions & 1 deletion SPECS/photon-os-installer/photon-os-installer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Summary: Photon OS Installer
Name: photon-os-installer
Version: 2.7
Release: 5%{?dist}
Release: 6%{?dist}
Group: System Environment/Base
Vendor: VMware, Inc.
Distribution: Photon
Expand All @@ -16,6 +16,7 @@ Source1: license.txt
%include %{SOURCE1}

Patch0: 0001-Use-mkpasswd-to-generate-password-hash.patch
Patch1: fix-pkg-resources.patch

BuildRequires: python3-devel
BuildRequires: python3-pyinstaller
Expand Down Expand Up @@ -70,6 +71,8 @@ rm -rf %{buildroot}
%{_bindir}/photon-iso-builder

%changelog
* Mon Apr 13 2026 Factory AI Bot <factory-droid[bot]@users.noreply.github.com> 2.7-6
- Replace deprecated pkg_resources with importlib.metadata
* Tue Mar 24 2026 Shreenidhi Shedi <shreenidhi.shedi@broadcom.com> 2.7-5
- Use mkpasswd to generate password
* Wed Mar 18 2026 Prashant S Chauhan <prashant.singh-chauhan@broadcom.com> 2.7-4
Expand Down