From ac881090e582c07ef38968591466fc527e13c115 Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 3 Oct 2024 16:27:23 +0200 Subject: [PATCH] remove reference to pkg_resource which is deprecated in python 3.12 --- scripts/auto_firmware_version.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/auto_firmware_version.py b/scripts/auto_firmware_version.py index 75bf7379a..1a69c8dc9 100644 --- a/scripts/auto_firmware_version.py +++ b/scripts/auto_firmware_version.py @@ -2,16 +2,14 @@ # # Copyright (C) 2022 Thomas Basler and others # -import pkg_resources Import("env") -required_pkgs = {'dulwich'} -installed_pkgs = {pkg.key for pkg in pkg_resources.working_set} -missing_pkgs = required_pkgs - installed_pkgs - -if missing_pkgs: +try: + from dulwich import porcelain +except ModuleNotFoundError: env.Execute('"$PYTHONEXE" -m pip install dulwich') + from dulwich import porcelain from dulwich import porcelain