banesullivan / scooby

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

Use distutils instead of meets_version #53

Closed akaszynski closed 2 years ago

akaszynski commented 4 years ago

Saw a snippet of code in pyvista today and figured it would be better to use distutils rather than reinventing the wheel:

>>> from distutils.version import LooseVersion
>>> LooseVersion('2.3.0b') > LooseVersion('2.2.0b')
True

This probably captures other edge cases (like LooseVersion('2.3.4.3.1')) that we would have to write from scratch.

@banesullivan, think it's ok to push a warning that we're going to remove the feature, or should we just use LooseVersion under the hood? Guess it sorta simplifies other people's code to use meets_version instead (if only just slightly).

banesullivan commented 2 years ago

or should we just use LooseVersion under the hood?

I’m in favor of using LooseVersion under the hood here rather than removing a feature

banesullivan commented 2 years ago

https://docs.python.org/3/library/distutils.html

distutils is deprecated with removal planned for Python 3.12. See the What’s New entry for more information.

akaszynski commented 2 years ago

Closing since we're avoiding the use of distutils.