osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
318 stars 65 forks source link

Don't use deprecated distutils #226

Closed sebastic closed 1 year ago

sebastic commented 1 year ago

setup.py still uses the deprecated distutils (for LooseVersion) which will be removed in Python 3.12.

From What’s New In Python 3.10:

The entire distutils package is deprecated, to be removed in Python 3.12. Its functionality for specifying package builds has already been completely replaced by third-party packages setuptools and packaging, and most other commonly used APIs are available elsewhere in the standard library (such as platform, shutil, subprocess or sysconfig). There are no plans to migrate any other functionality from distutils, and applications that are using other functions should plan to make private copies of the code. Refer to PEP 632 for discussion.

packaging.version seems like a good alternative for the version comparison.

Because setup_requires is deprecated, PEP 517 (pyproject.toml) is used for the build time dependencies.

lonvia commented 1 year ago

Thanks.

We probably should be moving fully to pyproject.toml. Something for the next version, unless it is a blocker for Debian packaging.

sebastic commented 1 year ago

It took a while to get setuptools >= 61 into Debian, but we have 65.6.3 in bookworm now.

With the upcoming freeze in preparation for the bookworm stable release there should be no problem for future releases to be backported to it.