diff --git a/NEWS.md b/NEWS.md index 192e2684..853edc84 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ PENDING: Gaupol 1.14 * Change the icon for the toggle video player toolbar item to an action icon (not mimetype) that has a symbolic version available +* Fix installation on Python >= 3.12 by using distutils from setuptools 2023-10-08: Gaupol 1.13 ======================= diff --git a/setup.py b/setup.py index e4df603e..b09a05ed 100755 --- a/setup.py +++ b/setup.py @@ -30,14 +30,24 @@ extensions are not compiled either. """ -import distutils import glob +import logging import os import re import shutil import sys -from distutils import log +logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") +log = logging.getLogger(__name__) +log.setLevel(logging.INFO) + +try: + import distutils +except ImportError: + # Use distutils from setuptools, needed since Python 3.12. + # https://docs.python.org/3/whatsnew/3.12.html#distutils + import setuptools._distutils as distutils + from distutils.command.clean import clean from distutils.command.install import install from distutils.command.install_data import install_data