Skip to content

Commit

Permalink
Fix CI with the quirks of old and new QGIS docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jul 8, 2024
1 parent c395d37 commit dd624a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ FROM qgis/qgis:${QGIS_TEST_VERSION}
MAINTAINER Matthias Kuhn <[email protected]>

RUN apt-get update \
&& apt-get install -y \
python3-pip \
&& apt-get install -y python3-pip \
&& rm -rf /var/lib/apt/lists/*

COPY ./requirements.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt

# Upgrading `pip` fixes: "WARNING: Generating metadata for package libqfieldsync produced metadata for project name unknown. Fix your #egg=libqfieldsync fragments."
# However, in QGIS>=3.38, this command fail as `pip` is Debian installed and protected, hence we have `|| true`.
RUN pip3 install --upgrade pip || true

# images for QGIS<=3.34 uses much older `pip` that does not support `--break-system-packages`
RUN pip3 install -r /tmp/requirements.txt || pip3 install -r /tmp/requirements.txt --break-system-packages

ENV LANG=C.UTF-8

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Test
run: |
docker-compose -f .docker/docker-compose.gh.yml run qgis /usr/src/.docker/run-docker-tests.sh
docker compose -f .docker/docker-compose.gh.yml run qgis /usr/src/.docker/run-docker-tests.sh
test-22-04:
runs-on: ubuntu-22.04
Expand All @@ -75,6 +75,10 @@ jobs:
sudo apt install qgis
sudo pip3 install pytest nose2 mock
# Upgrading `pip` fixes: "WARNING: Generating metadata for package libqfieldsync produced metadata for project name unknown. Fix your #egg=libqfieldsync fragments."
pip3 install --upgrade pip
# Install dependencies, including `libqfieldsync`
pip3 install -r requirements.txt
xvfb-run pytest
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
flake8==2.5.5
pep8-naming
flake8-respect-noqa
nose2
pytest
future
transifex-client
Expand Down

0 comments on commit dd624a5

Please sign in to comment.