8000 python 3.12 dropped distutils, need a replacement for `LooseVersion` · Issue #570 · geopy/geopy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
python 3.12 dropped distutils, need a replacement for LooseVersion #570
Open
@panlinux

Description

@panlinux

Hi,

python 3.12 no longer has the distutils module, and it's currently being used in test/test_init.py in test_version_info().

I suggest a simple naive replacement using packaging.version :

--- a/test/test_init.py
+++ b/test/test_init.py
@@ -1,4 +1,4 @@
-from distutils.version import LooseVersion
+from packaging.version import Version
 
 from geopy import __version__, __version_info__, get_version
 
@@ -8,7 +8,7 @@
 
 
 def test_version_info():
-    expected_version_info = tuple(LooseVersion(__version__).version)
+    expected_version_info = Version(__version__).release
     assert expected_version_info == __version_info__

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

      0