From 1b6d0383b4d50de2d127da26ea3da3fdc4fa5498 Mon Sep 17 00:00:00 2001 From: maugde Date: Fri, 3 May 2024 14:56:59 +0200 Subject: [PATCH] feat(command): install or upgrade application using CLI --- .gitignore | 6 + mkdocs.yml | 2 +- src/antares_web_installer/__init__.py | 1 + src/antares_web_installer/__main__.py | 3 +- src/antares_web_installer/cli.py | 57 +++++++++- .../config/config_2_15.py | 5 + src/antares_web_installer/installer.py | 107 ++++++++++++++++++ .../AntaresWeb}/AntaresWeb/AntaresTool.exe | 0 .../AntaresWeb/AntaresWeb/AntaresWebServer.py | 12 ++ .../AntaresWeb/AntaresWeb/__init__.py | 1 + .../antares_solver/antares-8.8-solver.exe | 0 .../AntaresWeb}/AntaresWebServerShortcut.lnk | 0 .../AntaresWeb}/AntaresWebWorker.exe | 0 .../nt/Program Files/AntaresWeb}/CHANGELOG.md | 0 .../nt/Program Files/AntaresWeb}/README.md | 0 .../nt/Program Files/AntaresWeb/__init__.py} | 0 .../AntaresWeb}/config.prod.yaml | 0 .../nt/Program Files/AntaresWeb}/config.yaml | 0 .../AntaresWeb}/examples/README.md | 0 .../examples/archives/.placeholder | 0 .../examples/internal_studies/.placeholder | 0 .../AntaresWeb}/examples/studies/.placeholder | 0 .../nt/Program Files/AntaresWeb}/gunicorn.py | 0 .../AntaresWeb}/logs/.placeholder | 0 .../AntaresWeb}/matrices/.placeholder | 0 .../nt/Program Files/AntaresWeb}/nginx.conf | 0 .../AntaresWeb}/tmp/.placeholder | 0 .../Program Files/AntaresWeb}/web.config.json | 0 .../opt/antares-web}/AntaresWeb/AntaresTool | 0 .../AntaresWeb/AntaresWebServer.py | 11 ++ .../opt/antares-web/AntaresWeb/__init__.py} | 0 .../antares_solver/antares-8.8-solver | 0 .../posix/opt/antares-web}/AntaresWebWorker | 0 .../posix/opt/antares-web}/CHANGELOG.md | 0 .../posix/opt/antares-web}/README.md | 0 .../posix/opt/antares-web/__init__.py} | 0 .../posix/opt/antares-web/config.prod.yaml} | 0 .../posix/opt/antares-web/config.yaml} | 0 .../posix/opt/antares-web/examples/README.md} | 0 .../examples/archives}/.placeholder | 0 .../examples/internal_studies}/.placeholder | 0 .../examples/studies}/.placeholder | 0 .../posix/opt/antares-web}/gunicorn.py | 0 .../posix/opt/antares-web/logs}/.placeholder | 0 .../opt/antares-web/matrices}/.placeholder | 0 .../posix/opt/antares-web}/nginx.conf | 0 .../posix/opt/antares-web/tmp/.placeholder} | 0 .../posix/opt/antares-web/web.config.json | 0 tests/test_about.py | 2 +- 49 files changed, 198 insertions(+), 9 deletions(-) create mode 100644 src/antares_web_installer/installer.py rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/AntaresWeb/AntaresTool.exe (100%) create mode 100644 tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresWebServer.py create mode 100644 tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/__init__.py rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/AntaresWeb/antares_solver/antares-8.8-solver.exe (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/AntaresWebServerShortcut.lnk (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/AntaresWebWorker.exe (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/CHANGELOG.md (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/README.md (100%) rename tests/samples/{nt/AntaresWeb/AntaresWebServer.exe => initial/nt/Program Files/AntaresWeb/__init__.py} (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/config.prod.yaml (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/config.yaml (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/examples/README.md (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/examples/archives/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/examples/internal_studies/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/examples/studies/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/gunicorn.py (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/logs/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/matrices/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/nginx.conf (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/tmp/.placeholder (100%) rename tests/samples/{nt => initial/nt/Program Files/AntaresWeb}/web.config.json (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/AntaresWeb/AntaresTool (100%) create mode 100644 tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresWebServer.py rename tests/samples/{posix/AntaresWeb/AntaresWebServer => initial/posix/opt/antares-web/AntaresWeb/__init__.py} (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/AntaresWeb/antares_solver/antares-8.8-solver (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/AntaresWebWorker (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/CHANGELOG.md (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/README.md (100%) rename tests/samples/{posix/config.prod.yaml => initial/posix/opt/antares-web/__init__.py} (100%) rename tests/samples/{posix/config.yaml => initial/posix/opt/antares-web/config.prod.yaml} (100%) rename tests/samples/{posix/examples/README.md => initial/posix/opt/antares-web/config.yaml} (100%) rename tests/samples/{posix/examples/archives/.placeholder => initial/posix/opt/antares-web/examples/README.md} (100%) rename tests/samples/{posix/examples/internal_studies => initial/posix/opt/antares-web/examples/archives}/.placeholder (100%) rename tests/samples/{posix/examples/studies => initial/posix/opt/antares-web/examples/internal_studies}/.placeholder (100%) rename tests/samples/{posix/logs => initial/posix/opt/antares-web/examples/studies}/.placeholder (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/gunicorn.py (100%) rename tests/samples/{posix/matrices => initial/posix/opt/antares-web/logs}/.placeholder (100%) rename tests/samples/{posix/tmp => initial/posix/opt/antares-web/matrices}/.placeholder (100%) rename tests/samples/{posix => initial/posix/opt/antares-web}/nginx.conf (100%) rename tests/samples/{posix/web.config.json => initial/posix/opt/antares-web/tmp/.placeholder} (100%) create mode 100644 tests/samples/initial/posix/opt/antares-web/web.config.json diff --git a/.gitignore b/.gitignore index 2dc53ca..9aa0b18 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,11 @@ coverage.xml .pytest_cache/ cover/ +# test data +tests/samples/results/nt!/Program Files/ +tests/samples/results/nt/Program Files/* +tests/samples/results/posix/opt/* + # Translations *.mo *.pot @@ -158,3 +163,4 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ + diff --git a/mkdocs.yml b/mkdocs.yml index df8bc6d..f38f93e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ docs_dir: docs site_name: Antares Web Installer Documentation repo_url: https://github.com/AntaresSimulatorTeam/antares-web-installer -edit_uri: edit/doc/docs/ +edit_uri: edit/docs/docs/ theme: name: mkdocs # material diff --git a/src/antares_web_installer/__init__.py b/src/antares_web_installer/__init__.py index e69de29..51c64dd 100644 --- a/src/antares_web_installer/__init__.py +++ b/src/antares_web_installer/__init__.py @@ -0,0 +1 @@ +DEBUG = True diff --git a/src/antares_web_installer/__main__.py b/src/antares_web_installer/__main__.py index 411d0ad..3e555da 100644 --- a/src/antares_web_installer/__main__.py +++ b/src/antares_web_installer/__main__.py @@ -2,8 +2,7 @@ Main entrypoint for the CLI application. """ import sys - -from antares_web_installer.cli import install_cli +from cli import install_cli def main(): diff --git a/src/antares_web_installer/cli.py b/src/antares_web_installer/cli.py index 5b645dc..141b54e 100644 --- a/src/antares_web_installer/cli.py +++ b/src/antares_web_installer/cli.py @@ -1,14 +1,61 @@ -import time - +import os import click +from antares_web_installer import DEBUG +from pathlib import Path +from installer import install + + +# SETTINGS WHEN DEBUGGING +if DEBUG: + BASE_DIR = Path().resolve().parent.parent + + SRC_DIR = "tests/samples/initial/" + TARGET_DIR = "tests/samples/results/" + if os.name.lower() == "posix": + suffix = "posix/opt/antares-web/" + else: + suffix = "nt/Program Files/AntaresWeb/" + TARGET_DIR += suffix + SRC_DIR += suffix + +# REAL SETTINGS +else: + if os.name.lower() == "posix": + TARGET_DIR = "/opt/antares-web/" + else: + TARGET_DIR = "C:/Program Files/AntaresWeb/" + + SRC_DIR = "" + + +@click.group() +def cli(): + pass @click.command() -@click.argument("target_dir", type=click.Path()) +@click.option("-t", "--target-dir", + default=TARGET_DIR, + show_default=True, + type=click.Path(), + help="where to install your application") def install_cli(target_dir): """ - Install Antares Web. + Install Antares Web at the right file locations. """ + target_dir = Path(target_dir) + src_dir = Path(SRC_DIR) + + if DEBUG: + target_dir = BASE_DIR.joinpath(Path(target_dir)) + src_dir = BASE_DIR.joinpath(Path(src_dir)) + target_dir = target_dir.expanduser() + + # TODO: check whether the server is running + # in case it is, stop it + print(f"Starting installation in directory: '{target_dir}'...") - time.sleep(1) + + install(src_dir, target_dir) + print("Installation complete!") diff --git a/src/antares_web_installer/config/config_2_15.py b/src/antares_web_installer/config/config_2_15.py index 21ff386..7b36fae 100644 --- a/src/antares_web_installer/config/config_2_15.py +++ b/src/antares_web_installer/config/config_2_15.py @@ -12,6 +12,11 @@ def update_to_2_15(config: t.MutableMapping[str, t.Any]) -> None: nb_cores_max = os.cpu_count() or nb_cores_min nb_cores_default = max(nb_cores_min, nb_cores_max - 2) + # WIP + if not config: + config = {} + # end of WIP + config.setdefault("launcher", {}) config["launcher"].setdefault("local", {}) config["launcher"].setdefault("slurm", {}) diff --git a/src/antares_web_installer/installer.py b/src/antares_web_installer/installer.py new file mode 100644 index 0000000..fd424aa --- /dev/null +++ b/src/antares_web_installer/installer.py @@ -0,0 +1,107 @@ +import subprocess +import textwrap +import os +from pathlib import Path +from antares_web_installer import DEBUG +from shutil import copytree, copy2, rmtree +from config import update_config + +# List of files and directories to exclude during installation +COMMON_EXCLUDED_FILES = {"config.prod.yaml", "config.yaml", "examples", "logs", "matrices", "tmp", } +POSIX_EXCLUDED_FILES = COMMON_EXCLUDED_FILES | {"AntaresWebWorker"} +WINDOWS_EXCLUDED_FILES = COMMON_EXCLUDED_FILES | {"AntaresWebWorker.exe"} +EXCLUDED_FILES = POSIX_EXCLUDED_FILES if os.name == "posix" else WINDOWS_EXCLUDED_FILES + + +class InstallError(Exception): + """ + Exception that handles installation error + """ + pass + + +def install(src_dir: Path, target_dir: Path) -> None: + """ + """ + # if "AntaresWeb/" directory already exists + if target_dir.joinpath("AntaresWeb").is_dir(): + # check app version + version = check_version(target_dir) + + # update config file + config_path = target_dir.joinpath("config.yaml") + update_config(config_path, config_path, version) + + # copy binaries + copy_files(src_dir, target_dir) + + else: + # copy all files from package + copytree(src_dir, target_dir) + + +def check_version(target_dir: Path) -> str: + """ + Execute command to get the current version of the server. + + :param target_dir: path of target directory + """ + # debug mode + if DEBUG: + exe_path = target_dir.joinpath("AntaresWeb/AntaresWebServer.py") + args = ["python", exe_path, "--version"] + else: + exe_path = target_dir.joinpath("AntaresWeb/AntaresWebServer.exe") + # check user's os + if os.name.lower() == "posix": # if os is linux, remove ".exe" + exe_path.with_suffix("") + args = [exe_path, "--version"] + + try: + version = subprocess.check_output(args, text=True, stderr=subprocess.PIPE).strip() + except FileNotFoundError as e: + raise InstallError(f"Can't check version: {e}") from e + except subprocess.CalledProcessError as e: + reason = textwrap.indent(e.stderr, " | ", predicate=lambda line: True) + raise InstallError(f"Can't check version: {reason}") + + return version + + +def copy_files(src_dir: Path, target_dir: Path): + """ + Copy all files from src_dir to target_dir + Override existing files and directories that have the same name + Raise an InstallError if an error occurs while overriding a directory, if the user hasn't the permission to write or + if target_dir already exists. + + :param src_dir: location of directory to copy files from + :param target_dir: location of directory to copy files to + """ + for elt_path in src_dir.iterdir(): + if elt_path.name not in EXCLUDED_FILES: + # verbose action + print(f"copy {elt_path.name} to {target_dir.name}") + + try: + if elt_path.is_file(): + copy2(elt_path, target_dir) + else: + # copytree() cannot natively override directory + # the target must be deleted first + rmtree(target_dir.joinpath(elt_path.name)) + + # check if the old directory is completely erased + if target_dir.joinpath(elt_path.name).exists(): + raise InstallError(f"Erreur : Impossible de mettre à jour le répertoire {elt_path}") + + # copy new directory + copytree(elt_path, target_dir.joinpath(elt_path.name)) + # handle permission errors + except PermissionError: + raise InstallError(f"Erreur : Impossible d'écrire dans {target_dir}") + # handle other errors + except BaseException as e: + raise InstallError(f"{e}") + else: + print(f"ignoring {elt_path.name}") diff --git a/tests/samples/nt/AntaresWeb/AntaresTool.exe b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresTool.exe similarity index 100% rename from tests/samples/nt/AntaresWeb/AntaresTool.exe rename to tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresTool.exe diff --git a/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresWebServer.py b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresWebServer.py new file mode 100644 index 0000000..3971a7b --- /dev/null +++ b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/AntaresWebServer.py @@ -0,0 +1,12 @@ +import click +import time + + +@click.version_option(version="2.15.0", message="%(version)s") +@click.group() +def cli(): + pass + + +if __name__ == "__main__": + cli() diff --git a/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/__init__.py b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/__init__.py new file mode 100644 index 0000000..8c0fe1b --- /dev/null +++ b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/__init__.py @@ -0,0 +1 @@ +__version__ = "2.14.4" diff --git a/tests/samples/nt/AntaresWeb/antares_solver/antares-8.8-solver.exe b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/antares_solver/antares-8.8-solver.exe similarity index 100% rename from tests/samples/nt/AntaresWeb/antares_solver/antares-8.8-solver.exe rename to tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWeb/antares_solver/antares-8.8-solver.exe diff --git a/tests/samples/nt/AntaresWebServerShortcut.lnk b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWebServerShortcut.lnk similarity index 100% rename from tests/samples/nt/AntaresWebServerShortcut.lnk rename to tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWebServerShortcut.lnk diff --git a/tests/samples/nt/AntaresWebWorker.exe b/tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWebWorker.exe similarity index 100% rename from tests/samples/nt/AntaresWebWorker.exe rename to tests/samples/initial/nt/Program Files/AntaresWeb/AntaresWebWorker.exe diff --git a/tests/samples/nt/CHANGELOG.md b/tests/samples/initial/nt/Program Files/AntaresWeb/CHANGELOG.md similarity index 100% rename from tests/samples/nt/CHANGELOG.md rename to tests/samples/initial/nt/Program Files/AntaresWeb/CHANGELOG.md diff --git a/tests/samples/nt/README.md b/tests/samples/initial/nt/Program Files/AntaresWeb/README.md similarity index 100% rename from tests/samples/nt/README.md rename to tests/samples/initial/nt/Program Files/AntaresWeb/README.md diff --git a/tests/samples/nt/AntaresWeb/AntaresWebServer.exe b/tests/samples/initial/nt/Program Files/AntaresWeb/__init__.py similarity index 100% rename from tests/samples/nt/AntaresWeb/AntaresWebServer.exe rename to tests/samples/initial/nt/Program Files/AntaresWeb/__init__.py diff --git a/tests/samples/nt/config.prod.yaml b/tests/samples/initial/nt/Program Files/AntaresWeb/config.prod.yaml similarity index 100% rename from tests/samples/nt/config.prod.yaml rename to tests/samples/initial/nt/Program Files/AntaresWeb/config.prod.yaml diff --git a/tests/samples/nt/config.yaml b/tests/samples/initial/nt/Program Files/AntaresWeb/config.yaml similarity index 100% rename from tests/samples/nt/config.yaml rename to tests/samples/initial/nt/Program Files/AntaresWeb/config.yaml diff --git a/tests/samples/nt/examples/README.md b/tests/samples/initial/nt/Program Files/AntaresWeb/examples/README.md similarity index 100% rename from tests/samples/nt/examples/README.md rename to tests/samples/initial/nt/Program Files/AntaresWeb/examples/README.md diff --git a/tests/samples/nt/examples/archives/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/examples/archives/.placeholder similarity index 100% rename from tests/samples/nt/examples/archives/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/examples/archives/.placeholder diff --git a/tests/samples/nt/examples/internal_studies/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/examples/internal_studies/.placeholder similarity index 100% rename from tests/samples/nt/examples/internal_studies/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/examples/internal_studies/.placeholder diff --git a/tests/samples/nt/examples/studies/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/examples/studies/.placeholder similarity index 100% rename from tests/samples/nt/examples/studies/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/examples/studies/.placeholder diff --git a/tests/samples/nt/gunicorn.py b/tests/samples/initial/nt/Program Files/AntaresWeb/gunicorn.py similarity index 100% rename from tests/samples/nt/gunicorn.py rename to tests/samples/initial/nt/Program Files/AntaresWeb/gunicorn.py diff --git a/tests/samples/nt/logs/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/logs/.placeholder similarity index 100% rename from tests/samples/nt/logs/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/logs/.placeholder diff --git a/tests/samples/nt/matrices/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/matrices/.placeholder similarity index 100% rename from tests/samples/nt/matrices/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/matrices/.placeholder diff --git a/tests/samples/nt/nginx.conf b/tests/samples/initial/nt/Program Files/AntaresWeb/nginx.conf similarity index 100% rename from tests/samples/nt/nginx.conf rename to tests/samples/initial/nt/Program Files/AntaresWeb/nginx.conf diff --git a/tests/samples/nt/tmp/.placeholder b/tests/samples/initial/nt/Program Files/AntaresWeb/tmp/.placeholder similarity index 100% rename from tests/samples/nt/tmp/.placeholder rename to tests/samples/initial/nt/Program Files/AntaresWeb/tmp/.placeholder diff --git a/tests/samples/nt/web.config.json b/tests/samples/initial/nt/Program Files/AntaresWeb/web.config.json similarity index 100% rename from tests/samples/nt/web.config.json rename to tests/samples/initial/nt/Program Files/AntaresWeb/web.config.json diff --git a/tests/samples/posix/AntaresWeb/AntaresTool b/tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresTool similarity index 100% rename from tests/samples/posix/AntaresWeb/AntaresTool rename to tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresTool diff --git a/tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresWebServer.py b/tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresWebServer.py new file mode 100644 index 0000000..c5ebd33 --- /dev/null +++ b/tests/samples/initial/posix/opt/antares-web/AntaresWeb/AntaresWebServer.py @@ -0,0 +1,11 @@ +import click +from tests.samples import version + + +@click.command() +def get_version(): + return version + + +if __name__ == "__main__": + get_version() diff --git a/tests/samples/posix/AntaresWeb/AntaresWebServer b/tests/samples/initial/posix/opt/antares-web/AntaresWeb/__init__.py similarity index 100% rename from tests/samples/posix/AntaresWeb/AntaresWebServer rename to tests/samples/initial/posix/opt/antares-web/AntaresWeb/__init__.py diff --git a/tests/samples/posix/AntaresWeb/antares_solver/antares-8.8-solver b/tests/samples/initial/posix/opt/antares-web/AntaresWeb/antares_solver/antares-8.8-solver similarity index 100% rename from tests/samples/posix/AntaresWeb/antares_solver/antares-8.8-solver rename to tests/samples/initial/posix/opt/antares-web/AntaresWeb/antares_solver/antares-8.8-solver diff --git a/tests/samples/posix/AntaresWebWorker b/tests/samples/initial/posix/opt/antares-web/AntaresWebWorker similarity index 100% rename from tests/samples/posix/AntaresWebWorker rename to tests/samples/initial/posix/opt/antares-web/AntaresWebWorker diff --git a/tests/samples/posix/CHANGELOG.md b/tests/samples/initial/posix/opt/antares-web/CHANGELOG.md similarity index 100% rename from tests/samples/posix/CHANGELOG.md rename to tests/samples/initial/posix/opt/antares-web/CHANGELOG.md diff --git a/tests/samples/posix/README.md b/tests/samples/initial/posix/opt/antares-web/README.md similarity index 100% rename from tests/samples/posix/README.md rename to tests/samples/initial/posix/opt/antares-web/README.md diff --git a/tests/samples/posix/config.prod.yaml b/tests/samples/initial/posix/opt/antares-web/__init__.py similarity index 100% rename from tests/samples/posix/config.prod.yaml rename to tests/samples/initial/posix/opt/antares-web/__init__.py diff --git a/tests/samples/posix/config.yaml b/tests/samples/initial/posix/opt/antares-web/config.prod.yaml similarity index 100% rename from tests/samples/posix/config.yaml rename to tests/samples/initial/posix/opt/antares-web/config.prod.yaml diff --git a/tests/samples/posix/examples/README.md b/tests/samples/initial/posix/opt/antares-web/config.yaml similarity index 100% rename from tests/samples/posix/examples/README.md rename to tests/samples/initial/posix/opt/antares-web/config.yaml diff --git a/tests/samples/posix/examples/archives/.placeholder b/tests/samples/initial/posix/opt/antares-web/examples/README.md similarity index 100% rename from tests/samples/posix/examples/archives/.placeholder rename to tests/samples/initial/posix/opt/antares-web/examples/README.md diff --git a/tests/samples/posix/examples/internal_studies/.placeholder b/tests/samples/initial/posix/opt/antares-web/examples/archives/.placeholder similarity index 100% rename from tests/samples/posix/examples/internal_studies/.placeholder rename to tests/samples/initial/posix/opt/antares-web/examples/archives/.placeholder diff --git a/tests/samples/posix/examples/studies/.placeholder b/tests/samples/initial/posix/opt/antares-web/examples/internal_studies/.placeholder similarity index 100% rename from tests/samples/posix/examples/studies/.placeholder rename to tests/samples/initial/posix/opt/antares-web/examples/internal_studies/.placeholder diff --git a/tests/samples/posix/logs/.placeholder b/tests/samples/initial/posix/opt/antares-web/examples/studies/.placeholder similarity index 100% rename from tests/samples/posix/logs/.placeholder rename to tests/samples/initial/posix/opt/antares-web/examples/studies/.placeholder diff --git a/tests/samples/posix/gunicorn.py b/tests/samples/initial/posix/opt/antares-web/gunicorn.py similarity index 100% rename from tests/samples/posix/gunicorn.py rename to tests/samples/initial/posix/opt/antares-web/gunicorn.py diff --git a/tests/samples/posix/matrices/.placeholder b/tests/samples/initial/posix/opt/antares-web/logs/.placeholder similarity index 100% rename from tests/samples/posix/matrices/.placeholder rename to tests/samples/initial/posix/opt/antares-web/logs/.placeholder diff --git a/tests/samples/posix/tmp/.placeholder b/tests/samples/initial/posix/opt/antares-web/matrices/.placeholder similarity index 100% rename from tests/samples/posix/tmp/.placeholder rename to tests/samples/initial/posix/opt/antares-web/matrices/.placeholder diff --git a/tests/samples/posix/nginx.conf b/tests/samples/initial/posix/opt/antares-web/nginx.conf similarity index 100% rename from tests/samples/posix/nginx.conf rename to tests/samples/initial/posix/opt/antares-web/nginx.conf diff --git a/tests/samples/posix/web.config.json b/tests/samples/initial/posix/opt/antares-web/tmp/.placeholder similarity index 100% rename from tests/samples/posix/web.config.json rename to tests/samples/initial/posix/opt/antares-web/tmp/.placeholder diff --git a/tests/samples/initial/posix/opt/antares-web/web.config.json b/tests/samples/initial/posix/opt/antares-web/web.config.json new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_about.py b/tests/test_about.py index 1f8cb48..d525441 100644 --- a/tests/test_about.py +++ b/tests/test_about.py @@ -1,6 +1,6 @@ import re -from antares_web_installer.__about__ import __version__ +from src.antares_web_installer.__about__ import __version__ def test_version():