diff --git a/.github/workflows/check-markdown.yml b/.github/workflows/check-markdown.yml index ddd14e8..64aad07 100644 --- a/.github/workflows/check-markdown.yml +++ b/.github/workflows/check-markdown.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: 'true' - - uses: eclipse-kuksa/kuksa-actions/check-markdown@4 + - uses: eclipse-kuksa/kuksa-actions/check-markdown@5 diff --git a/.github/workflows/check_license.yml b/.github/workflows/check_license.yml index 92a7d9f..1e70260 100755 --- a/.github/workflows/check_license.yml +++ b/.github/workflows/check_license.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: # required to grab the history of the PR fetch-depth: 0 @@ -28,7 +28,7 @@ jobs: run: | echo "licenses=Apache-2.0" >> $GITHUB_ENV - - uses: eclipse-kuksa/kuksa-actions/spdx@2 + - uses: eclipse-kuksa/kuksa-actions/spdx@5 with: files: "${{ env.files }}" licenses: "${{ env.licenses }}" diff --git a/.github/workflows/dash.yaml b/.github/workflows/dash.yaml index 3fe598c..50e3514 100644 --- a/.github/workflows/dash.yaml +++ b/.github/workflows/dash.yaml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 # taken from here: https://github.com/eclipse/dash-licenses#example-python - name: Create Dash Dependency Report @@ -39,7 +39,7 @@ jobs: > dependencies.txt - name: Dash license check - uses: eclipse-kuksa/kuksa-actions/check-dash@4 + uses: eclipse-kuksa/kuksa-actions/check-dash@5 with: dashinput: ${{github.workspace}}/dependencies.txt dashtoken: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN}} diff --git a/.github/workflows/generate-python-sbom.yml b/.github/workflows/generate-python-sbom.yml index 20cc488..ca74914 100644 --- a/.github/workflows/generate-python-sbom.yml +++ b/.github/workflows/generate-python-sbom.yml @@ -30,13 +30,13 @@ jobs: outputs: project-version: ${{ steps.version.outputs.PROJECT_VERSION }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 ref: ${{ github.event.inputs.version }} - - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ env.PYTHON_VERSION }} @@ -63,7 +63,7 @@ jobs: run: cyclonedx-py requirements ${{ env.PRODUCT_PATH }}/requirements.txt -o bom.json - name: Upload sbom - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: sbom path: bom.json diff --git a/.github/workflows/kuksa-client.yml b/.github/workflows/kuksa-client.yml index ee844e6..f4879cc 100644 --- a/.github/workflows/kuksa-client.yml +++ b/.github/workflows/kuksa-client.yml @@ -28,7 +28,7 @@ permissions: jobs: check_ghcr_push: - uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2 + uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@5.1 secrets: inherit build-docker: @@ -36,14 +36,14 @@ jobs: needs: check_ghcr_push steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: # Fetch everything to get tags working as expected fetch-depth: 0 submodules: 'true' - name: Docker meta id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: # list of Docker images to use as base name for tags images: | @@ -59,15 +59,15 @@ jobs: # only needed for runners without buildx setup, will be slow - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Log in to ghcr.io container registry if: needs.check_ghcr_push.outputs.push == 'true' - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -77,7 +77,7 @@ jobs: - name: Log in to quay.io container registry if: needs.check_ghcr_push.outputs.push == 'true' - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: quay.io username: ${{ secrets.QUAY_IO_USERNAME }} @@ -85,7 +85,7 @@ jobs: - name: Build kuksa command line client docker and push to ghcr.io, quay.io and ttl.sh if: needs.check_ghcr_push.outputs.push == 'true' - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: platforms: | linux/amd64 @@ -102,7 +102,7 @@ jobs: - name: Build ephemeral KUKSA command line client docker and push to ttl.sh if: needs.check_ghcr_push.outputs.push == 'false' - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: platforms: | linux/amd64 @@ -118,7 +118,7 @@ jobs: # Shall later be a kuksa-actions call - name: Posting temporary container location - uses: eclipse-kuksa/kuksa-actions/post-container-location@2 + uses: eclipse-kuksa/kuksa-actions/post-container-location@5.1 with: image: ttl.sh/kuksa-python-sdk/kuksa-client-${{github.sha}} @@ -127,7 +127,7 @@ jobs: steps: - name: Checkout kuksa-python-sdk - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: fetch-depth: 0 submodules: 'true' diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 537e748..29fb4ce 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,14 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: # required to grab the history of the PR fetch-depth: 0 submodules: 'true' - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v7 with: - python-version: '3.10' + python-version: '3.14' - uses: pre-commit/action@v3.0.1 with: extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 145f92d..7592878 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,13 +34,13 @@ jobs: steps: - name: Checkout kuksa-python-sdk - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: submodules: 'true' - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: - python-version: "3.11" + python-version: "3.14" - name: Install dependencies with pip run: | cd kuksa-client @@ -58,7 +58,7 @@ jobs: packages-dir: kuksa-client/dist - name: Create draft release id: create_release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: draft: true name: KUKSA Python SDK ${{ github.ref_name }} diff --git a/kuksa-client/Dockerfile b/kuksa-client/Dockerfile index c36ab57..472fadb 100644 --- a/kuksa-client/Dockerfile +++ b/kuksa-client/Dockerfile @@ -27,7 +27,7 @@ RUN pip install --no-cache-dir dist/*.whl WORKDIR / RUN rm -rf dist # Letting pyinstaller collect everything that is required -RUN pyinstaller --collect-data kuksa_client --add-data=/kuksa-python-sdk/kuksa-client/kuksa:kuksa --add-data=/kuksa-python-sdk/kuksa-client/sdv:sdv --clean -s /usr/local/bin/kuksa-client +RUN pyinstaller --collect-data kuksa_client --add-data=/kuksa-python-sdk/kuksa-client/kuksa:kuksa --clean -s /usr/local/bin/kuksa-client # Debian 13 is trixie, so the glibc version matches. Distroless is a lot smaller than diff --git a/kuksa-client/MANIFEST.in b/kuksa-client/MANIFEST.in index db19ee1..2eea4d0 100644 --- a/kuksa-client/MANIFEST.in +++ b/kuksa-client/MANIFEST.in @@ -1,6 +1,5 @@ include *.py recursive-include kuksa *.py -recursive-include sdv *.py global-exclude *.pyc global-exclude protobuild.py global-exclude prototagandcopy.py diff --git a/kuksa-client/prototagandcopy.py b/kuksa-client/prototagandcopy.py index 67f9ace..365f67e 100644 --- a/kuksa-client/prototagandcopy.py +++ b/kuksa-client/prototagandcopy.py @@ -15,21 +15,24 @@ import os # this needs to be adapted once the submodules name or structure changes -PROTO_PATH = os.path.abspath("../submodules/kuksa-proto/proto/") +PROTO_PATH = os.path.abspath("../submodules/kuksa-proto/kuksa/") def main(): ''' - This will tag all proto folders as Python packages by creating an __init__.py file - in each subdirectory and then copy the proto files to the current working directory + This will copy the kuksa proto tree to the current working directory and tag all + folders as Python packages by creating an __init__.py file in each of them. ''' - for root, dirs, files in os.walk(PROTO_PATH): + shutil.copytree(PROTO_PATH, os.path.join(os.getcwd(), "kuksa"), dirs_exist_ok=True) + for root, dirs, files in os.walk(os.path.join(os.getcwd(), "kuksa")): for directory in dirs: # Create an __init__.py file in each subdirectory init_file = os.path.join(root, directory, "__init__.py") with open(init_file, "w") as file: file.write("# This file marks the directory as a Python module") - shutil.copytree(PROTO_PATH, os.getcwd(), dirs_exist_ok=True) + # The package root itself also needs an __init__.py + with open(os.path.join(os.getcwd(), "kuksa", "__init__.py"), "w") as file: + file.write("# This file marks the directory as a Python module") if __name__ == "__main__": diff --git a/kuksa-client/setup.py b/kuksa-client/setup.py index f584cdc..cf1d70f 100644 --- a/kuksa-client/setup.py +++ b/kuksa-client/setup.py @@ -40,11 +40,12 @@ def finalize_options(self): def run(self): import subprocess # pylint: disable=import-outside-toplevel import os + import sys from pathlib import Path # Check if we're in an sdist build (proto files should already exist) proto_files_exist = any(Path('.').glob('**/*_pb2.py')) - proto_dir_exists = Path("../submodules/kuksa-proto/proto/").exists() + proto_dir_exists = Path("../submodules/kuksa-proto/kuksa/").exists() if proto_files_exist: print("Proto files already exist, skipping package tagging") @@ -59,7 +60,7 @@ def run(self): return print(f"Generating package from proto: {os.getcwd()}") - result = subprocess.call(['python', 'prototagandcopy.py']) + result = subprocess.call([sys.executable, 'prototagandcopy.py']) if result != 0: print(f"Warning: prototagandcopy.py failed with exit code {result}") # print("This is how it looks like:") @@ -149,7 +150,7 @@ def ensure_proto_packages(self): if '__init__.py' in files: package = root.replace('./', '').replace('/', '.').lstrip('.') print(f"Found package: {package}") - if package and any(proto_name in package for proto_name in ['kuksa', 'sdv']): + if package and any(proto_name in package for proto_name in ['kuksa']): # Skip build directories if not package.startswith('build.'): proto_packages.append(package) @@ -163,8 +164,10 @@ def ensure_proto_packages(self): # Add proto packages all_packages = current_packages + [pkg for pkg in proto_packages if pkg not in current_packages] - # Update the distribution packages + # Update the distribution packages and the build_py packages + # (build_py uses its own `packages` attribute when copying files) self.distribution.packages = all_packages + self.packages = all_packages print(f"Final package list: {all_packages}") diff --git a/submodules/kuksa-proto b/submodules/kuksa-proto index 450ef56..28bf76a 160000 --- a/submodules/kuksa-proto +++ b/submodules/kuksa-proto @@ -1 +1 @@ -Subproject commit 450ef56b87d090213f00a06a1821153ac32923d0 +Subproject commit 28bf76ae57085dad425eedd95bc7bd442e1314a7