From 6ef967a0f930ce37a8c9b5aff969693b34714291 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 1 Dec 2023 09:53:50 -0600 Subject: [PATCH] Switch from the deprecated distutils module to the packaging module The distutils module was removed in Python 3.12. --- .gitlab-ci.yml | 7 ++++--- .gitlab-ci/debian-stable.Dockerfile | 1 + .gitlab-ci/fedora.Dockerfile | 1 + .gitlab-ci/mingw.Dockerfile | 2 +- gio/gdbus-2.0/codegen/utils.py | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0415eefc..e2c4dd54f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,11 +11,11 @@ cache: - _ccache/ variables: - FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v23" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v24" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" - DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v17" + DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v18" ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v0" - MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v13" + MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v14" MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" @@ -607,6 +607,7 @@ macos-x86_64: - source .venv/bin/activate - pip3 install meson==1.2.3 - pip3 install ninja==1.11.1 + - pip3 install packaging==23.2 script: # FIXME: Use --wrap-mode=default so we download dependencies each time, # until the macOS runner is a VM where we can use a pre-made image which diff --git a/.gitlab-ci/debian-stable.Dockerfile b/.gitlab-ci/debian-stable.Dockerfile index 027829bd3..a3b695073 100644 --- a/.gitlab-ci/debian-stable.Dockerfile +++ b/.gitlab-ci/debian-stable.Dockerfile @@ -35,6 +35,7 @@ RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \ locales \ ninja-build \ python3 \ + python3-packaging \ python3-pip \ python3-setuptools \ python3-wheel \ diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index 057db215f..9ca80f2d5 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -47,6 +47,7 @@ RUN dnf -y update \ ninja-build \ pcre2-devel \ "python3-dbusmock >= 0.18.3-2" \ + python3-packaging \ python3-pip \ python3-pygments \ python3-wheel \ diff --git a/.gitlab-ci/mingw.Dockerfile b/.gitlab-ci/mingw.Dockerfile index f95171836..712b23abe 100644 --- a/.gitlab-ci/mingw.Dockerfile +++ b/.gitlab-ci/mingw.Dockerfile @@ -1,4 +1,4 @@ -FROM registry.gitlab.gnome.org/gnome/glib/fedora:v23 +FROM registry.gitlab.gnome.org/gnome/glib/fedora:v24 USER root diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py index 02046108d..08f1ba973 100644 --- a/gio/gdbus-2.0/codegen/utils.py +++ b/gio/gdbus-2.0/codegen/utils.py @@ -19,7 +19,7 @@ # # Author: David Zeuthen -import distutils.version +import packaging.version import os import sys @@ -166,4 +166,4 @@ def version_cmp_key(key): v = str(key[0]) else: v = "0" - return (distutils.version.LooseVersion(v), key[1]) + return (packaging.version.Version(v), key[1])