Skip to content

python 3.12 dropped distutils, test needs replacement #229

Description

@panlinux

Hi,

python 3.12 dropped distutils, and there is a test in python-sparkpost using distutils.version.StrictVersion.

I suggest this simple replacement:

--- a/test/django/utils.py
+++ b/test/django/utils.py
@@ -1,7 +1,7 @@
-from distutils.version import StrictVersion
+from packaging.version import Version
 
 from django import get_version
 
 
 def at_least_version(version):
-    return StrictVersion(get_version()) > StrictVersion(version)
+    return Version(get_version()) > Version(version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions