Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
eriksven marked this conversation as resolved.
4 changes: 2 additions & 2 deletions .github/workflows/check_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}"
4 changes: 2 additions & 2 deletions .github/workflows/dash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}
6 changes: 3 additions & 3 deletions .github/workflows/generate-python-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to use a specific hash instead of the more loose tagging?

In general, I welcome using the direct hashes instead of the tag approach as the tag may change later. So we could decide to use the hash for the references in all actions. What confuses me though was the mix of the two approaches here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not "my action" but I think some Eclipse people. And they like hashes (I don't), but I kept the style here

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 }}

Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/kuksa-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ 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:
runs-on: ubuntu-latest
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: |
Expand All @@ -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 }}
Expand All @@ -77,15 +77,15 @@ 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 }}
password: ${{ secrets.QUAY_IO_TOKEN }}

- 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
Expand All @@ -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
Expand All @@ -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}}

Expand All @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion kuksa-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand this essentially means that you are dropping support for the sdv api within the kuksa-client in this Dockerfile?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually.... I found it never really had sdv API support (only val.v1 and later val.v2) except it just shipped the generated proto files, so theoretically you could use them yourself when importing the package. As those proto files do not exist anymore, I removed all references as well



# Debian 13 is trixie, so the glibc version matches. Distroless is a lot smaller than
Expand Down
1 change: 0 additions & 1 deletion kuksa-client/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions kuksa-client/prototagandcopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
11 changes: 7 additions & 4 deletions kuksa-client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:")
Expand Down Expand Up @@ -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)
Expand All @@ -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}")


Expand Down
Loading