From 1beaf32baec344d85cf3467dcdb62e6ddabc7506 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Wed, 29 Jan 2025 16:51:35 +0100 Subject: [PATCH] Automate runner install/update #3918 --- pyproject.toml | 4 ++++ run.sh | 5 +++++ utils/build/build.sh | 6 ++++-- utils/build/docker/runner.Dockerfile | 4 +++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f36c250f6..8a1848d2f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,14 @@ [project] name = 'system_tests' version = '0.0.1' +dynamic = ["dependencies"] [tool.setuptools] packages = ["tests", "utils", "manifests"] +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + [tool.pytest.ini_options] addopts = "--json-report --json-report-indent=2 --color=yes --no-header --junitxml=reportJunit.xml -r Xf" testpaths = [ diff --git a/run.sh b/run.sh index b5e5e5ee6b..2fd5227a87 100755 --- a/run.sh +++ b/run.sh @@ -328,6 +328,11 @@ function main() { run_mode='direct' fi + # check if runner is installed and up to date + if [[ "${run_mode}" == "direct" ]] && ! is_using_nix && ! diff requirements.txt venv/requirements.txt; then + ./build.sh -i runner + fi + # ensure environment if [[ "${run_mode}" == "docker" ]] || is_using_nix; then : # no venv needed diff --git a/utils/build/build.sh b/utils/build/build.sh index 86ee5c3d66..e71c9be53b 100755 --- a/utils/build/build.sh +++ b/utils/build/build.sh @@ -155,9 +155,11 @@ build() { fi fi source venv/bin/activate - python -m pip install --upgrade pip wheel + python -m pip install --upgrade pip setuptools==75.8.0 fi - pip install -r requirements.txt + python -m pip install -e . + cp requirements.txt venv/requirements.txt + elif [[ $IMAGE_NAME == runner ]] && [[ $DOCKER_MODE == 1 ]]; then docker buildx build \ diff --git a/utils/build/docker/runner.Dockerfile b/utils/build/docker/runner.Dockerfile index 9582f9e2c9..bb3e27e0fc 100644 --- a/utils/build/docker/runner.Dockerfile +++ b/utils/build/docker/runner.Dockerfile @@ -3,8 +3,11 @@ FROM python:3.12 RUN mkdir /app WORKDIR /app +RUN mkdir tests/ manifests/ + COPY utils/build/docker/python/parametric/requirements.txt utils/build/docker/python/parametric/requirements.txt COPY requirements.txt . +COPY pyproject.toml . COPY build.sh . COPY utils/build/build.sh utils/build/build.sh RUN mkdir -p /app/utils/build/docker && ./build.sh -i runner @@ -21,7 +24,6 @@ COPY manifests /app/manifests # toplevel things COPY conftest.py /app/ -COPY pyproject.toml /app/ COPY run.sh /app/ CMD ./run.sh