pytroll / aggdraw

Python package wrapping AGG2 drawing functionality
https://aggdraw.readthedocs.io/en/latest/
Other
99 stars 47 forks source link

Don't use deprecated distutils module. #87

Closed sebastic closed 1 year ago

sebastic commented 1 year ago

setup.py still uses the deprecated distutils 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.

Porting from Distutils has no suggestions for distutils.sysconfig, but sysconfig is a good alternative. It does suggest using packaging.version instead of distutils.version.

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

djhoese commented 1 year ago

I'll need to backport this to the maintenance branch for the current aggdraw releases (some day I will get main released when things make more sense with it). I'll try to find time to merge and release this tomorrow.