Skip to content

Commit 4bda20d

Browse files
authored
Miscellaneous changes (#516)
* Should this not be a warning ? * `self._cleanup(module_dir)` should be called in both cases. Refactored the code, so that cleanup is only implemented once * Only ignore these in the root directory * duplicated * version bump
1 parent c9eca19 commit 4bda20d

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ shpc.db
44
singularity_hpc.egg-info/
55
env
66
.env
7-
env
87
build
98
docs/_build
109
release
@@ -15,6 +14,6 @@ __pycache__
1514
*.simg
1615
*.sif
1716
*.img
18-
.eggs
19-
symlinks
20-
modules
17+
/.eggs
18+
/symlinks
19+
/modules

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.com/singularityhub/singularity-hpc/tree/main) (0.0.x)
17+
- Properly cleanup empty module directories, and asking to remove a container that doesn't exist now logs a _warning_ (0.0.48)
1718
- wrapper script generation permissions error (0.0.47)
1819
- fixing but with stream command repeating output (0.0.46)
1920
- Adding support for wrapper scripts for global and container.yaml (0.0.45)

shpc/main/modules/__init__.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,15 @@ def _uninstall(self, module_dir, name, force=False):
104104
"""
105105
Sub function, so we can pass more than one folder from uninstall
106106
"""
107-
if os.path.exists(module_dir) and not force:
108-
msg = "%s, and all content below it? " % name
109-
if utils.confirm_uninstall(msg, force):
110-
self._cleanup(module_dir)
111-
logger.info("%s and all subdirectories been removed." % name)
112-
113-
elif os.path.exists(module_dir) and force:
114-
shutil.rmtree(module_dir)
107+
if os.path.exists(module_dir):
108+
if not force:
109+
msg = "%s, and all content below it? " % name
110+
if not utils.confirm_uninstall(msg, force):
111+
return
112+
self._cleanup(module_dir)
115113
logger.info("%s and all subdirectories have been removed." % name)
116114
else:
117-
logger.info("%s does not exist." % name)
115+
logger.warning("%s does not exist." % name)
118116

119117
def _test_setup(self, tmpdir):
120118
"""

shpc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021-2022, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.0.47"
5+
__version__ = "0.0.48"
66
AUTHOR = "Vanessa Sochat"
77
NAME = "singularity-hpc"
88
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"

0 commit comments

Comments
 (0)