scikit-learn-contrib / scikit-learn-extra

scikit-learn contrib estimators
https://scikit-learn-extra.readthedocs.io
BSD 3-Clause "New" or "Revised" License
185 stars 42 forks source link

PEP632: Remove depracted call of distutils.version.LooseVersion #141

Open braniii opened 2 years ago

braniii commented 2 years ago

Hello,

I am sorry for the short PR yesterday, but I got interrupted. So my concern is that import scikit-learn-extra in a pytest environment leads to raising warnings. I need to admit, that I am not able to reproduce a minimal working example.

I would suggest to remove the depracted call of distutils.version.LooseVersion with packaging.version.Version. The reason is that starting from Python 3.12 the distutils package will be removed, see PEP634. In the packaging module there is no LooseVersion, but regarding the strict versioning of sklearn and numpy this should make no difference.

PS: I've just notice that it is checked against version below the INSTALL_REQUIRES. So it should be save deleting these checks completely. https://github.com/scikit-learn-contrib/scikit-learn-extra/blob/cb70ef0f3a8cbff324c06b3f4e931f8ee148c739/setup.py#L24

braniii commented 8 months ago

Python 3.12 support has been added to scikit-learn, see scikit-learn/scikit-learn#27027. So this would be the first step towards supporting py3.12 with the latest sklearn 1.3