From 725eba83be69da68093acbf8a87e43dcaff1ff7b Mon Sep 17 00:00:00 2001 From: Adrien Perrin Date: Tue, 8 Oct 2024 12:21:21 +0000 Subject: [PATCH] remove explicit installation from pythesint in the Docker image use pyproject.toml dependencies with minimum version instead + use `pip install -e` before running tests to install the dependencies --- .github/workflows/ci.yml | 5 +---- Dockerfile | 3 --- pyproject.toml | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efb73f1..05bb3a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: BASE_IMAGE: "${{ vars.DOCKER_ORG }}/geospaas:2.5.2-python${{ matrix.python_version }}" IMAGE_NAME: "${{ vars.DOCKER_ORG }}/geospaas_harvesting" METANORM_VERSION: '4.5.2' - PYTHESINT_VERSION: '1.7.0' GEOSPAAS_DB_HOST: 'db' GEOSPAAS_DB_USER: 'test' GEOSPAAS_DB_PASSWORD: "${{ secrets.GEOSPAAS_DB_PASSWORD }}" @@ -57,7 +56,6 @@ jobs: build-args: | BASE_IMAGE=${{ env.BASE_IMAGE }} METANORM_VERSION=${{ env.METANORM_VERSION }} - PYTHESINT_VERSION=${{ env.PYTHESINT_VERSION }} push: false load: true tags: 'harvesting_tests' @@ -85,7 +83,7 @@ jobs: -e "GEOSPAAS_DB_USER=${GEOSPAAS_DB_USER}" -e "GEOSPAAS_DB_PASSWORD=${GEOSPAAS_DB_PASSWORD}" 'harvesting_tests' - bash -c "coverage run ./runtests.py && coverage combine" + bash -c "pip install -e /src && coverage run ./runtests.py && coverage combine" - name: 'Stop testing database' run: docker stop "${{ env.GEOSPAAS_DB_HOST }}" @@ -109,7 +107,6 @@ jobs: build-args: | BASE_IMAGE=${{ env.BASE_IMAGE }} METANORM_VERSION=${{ env.METANORM_VERSION }} - PYTHESINT_VERSION=${{ env.PYTHESINT_VERSION }} push: ${{ github.event_name == 'release' }} tags: | ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python${{ matrix.python_version }} diff --git a/Dockerfile b/Dockerfile index cbd4c7b..c77f7f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,6 @@ RUN pip install --upgrade --no-cache-dir \ 'requests_oauthlib==1.3.*' \ 'tblib' -ARG PYTHESINT_VERSION='' -RUN bash -c "[ -n '$PYTHESINT_VERSION' ] && pip install --upgrade 'pythesint==$PYTHESINT_VERSION' || true" - FROM base COPY . /tmp/setup diff --git a/pyproject.toml b/pyproject.toml index 468e3fd..db1e951 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "netCDF4", "numpy", "oauthlib", - "pythesint", + "pythesint>=1.7.0", "python-dateutil", "PyYAML", "requests_oauthlib",