Skip to content

Commit 4bf959f

Browse files
authored
bug: fix distutils LooseVersion import (#680)
* bug: fix distutils LooseVersion import * ci: ubuntu 24.04 does not allow unshare Problem: distutils was removed python 3.12 Solution: import from packaging Signed-off-by: vsoch <[email protected]>
1 parent cd2630e commit 4bf959f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+74
-116
lines changed

.github/workflows/test.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ jobs:
1313
container_tech: [podman, singularity, docker]
1414
steps:
1515
- name: Install Dependencies
16+
run: sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev tcsh
17+
18+
# https://github.com/actions/runner-images/issues/10443
19+
- name: Update Unshare Permission
20+
if: ${{ matrix.container_tech == 'singularity' }}
1621
run: |
17-
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev tcsh
22+
cat /etc/subuid
23+
echo $(whoami)
24+
cp /etc/sysctl.conf ./sysctl.conf
25+
echo "kernel.unprivileged_userns_clone=1" >> ./sysctl.conf
26+
sudo mv ./sysctl.conf /etc/sysctl.conf
27+
sudo sysctl -p
1828
1929
- name: Install Environment Modules
2030
if: ${{ matrix.module[0] == 'tcl' }}
@@ -40,11 +50,12 @@ jobs:
4050
cd Lmod-${PKG_VERSION}
4151
./configure --prefix=/usr/share && make && make install
4252
43-
- uses: eWaterCycle/setup-singularity@v7
53+
- name: Install Singularity
4454
if: ${{ matrix.container_tech == 'singularity' }}
45-
name: Install Singularity
55+
uses: singularityhub/install-singularity@main
4656
with:
47-
singularity-version: 3.7.1
57+
singularity-version: '4.2.2'
58+
go-version: '1.22.0'
4859

4960
- name: Create conda environment
5061
run: conda create --quiet -c conda-forge --name shpc spython

CHANGELOG.md

+1

shpc/client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22

33
__author__ = "Vanessa Sochat"
4-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
4+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
55
__license__ = "MPL 2.0"
66

77
import argparse

shpc/client/add.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import sys

shpc/client/docgen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/get.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/inspect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/client/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/listing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/client/namespace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/client/pull.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import re

shpc/client/remove.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/shell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/show.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/sync.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/client/test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/uninstall.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/update.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import shpc.utils

shpc/client/view.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2023-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2023-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/defaults.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/logger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import inspect

shpc/main/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/docker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/podman.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/singularity.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/container/update/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
from shpc.logger import logger

shpc/main/container/update/diff.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import difflib

shpc/main/container/update/docker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import re

shpc/main/container/update/versions.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import re
6-
from distutils.version import LooseVersion
6+
7+
try:
8+
from distutils.version import LooseVersion
9+
except ModuleNotFoundError:
10+
from packaging.version import Version as LooseVersion
711

812

913
def not_all_letters(version):

shpc/main/modules/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import inspect

shpc/main/modules/lmod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
from .base import ModuleBase

shpc/main/modules/module.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/main/modules/tcl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
from .base import ModuleBase

shpc/main/modules/template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/modules/versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/main/modules/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/main/registry/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/registry/filesystem.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/registry/provider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/registry/remote.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/schemas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/templates.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import re

shpc/main/wrappers/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55

shpc/main/wrappers/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

shpc/main/wrappers/generators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Vanessa Sochat"
2-
__copyright__ = "Copyright 2021-2024, Vanessa Sochat"
2+
__copyright__ = "Copyright 2021-2025, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

55
import os

0 commit comments

Comments
 (0)