From 21c2bc287808275eeb428cc3427c5ca62ae9ce47 Mon Sep 17 00:00:00 2001 From: Noah Pendleton <2538614+noahp@users.noreply.github.com> Date: Fri, 29 Aug 2025 11:47:46 -0400 Subject: [PATCH] fix: remove distutils for python >=3.12 Distutils was removed in python 3.12: https://docs.python.org/3/whatsnew/3.12.html#whatsnew312-removed-distutils Replace with `setuptools` embedded version. --- setup.cfg | 1 + src/elf_diff/auxiliary.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 038c3165..4ade8fc2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,6 +33,7 @@ package_dir = include_package_data = True install_requires = setuptools-git + setuptools jinja2 pyyaml progressbar2 diff --git a/src/elf_diff/auxiliary.py b/src/elf_diff/auxiliary.py index e7811ccc..f1e63a32 100644 --- a/src/elf_diff/auxiliary.py +++ b/src/elf_diff/auxiliary.py @@ -21,9 +21,10 @@ import inspect import os import re -from distutils import dir_util from typing import List, Set +from setuptools import distutils + def setIntersection(l1: Set, l2: Set) -> List: """Return a list that is a sorted set intersection of two sets""" @@ -62,7 +63,7 @@ def getRelpath(html_output_file: str, target_dir: str) -> str: def recursiveCopy(source_dir: str, target_dir: str) -> None: """Copy the content of a source directory recursively (including subdirectories) to a target directory""" - dir_util.copy_tree(source_dir, target_dir) + distutils.dir_util.copy_tree(source_dir, target_dir) def isNameToken(str_: str) -> bool: