DEPS/CLN: remove distutils usage
- [x] close #41199

hmm didn't realize `packaging` is a thing.

cc @pandas-dev/pandas-core any comments. As mentioned on the issue, we can also vendor the part of the code of `packaging` that we need (https://github.com/pandas-dev/pandas/issues/41199#issuecomment-830063572) Why not wait?  Python 3.12 is a long way off, and there maybe an official equivalent of LooseVersion in the standard library by then. > Why not wait? Python 3.12 is a long way off, and there maybe an official equivalent of LooseVersion in the standard library by then.

deprecation warnings!

i don't think vendoring would be very hard (and this is in general a nice cleaning anyhow) > deprecation warnings!

Could just import it once in a compat module and catch the deprecation warning.  I don't think waiting (and add warning catching as workaround for now) would help much. We will have to otherwise do it in 2 years anyway, and they don't plan to add an alternative to the stdlib. 

For reference, this is the PR that vendored it in pyarrow: https://github.com/apache/arrow/pull/9849/files#diff-01d967ca0c7171567d28b14f96289b349089dcab833c61a83d88f3fb72303591 yeah +1 on vendoring.  If they really aren't going to provide a simple mechanism to handle versioning OOB, then vendoring is the next best.  Still total PITA. > If they really aren't going to provide a simple mechanism to handle versioning OOB, then vendoring is the next best. Still total PITA.

for sure! but this is *slightly* better than existing looks good. can you rebase after https://github.com/pandas-dev/pandas/pull/41327 is merged and ping on green. @fangchenli #41327 now merged thanks @fangchenli very nice!