Skip to content

python3.12 dropping distutils  #129

@cyrush

Description

@cyrush

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions