From c297469de475f6f743a61e43fa1aec84c944adb2 Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 16:14:15 +0200 Subject: [PATCH 1/7] update github actions --- .github/workflows/docker-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3f1ee2d..a73145e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Update version file ⬆️ uses: brettdorrans/write-version-to-file@v1.1.0 @@ -37,7 +37,7 @@ jobs: placeholder: '${VERSION}' - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -45,12 +45,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image 📦 to ghcr - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v6 with: context: . push: true From 97d82f378bf5b43deaa2a619ad5f7fa628858ddd Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 16:22:37 +0200 Subject: [PATCH 2/7] support both amd64 & arm64 platforms --- .github/workflows/docker-image.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a73145e..dea5da5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -36,6 +36,12 @@ jobs: filename: '.VERSION' placeholder: '${VERSION}' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -54,5 +60,6 @@ jobs: with: context: . push: true + platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 6eb2a9dfabfc9e2433ae185c775f7b017427d933 Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 16:32:07 +0200 Subject: [PATCH 3/7] update container python verion to 3.12 --- .github/workflows/build-publish.yml | 6 +++--- Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index db5133b..d1c7df8 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -17,10 +17,10 @@ jobs: filename: '.VERSION' placeholder: '${VERSION}' - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: Install pypa/build run: >- diff --git a/Dockerfile b/Dockerfile index 8ac24a5..7845af1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-alpine +FROM python:3.12-alpine # Install python-lxml RUN apk add --no-cache --virtual .build-deps \ From 823053b15589d2ec58fb7fdb80094e9ad5ba6dca Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 16:51:24 +0200 Subject: [PATCH 4/7] setuptools: https://github.com/python/cpython/issues/95299 --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ceae4a5..490757e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ lxml requests garth -setuptools From 1660a4e11ae2a8061419bca9dd5247d62fda7298 Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 17:01:16 +0200 Subject: [PATCH 5/7] fix setuptools & python3.12 situation --- Dockerfile | 2 +- requirements.txt | 1 + setup.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7845af1..e7fcb14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM python:3.12-alpine RUN apk add --no-cache --virtual .build-deps \ gcc musl-dev \ libxslt-dev libxml2-dev && \ - pip install lxml && \ + pip install lxml setuptools && \ apk del .build-deps && \ apk add --no-cache libxslt libxml2 diff --git a/requirements.txt b/requirements.txt index 490757e..ceae4a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ lxml requests garth +setuptools diff --git a/setup.py b/setup.py index c5d8bff..23491e9 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(fname): "Topic :: Utilities", "License :: OSI Approved :: MIT License", ], - install_requires=["lxml", "requests", "garth>=0.4.32", "python-dotenv"], + install_requires=["lxml", "requests", "garth>=0.4.32", "setuptools", "python-dotenv"], entry_points={ "console_scripts": ["withings-sync=withings_sync.sync:main"], }, From 81365e0f8cf848448104ea5d90ea16cb47fbc778 Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 18:00:37 +0200 Subject: [PATCH 6/7] fix setuptools depr changes --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e7fcb14..03bdba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,6 @@ RUN mkdir -p /src COPY . /src RUN cd /src && \ - python3 ./setup.py install + pip install -e . ENTRYPOINT ["withings-sync"] From 445a35b33eed781815049b2fce98a7e207b22c49 Mon Sep 17 00:00:00 2001 From: stynoo Date: Sun, 20 Oct 2024 18:49:04 +0200 Subject: [PATCH 7/7] fix setuptools changes --- Dockerfile | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03bdba4..deead53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,6 @@ RUN mkdir -p /src COPY . /src RUN cd /src && \ - pip install -e . + pip install . ENTRYPOINT ["withings-sync"] diff --git a/setup.py b/setup.py index 23491e9..c5d8bff 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read(fname): "Topic :: Utilities", "License :: OSI Approved :: MIT License", ], - install_requires=["lxml", "requests", "garth>=0.4.32", "setuptools", "python-dotenv"], + install_requires=["lxml", "requests", "garth>=0.4.32", "python-dotenv"], entry_points={ "console_scripts": ["withings-sync=withings_sync.sync:main"], },