forked from aiidalab/aiidalab-qe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor installation routines and allow to run them from the CLI. (a…
- Loading branch information
Showing
4 changed files
with
136 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import click | ||
|
||
from .setup_codes import codes_are_setup | ||
from .setup_codes import install as install_qe_codes | ||
from .sssp import install as setup_sssp | ||
|
||
|
||
@click.group() | ||
def cli(): | ||
pass | ||
|
||
|
||
@cli.command() | ||
@click.option("-f", "--force", is_flag=True) | ||
def install_qe(force): | ||
try: | ||
for msg in install_qe_codes(force=force): | ||
click.echo(msg) | ||
assert codes_are_setup() | ||
click.secho("Codes are setup!", fg="green") | ||
except Exception as error: | ||
raise click.ClickException(f"Failed to set up QE failed: {error}") | ||
|
||
|
||
@cli.command() | ||
def install_sssp(): | ||
try: | ||
for msg, _ in setup_sssp(): | ||
click.echo(msg) | ||
click.secho("SSSP pseudo potentials are installed!", fg="green") | ||
except Exception as error: | ||
raise click.ClickException(f"Failed to set up pseudo potentials: {error}") | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
echo "Starting installation of QE..." | ||
python -m aiidalab_qe install-qe & disown | ||
|
||
echo "Starting installation of pseudo-potentials..." | ||
python -m aiidalab_qe install-sssp & disown |