LLNL / uberenv

Automates using spack to build and deploy software
Other
25 stars 9 forks source link

python3.12 dropping distutils #129

Open cyrush opened 9 months ago

cyrush commented 9 months ago

distutils is dropped in python 3.12

We are using:

from distutils.version import LooseVersion

And we have a one liner that is using LooseVersion

    # Returns version of Spack being used
    def spack_version(self):
        res, out = sexe('{0} --version'.format(self.spack_exe(use_spack_env=False)), ret_output=True)
        return LooseVersion(out[:-1])

It seems many folks are replacing LooseVersion with packaging.Version, however packaging is an add on module that does not ship standard with python.

uberenv can't require any extra modules.

spack_version() is only used to display info to the user, we should drop using LooseVersion