From 7925bf3a88c3460ddc72849dcb54ea92f454aa3c Mon Sep 17 00:00:00 2001 From: Erik Jaegervall Date: Fri, 21 Jul 2023 15:59:21 +0200 Subject: [PATCH] Change kuksa-client version handling Does the following: - For Docker copy whole repo so we get the expected version from tag (previously always 0.1.6) - Using 0.1.6 as default version does not make sense, 0.0.0 works better to show that version lookup failed - Tag pattern seems to be difficult to get correct, it always complain and seems to have no effect - Aligning grpcio-tools version with what is defined in setup.cfg The reason is that all docker build on master previously got v0.1.6 except possible if that specific version was tagged, which gives odd behavior if downloading kuksa-client:master --- .github/workflows/kuksa-client.yml | 14 ++++++++------ kuksa-client/Dockerfile | 7 +++---- kuksa-client/pyproject.toml | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/kuksa-client.yml b/.github/workflows/kuksa-client.yml index 1f614a28f..ea5c3bc40 100644 --- a/.github/workflows/kuksa-client.yml +++ b/.github/workflows/kuksa-client.yml @@ -34,6 +34,9 @@ jobs: steps: - uses: actions/checkout@v3 + with: + # Fetch everything to get tags working as expected + fetch-depth: 0 - name: Docker meta id: meta uses: docker/metadata-action@v4 @@ -48,15 +51,15 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - - # only needed for runners without buildx setup, will be slow + + # only needed for runners without buildx setup, will be slow #- name: Set up QEMU # uses: docker/setup-qemu-action@v2 - + #- name: Set up Docker Buildx # id: buildx # uses: docker/setup-buildx-action@v2 - + - name: Log in to the Container registry if: needs.checkrights.outputs.have_secrets == 'true' uses: docker/login-action@v2 @@ -94,7 +97,7 @@ jobs: push: false tags: "ttl.sh/kuksa.val/kuksa-client-${{github.sha}}" labels: ${{ steps.meta.outputs.labels }} - + kuksa-client-test: runs-on: ubuntu-latest @@ -118,4 +121,3 @@ jobs: cd kuksa-client pip install --upgrade build python -m build - diff --git a/kuksa-client/Dockerfile b/kuksa-client/Dockerfile index 0e32e83df..5b86139fb 100644 --- a/kuksa-client/Dockerfile +++ b/kuksa-client/Dockerfile @@ -10,11 +10,10 @@ FROM python:3.10-alpine as build RUN apk update && apk add git alpine-sdk linux-headers -COPY kuksa-client /kuksa.val/kuksa-client/ -COPY kuksa_certificates /kuksa.val/kuksa_certificates/ -COPY proto/kuksa/val/v1/*.proto /kuksa.val/kuksa-client/kuksa/val/v1/ -WORKDIR /kuksa.val/kuksa-client RUN pip install --upgrade pip build +# We must copy the whole repository otherwise version lookup by tag would not work +COPY . /kuksa.val/ +WORKDIR /kuksa.val/kuksa-client RUN rm -rf dist RUN python3 -m build RUN mkdir /kuksa-client diff --git a/kuksa-client/pyproject.toml b/kuksa-client/pyproject.toml index 6c64451e1..95bec9c77 100644 --- a/kuksa-client/pyproject.toml +++ b/kuksa-client/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "grpcio-tools>=1.46.0", + "grpcio-tools>=1.54.2", "setuptools>=42", "setuptools-git-versioning", "wheel", @@ -8,8 +8,8 @@ requires = [ build-backend = "setuptools.build_meta" [tool.setuptools-git-versioning] -starting_version = "0.1.6" -tag_filter = "[0-9]+.[0-9]+.[0-9]+" +# Starting version is just a dummy value that never shall be used in CI +starting_version = "0.0.0" [tool.pylint.design] max-args = 8