Skip to content

Fix proto generation from setup.py#45

Merged
wba2hi merged 4 commits intoeclipse-kuksa:mainfrom
boschglobal:fix/proto_gen
Aug 20, 2025
Merged

Fix proto generation from setup.py#45
wba2hi merged 4 commits intoeclipse-kuksa:mainfrom
boschglobal:fix/proto_gen

Conversation

@lukasmittag
Copy link
Contributor

The proto generation was not executed automatically and was called manually in the dockerfile for containers or by the developer. This led to a faulty version of the pypi packages 0.5.0a1 and 0.5.0a2. This hopefully fixes this by integrating the proto generation script in the setup.py

Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

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

I think this does not work. Just trying the container form CI already yields

 % docker run --rm -it --net=host ttl.sh/kuksa-python-sdk/kuksa-client-d418af9b39e1400ad9c76d0af37d4d7ac89f0dc7

Unable to find image 'ttl.sh/kuksa-python-sdk/kuksa-client-d418af9b39e1400ad9c76d0af37d4d7ac89f0dc7:latest' locally
latest: Pulling from kuksa-python-sdk/kuksa-client-d418af9b39e1400ad9c76d0af37d4d7ac89f0dc7
da88a3b79f2c: Pull complete 
bfb59b82a9b6: Pull complete 
4eff9a62d888: Pull complete 
a62778643d56: Pull complete 
7c12895b777b: Pull complete 
3214acf345c0: Pull complete 
5664b15f108b: Pull complete 
0bab15eea81d: Pull complete 
4aa0ea1413d3: Pull complete 
da7816fa955e: Pull complete 
ddf74a63f7d8: Pull complete 
7faf6706c0c2: Pull complete 
8687fa856c98: Pull complete 
38a3d10be31b: Pull complete 
9ad354df3867: Pull complete 
255d58538c65: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:52cbb628e8635fc9b03d7b69dc65392058b353c6ec20757269b19b292750cfb2
Status: Downloaded newer image for ttl.sh/kuksa-python-sdk/kuksa-client-d418af9b39e1400ad9c76d0af37d4d7ac89f0dc7:latest

     ⢀⣤⣶⣾⣿⢸⣿⣿⣷⣶⣤⡀
    ⣴⣿⡿⠋⣿⣿   ⠈⠙⢿⣿⣦
   ⣾⣿⠋  ⣿⣿  ⣶⣿  ⠙⣿⣷
  ⣸⣿⠇   ⣿⣿⠠⣾⡿⠃   ⠸⣿⣇  ⣶ ⣠⡶⠂ ⣶  ⢰⡆ ⢰⡆⢀⣴⠖ ⢠⡶⠶⠶⡦   ⣰⣶⡀
  ⣿⣿    ⠿⢿⣷⣦⡀     ⣿⣿  ⣿⢾⣏   ⣿  ⢸⡇ ⢸⡷⣿⡁  ⠘⠷⠶⠶⣦  ⢠⡟⠘⣷
  ⢹⣿⡆   ⣿⣶⠈⢻⣿⡆   ⢰⣿⡏  ⠿ ⠙⠷⠄ ⠙⠷⠶⠟⠁ ⠸⠇⠈⠻⠦ ⠐⠷⠶⠶⠟ ⠠⠿⠁ ⠹⠧
   ⢿⣿⣄  ⣿⣿  ⠿⣿  ⣠⣿⡿
    ⠻⣿⣷⡄⣿⣿   ⢀⣠⣾⣿⠟    kuksa-client CLI
     ⠈⠛⠇⢿⣿⣿⣿⣿⡿⠿⠛⠁     0.5.0a2.post6+git.d418af9b.dirty


Connecting to VSS server at 127.0.0.1 port 55555 using KUKSA GRPC protocol.
TLS will not be used.
Traceback (most recent call last):
  File "kuksa-client.py", line 8, in <module>
  File "kuksa_client/__main__.py", line 696, in main
  File "kuksa_client/__main__.py", line 348, in __init__
  File "kuksa_client/__main__.py", line 615, in connect
  File "kuksa_client/__init__.py", line 37, in __init__
  File "kuksa_client/cli_backend/__init__.py", line 43, in from_config
  File "PyInstaller/loader/pyimod02_importers.py", line 457, in exec_module
  File "kuksa_client/cli_backend/grpc.py", line 34, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 457, in exec_module
  File "kuksa_client/grpc/__init__.py", line 39, in <module>
ModuleNotFoundError: No module named 'kuksa'
[PYI-1:ERROR] Failed to execute script 'kuksa-client' due to unhandled exception!

Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

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

Still broken

