From 2edecc647faf472076625c442aead5f582ecf6dc Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 6 Mar 2023 08:53:38 +0100 Subject: [PATCH] build: remove the link to `antareslauncher`, use `Antares-Launcher~=1.2.2` instead --- .github/workflows/deploy.yml | 5 ----- .github/workflows/main.yml | 5 ----- Dockerfile | 13 +++++++++---- antareslauncher | 1 - .../adapters/slurm_launcher/slurm_launcher.py | 5 +++-- docs/CHANGELOG.md | 4 ++++ requirements-dev.txt | 1 - requirements-test.txt | 3 ++- requirements.txt | 5 +---- setup.cfg | 2 +- 10 files changed, 20 insertions(+), 24 deletions(-) delete mode 120000 antareslauncher diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7b576bd17e..4f920c083e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,11 +46,6 @@ jobs: - name: Install Windows dependencies if: matrix.os == 'windows-latest' run: pip install -r requirements-windows.txt - - name: Fix symlink for windows - if: matrix.os == 'windows-latest' - run: | - rm antareslauncher - ln -s antares-launcher\antareslauncher antareslauncher - name: Generate Windows binary if: matrix.os == 'windows-latest' run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af2e0521b4..e5061506b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,11 +47,6 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - name: Fix symlink for windows - if: matrix.os == 'windows-latest' - run: | - rm antareslauncher - ln -s antares-launcher\antareslauncher antareslauncher - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/Dockerfile b/Dockerfile index 2260427476..f99b8d7559 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,15 @@ COPY ./scripts /scripts COPY ./alembic /alembic COPY ./alembic.ini /alembic.ini -COPY ./antares-launcher /antares-launcher -RUN ln -s /antares-launcher/antareslauncher /antareslauncher -RUN mkdir /conf/antares-launcher -RUN cp /antares-launcher/requirements.txt /conf/antares-launcher/requirements.txt +# > IMPORTANT: The `antares-launcher` project (source files) is no longer needed, +# > because the `Antares-Launcher` Python library is now declared as a dependency +# > in the `requirements.txt` file. +# > In other words, we can dispense with the creation of the symbolic link. + +# COPY ./antares-launcher /antares-launcher +# RUN ln -s /antares-launcher/antareslauncher /antareslauncher +# RUN mkdir /conf/antares-launcher +# RUN cp /antares-launcher/requirements.txt /conf/antares-launcher/requirements.txt RUN ./scripts/install-debug.sh diff --git a/antareslauncher b/antareslauncher deleted file mode 120000 index 700bb69b40..0000000000 --- a/antareslauncher +++ /dev/null @@ -1 +0,0 @@ -antares-launcher/antareslauncher \ No newline at end of file diff --git a/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py b/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py index a4bc932903..5e5957314a 100644 --- a/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py +++ b/antarest/launcher/adapters/slurm_launcher/slurm_launcher.py @@ -9,7 +9,7 @@ import traceback from copy import deepcopy from pathlib import Path -from typing import Awaitable, Callable, Dict, List, Optional +from typing import Awaitable, Callable, Dict, List, Optional, cast from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb from antareslauncher.main import MainParameters, run_with @@ -198,8 +198,8 @@ def _init_launcher_arguments( parser: MainOptionParser = MainOptionParser(main_options_parameters) parser.add_basic_arguments() parser.add_advanced_arguments() - arguments = parser.parse_args([]) + arguments = cast(argparse.Namespace, parser.parse_args([])) arguments.wait_mode = False arguments.check_queue = False arguments.json_ssh_config = None @@ -208,6 +208,7 @@ def _init_launcher_arguments( arguments.version = False arguments.post_processing = False arguments.other_options = None + return arguments def _init_launcher_parameters( diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2663119a37..6d50e6a72d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -43,6 +43,10 @@ v2.13.0 (unreleased) * remove redundant call to `mypy` in GitHub actions. ([96e2b82](https://github.com/AntaresSimulatorTeam/AntaREST/commit/96e2b824eb348d1a3fe5bacf89de35e9cb7fc0fa)) * upgrade Black version in `requirements-dev.txt` and `.github/workflows/main.yml`. ([464c7ff](https://github.com/AntaresSimulatorTeam/AntaREST/commit/464c7ff1ea877646815a3c70891e36b976b856d8)) +> IMPORTANT: The `antares-launcher` project (source files) is no longer needed, +> because the `Antares-Launcher` Python library is now declared as a dependency +> in the `requirements.txt` file. + ### Styles diff --git a/requirements-dev.txt b/requirements-dev.txt index fe90d80f30..12e17251b0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ -r requirements-test.txt -pytest~=6.2.5 # Version of Black should match the versions set in `.github/workflows/main.yml` black~=23.1.0 mypy~=0.931 diff --git a/requirements-test.txt b/requirements-test.txt index a51745b4d3..088f207160 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,2 +1,3 @@ -r requirements.txt -pytest-cov +pytest~=6.2.5 +pytest-cov~=4.0.0 diff --git a/requirements.txt b/requirements.txt index 9bf8eb4e4f..06f220802c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,4 @@ --r antares-launcher/requirements.txt -# freezed -mistune~=0.8.4 -m2r~=0.2.1 +Antares-Launcher~=1.2.2 aiofiles~=0.8.0 alembic~=1.7.5 diff --git a/setup.cfg b/setup.cfg index dc0780a6bb..2c39ba30ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ strict = True files = antarest/**/*.py [mypy-antareslauncher.*] -ignore_errors = True +ignore_missing_imports = True [mypy-jsonschema.*] ignore_missing_imports = True