dataclass-csv
dataclass-csv copied to clipboard
DeprecationWarning for distutils package
It seems that distutils will be soon be obsolete.
/usr/local/lib/python3.10/site-packages/dataclass_csv/dataclass_reader.py:5
/usr/local/lib/python3.10/site-packages/dataclass_csv/dataclass_reader.py:5: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.util import strtobool
Hi Walter!
Oh, good catch! Thank you so much for letting me know. 👍🏼
I will fix that. 👷🏼
Python 3.12 has been out for a few months, I tried to use the dataclass-csv package and I'm getting this error:
...lib/python3.12/site-packages/dataclass_csv/dataclass_reader.py", line 5, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'
The dataclass I am using for this doesn't even have any bool attributes, just some Optional[str] and mostly just str.
For what it's worth, adding a dependency on setuptools in my package works around the problem (since setuptools implements most or all of distutils, and patches sys.modules so that distutils references go to setuptools.