Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpsd-software-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPSD Computational Science
mpsd-software-manager
Commits
1ad2c947
Commit
1ad2c947
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
update argparse to aloow init to work without release argument
parent
5015c533
No related branches found
No related tags found
1 merge request
!83
Create init command
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
23b/spack-environments
+1
-0
1 addition, 0 deletions
23b/spack-environments
src/mpsd_software_manager/mpsd_software.py
+25
-20
25 additions, 20 deletions
src/mpsd_software_manager/mpsd_software.py
with
26 additions
and
20 deletions
spack-environments
@
91ba21f4
Subproject commit 91ba21f40ff9e635da15a4c154360f5e969d6fe4
This diff is collapsed.
Click to expand it.
src/mpsd_software_manager/mpsd_software.py
+
25
−
20
View file @
1ad2c947
...
...
@@ -1098,8 +1098,9 @@ def initialize_environment(root_dir: Path) -> None:
# check if the root_dir is not already initialized
init_file
=
root_dir
/
config_vars
[
"
init_file
"
]
if
init_file
.
exists
():
logging
.
error
(
f
"
Directory
{
str
(
root_dir
)
}
is already initialized as a software root.
"
# warn using the print logger as the release dir may not yet prepared
logging
.
getLogger
(
"
print
"
).
warning
(
f
"
Error: Directory
{
str
(
root_dir
)
}
is already initialized.
"
)
sys
.
exit
(
1
)
else
:
...
...
@@ -1130,9 +1131,8 @@ def main():
)
subparsers
.
required
=
True
list_of_cmds
=
[
(
"
init
"
,
"
Initialize the software stack in the current directory
"
)(
"
available
"
,
"
What is available for installation?
"
),
(
"
init
"
,
"
Initialize the software stack in the current directory
"
),
(
"
available
"
,
"
What is available for installation?
"
),
(
"
install
"
,
"
Install a software environment
"
),
# ("reinstall", "Reinstall a package_set"),
# ("remove", "Remove a package set"),
...
...
@@ -1160,11 +1160,13 @@ def main():
)
else
:
subp
.
add_argument
(
"
release
"
,
type
=
str
,
help
=
"
Release version to prepare, install, reinstall or remove
"
,
)
# all commands except init need a release version
if
cmd
!=
"
init
"
:
subp
.
add_argument
(
"
release
"
,
type
=
str
,
help
=
"
Release version to prepare, install, reinstall or remove
"
,
)
if
cmd
in
[
"
install
"
,
"
reinstall
"
,
"
remove
"
]:
# "install" command needs additional documentation
package_set_help
=
(
...
...
@@ -1194,18 +1196,21 @@ def main():
# root dir is the place where this script is called from
root_dir
=
Path
(
os
.
getcwd
())
set_up_logging
(
args
.
loglevel
,
get_installer_log_file_path
(
args
.
release
,
args
.
action
,
root_dir
),
)
# set up logging for all actions except init
if
args
.
action
!=
"
init
"
:
set_up_logging
(
args
.
loglevel
,
get_installer_log_file_path
(
args
.
release
,
args
.
action
,
root_dir
),
)
# sanity check for common mistakes in command line arguments
if
args
.
release
.
endswith
(
"
/
"
):
# happens easily with autocompletion
logging
.
error
(
f
"
You provided mpsd-release=
'
{
args
.
release
}
'
.
"
f
"
Did you mean
'
{
args
.
release
.
removesuffix
(
'
/
'
)
}
'
?
"
)
sys
.
exit
(
1
)
if
args
.
action
!=
"
init
"
:
if
args
.
release
.
endswith
(
"
/
"
):
# happens easily with autocompletion
logging
.
error
(
f
"
You provided mpsd-release=
'
{
args
.
release
}
'
.
"
f
"
Did you mean
'
{
args
.
release
.
removesuffix
(
'
/
'
)
}
'
?
"
)
sys
.
exit
(
1
)
# Check the command and run related function
if
args
.
action
==
"
init
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment