eclipse-kuksa / kuksa-python-sdk

The Python SDK for Eclipse KUKSA
Apache License 2.0
3 stars 5 forks source link

Development environment not working with python >3.8 #13

Closed lukasmittag closed 5 months ago

lukasmittag commented 5 months ago

If you want to pip install -e . the kuksa-client for developing it, there is an issue with python versions greater than 3.8. The following output might help determine the problem.

Building wheels for collected packages: kuksa_client
  Building editable for kuksa_client (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for kuksa_client (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [150 lines of output]
      running editable_wheel
      creating /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info
      writing /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/dependency_links.txt
      writing entry points to /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/entry_points.txt
      writing requirements to /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/requires.txt
      writing top-level names to /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/top_level.txt
      writing manifest file '/tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      adding license file 'LICENSE'
      writing manifest file '/tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client.egg-info/SOURCES.txt'
      creating '/tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client-0.0.0.dist-info'
      creating /tmp/pip-wheel-gm9hzdnh/.tmp-zcp4rqrc/kuksa_client-0.0.0.dist-info/WHEEL
      running build_py
      running build_pb2
      Could not make proto path relative: /home/imu6fe/kuksa-python-sdk/kuksa-client/kuksa/val/v1/val.proto: No such file or directory
      Traceback (most recent call last):
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 299, in _safely_run
          return self.run_command(cmd_name)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 24, in run
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 39, in run
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/grpc_tools/command.py", line 48, in build_package_protos
          raise Exception("error: {} failed".format(command))
      Exception: error: ['grpc_tools.protoc', '--proto_path=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--proto_path=/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/grpc_tools/_proto', '--python_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--pyi_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--grpc_python_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '/home/imu6fe/kuksa-python-sdk/kuksa-client/kuksa/val/v1/val.proto'] failed

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 293, in _run_build_subcommands
          self._safely_run(name)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 301, in _safely_run
          SetuptoolsDeprecationWarning.emit(
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/warnings.py", line 44, in emit
          text = cls._format(summary_, details_, due, see_url or docs_url, kwargs)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/warnings.py", line 62, in _format
          cleandoc(details).format_map(format_args or {}),
      ValueError: Format string contains positional fields
      /tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:988: _DebuggingTips: Problem in editable installation.
      !!

              ********************************************************************************
              An error happened while installing `kuksa_client` in editable mode.

              The following steps are recommended to help debug this problem:

              - Try to install the project normally, without using the editable mode.
                Does the error still persist?
                (If it does, try fixing the problem before attempting the editable mode).
              - If you are using binary extensions, make sure you have all OS-level
                dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
              - Try the latest version of setuptools (maybe the error was already fixed).
              - If you (or your project dependencies) are using any setuptools extension
                or customization, make sure they support the editable mode.

              After following the steps above, if the problem still persists and
              you think this is related to how setuptools handles editable installations,
              please submit a reproducible example
              (see https://stackoverflow.com/help/minimal-reproducible-example) to:

                  https://github.com/pypa/setuptools/issues

              See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
              ********************************************************************************

      !!
        cmd_obj.run()
      Traceback (most recent call last):
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 299, in _safely_run
          return self.run_command(cmd_name)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 24, in run
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 39, in run
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/grpc_tools/command.py", line 48, in build_package_protos
          raise Exception("error: {} failed".format(command))
      Exception: error: ['grpc_tools.protoc', '--proto_path=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--proto_path=/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/grpc_tools/_proto', '--python_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--pyi_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '--grpc_python_out=/home/imu6fe/kuksa-python-sdk/kuksa-client', '/home/imu6fe/kuksa-python-sdk/kuksa-client/kuksa/val/v1/val.proto'] failed

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/imu6fe/kuksa.val.services/mock_service/.venv2/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/imu6fe/kuksa.val.services/mock_service/.venv2/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/imu6fe/kuksa.val.services/mock_service/.venv2/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 273, in build_editable
          return hook(wheel_directory, config_settings, metadata_directory)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 436, in build_editable
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 54, in <module>
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 156, in run
          self._create_wheel_file(bdist_wheel)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
          files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands
          self._run_build_subcommands()
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 293, in _run_build_subcommands
          self._safely_run(name)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 301, in _safely_run
          SetuptoolsDeprecationWarning.emit(
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/warnings.py", line 44, in emit
          text = cls._format(summary_, details_, due, see_url or docs_url, kwargs)
        File "/tmp/pip-build-env-dcd8ysz5/overlay/lib/python3.9/site-packages/setuptools/warnings.py", line 62, in _format
          cleandoc(details).format_map(format_args or {}),
      ValueError: Format string contains positional fields
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for kuksa_client
Failed to build kuksa_client
ERROR: Could not build wheels for kuksa_client, which is required to install pyproject.toml-based projects
erikbosch commented 5 months ago

Works for me using Python 3.10. I see that you get an error that it cannot find val.proto. Have you checked out the submodules? I.e. does val.proto exist?

erik@debian4:~/kuksa-python-sdk/kuksa-client$ ls -l kuksa/val/v1/val.proto
lrwxrwxrwx 1 erik erik 61 Nov 15 14:27 kuksa/val/v1/val.proto -> ../../../../submodules/kuksa.val/proto/kuksa/val/v1/val.proto

erik@debian4:~/kuksa-python-sdk/kuksa-client$ ls -l ../submodules/kuksa.val/proto/kuksa/val/v1/val.proto
-rw-r--r-- 1 erik erik 3125 Nov 15 15:57 ../submodules/kuksa.val/proto/kuksa/val/v1/val.proto
erik@debian4:~/kuksa-python-sdk/kuksa-client$ 
erikbosch commented 5 months ago

Do you still have a problem @lukasmittag ?

lukasmittag commented 5 months ago

No, after git clone --recursive <https://....> it works just fine.

lukasmittag commented 5 months ago

reopening as I found the documentation I should've read. If someone encounters the same problem see https://github.com/eclipse-kuksa/kuksa-python-sdk/blob/main/docs/building.md especially doing git submodule update --init