banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

distutils deprecated in python 3.10 #79

Closed GuillaumeFavelier closed 2 years ago

GuillaumeFavelier commented 2 years ago

I know this is early but on python 3.10, I notice the following:

/opt/hostedtoolcache/Python/3.10.2/x64/lib/python3.10/site-packages/scooby/__init__.py:18: in <module>
    from scooby.knowledge import (  # noqa
/opt/hostedtoolcache/Python/3.10.2/x64/lib/python3.10/site-packages/scooby/knowledge.py:14: in <module>
    import distutils.sysconfig as sysconfig
/opt/hostedtoolcache/Python/3.10.2/x64/lib/python3.10/distutils/__init__.py:19: in <module>
    warnings.warn(_DEPRECATION_MESSAGE,
E   DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

Related to https://github.com/pyvista/pyvistaqt/pull/147

banesullivan commented 2 years ago

Also relevant to #53

I'll see if I can update this

prisae commented 2 years ago

That is great. I don't know how to achieve it, but replacing distutils would also drastically improve load time. Currently scooby becomes a burden in some of my projects with a CLI, as it sort of takes too long to load for that it should be a lightweight utility.

Here the output of

python -Ximporttime -c "import scooby" 2> scooby.log
tuna scooby.log

2022-07-21-01

So scooby took roughly 0.3s to load, and over 80% were due to distutils.

banesullivan commented 2 years ago

Yeah.... that's a bit ridiculous. I'll see if I can push forward on this