Digest: sha256:f04616872e20d57d4729a8860ade629d7e58338c94de9fe2492f28f78110f382
Status: Downloaded newer image for ttl.sh/kuksa-python-sdk/kuksa-client-6d9fcfb15087cd748af4f8dd9944d47a095c0684:latest

     ⢀⣤⣶⣾⣿⢸⣿⣿⣷⣶⣤⡀
    ⣴⣿⡿⠋⣿⣿   ⠈⠙⢿⣿⣦
   ⣾⣿⠋  ⣿⣿  ⣶⣿  ⠙⣿⣷
  ⣸⣿⠇   ⣿⣿⠠⣾⡿⠃   ⠸⣿⣇  ⣶ ⣠⡶⠂ ⣶  ⢰⡆ ⢰⡆⢀⣴⠖ ⢠⡶⠶⠶⡦   ⣰⣶⡀
  ⣿⣿    ⠿⢿⣷⣦⡀     ⣿⣿  ⣿⢾⣏   ⣿  ⢸⡇ ⢸⡷⣿⡁  ⠘⠷⠶⠶⣦  ⢠⡟⠘⣷
  ⢹⣿⡆   ⣿⣶⠈⢻⣿⡆   ⢰⣿⡏  ⠿ ⠙⠷⠄ ⠙⠷⠶⠟⠁ ⠸⠇⠈⠻⠦ ⠐⠷⠶⠶⠟ ⠠⠿⠁ ⠹⠧
   ⢿⣿⣄  ⣿⣿  ⠿⣿  ⣠⣿⡿
    ⠻⣿⣷⡄⣿⣿   ⢀⣠⣾⣿⠟    kuksa-client CLI
     ⠈⠛⠇⢿⣿⣿⣿⣿⡿⠿⠛⠁     0.5.0a2.post7+git.6d9fcfb1.dirty


Connecting to VSS server at 127.0.0.1 port 55555 using KUKSA GRPC protocol.
TLS will not be used.
Traceback (most recent call last):
  File "kuksa-client.py", line 8, in <module>
  File "kuksa_client/__main__.py", line 696, in main
  File "kuksa_client/__main__.py", line 348, in __init__
  File "kuksa_client/__main__.py", line 615, in connect
  File "kuksa_client/__init__.py", line 37, in __init__
  File "kuksa_client/cli_backend/__init__.py", line 43, in from_config
  File "PyInstaller/loader/pyimod02_importers.py", line 457, in exec_module
  File "kuksa_client/cli_backend/grpc.py", line 34, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 457, in exec_module
  File "kuksa_client/grpc/__init__.py", line 39, in <module>
  File "/kuksa-client/_internal/kuksa/val/v1/types_pb2.py", line 25, in <module>
    from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
ImportError: cannot import name 'timestamp_pb2' from 'google.protobuf' (/kuksa-client/_internal/google/protobuf/__init__.py)
[PYI-1:ERROR] Failed to execute script 'kuksa-client' due to unhandled exception!

@SebastianSchildt SebastianSchildt force-pushed the fix/proto_gen branch 2 times, most recently from ac3fb35 to 7cd2ebc Compare July 31, 2025 17:46
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
@SebastianSchildt
Copy link
Contributor

I changed the proto generation to hopefully work "In all cases", but mainly to be able to generate working wheels and sdists.

It seems the Python package build process is two stage

  • it bulilds an sdist - a source package. Protos where generated here, but extra care needs to be taken, to make sure they are picked up as packages (there is some timing/sequencing going on: After we added the init.py it was to late, becasue the scan for "packages" was earlier
  • it builds a "wheel" (normally this is what you install with pip) from the sdist. There the generation did not work (completely different file tree), therefore it was important to make sure really everything generated is already in the sdist, and for added nicety skip generation steps to prevent the from failing

I "should" work now. If unsure try with a fresh checkout. There are many combinations possible of

  • submodule initialized or not
  • init.py files already in proto tree or not
  • proto generation (py files) already done or not

Not sure all corner cases are caught correctly.

Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

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

Works for me. @lukasmittag pls also do a sanity check

@lukasmittag
Copy link
Contributor Author

normal pip install for development only functions after calling twice. Before it complains about not finding the module. This should be because of the order of calling commands or maybe because of not picking up the libraries maybe we need to wait somewhere can have a look next week.

@lukasmittag
Copy link
Contributor Author

#47

Copy link
Contributor

@wba2hi wba2hi left a comment

Choose a reason for hiding this comment

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

LGTM

@wba2hi wba2hi merged commit e47a0b9 into eclipse-kuksa:main Aug 20, 2025
8 checks passed
@wba2hi wba2hi deleted the fix/proto_gen branch August 20, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants