See PEP 632 for more information on the deprecation.
Expected behavior
Importing natsort does not trigger a DeprecationWarning.
Environment (please complete the following information):
Python Version: Python 3.10 alpha 7
OS Ubuntu
If the bug involves LOCALE or humansorted: N/A
To Reproducepython3.10 -Werror -c "import natsort"
Traceback
```python traceback
Traceback (most recent call last):
File "", line 1, in
File "venv/lib/python3.10/site-packages/natsort/__init__.py", line 3, in
from natsort.natsort import (
File "venv/lib/python3.10/site-packages/natsort/natsort.py", line 14, in
from natsort import utils
File "venv/lib/python3.10/site-packages/natsort/utils.py", line 49, in
from natsort.compat.fastnumbers import fast_float, fast_int
File "venv/lib/python3.10/site-packages/natsort/compat/fastnumbers.py", line 7, in
from distutils.version import StrictVersion
File "/usr/lib/python3.10/distutils/__init__.py", line 16, in
warnings.warn("The distutils package is deprecated and slated for "
DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
```
Describe the bug In Python 3.10 (due to release in October 2021) the
distutils
module is deprecated and is scheduled for removal in Python 3.12natsort
usesdistutils.version.StrictVersion
to determine whether the version offastnumbers
is appropriate:https://github.com/SethMMorton/natsort/blob/4e47f82856822ac776b4874747852b99edb79d9e/natsort/compat/fastnumbers.py#L7
https://github.com/SethMMorton/natsort/blob/4e47f82856822ac776b4874747852b99edb79d9e/natsort/compat/fastnumbers.py#L16
See PEP 632 for more information on the deprecation.
Expected behavior Importing
natsort
does not trigger aDeprecationWarning
.Environment (please complete the following information):
LOCALE
orhumansorted
: N/ATo Reproduce
python3.10 -Werror -c "import natsort"
Traceback
```python traceback Traceback (most recent call last): File "