dataclass-csv icon indicating copy to clipboard operation
dataclass-csv copied to clipboard

DeprecationWarning for distutils package

Open woidda opened this issue 4 years ago • 5 comments

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

woidda avatar Mar 22 '22 14:03 woidda

Hi Walter!

Oh, good catch! Thank you so much for letting me know. 👍🏼

I will fix that. 👷🏼

dfurtado avatar Mar 22 '22 16:03 dfurtado

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.

dupuyarc avatar Apr 25 '24 21:04 dupuyarc

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.

dupuyarc avatar Apr 25 '24 21:04 dupuyarc