diff --git a/.gitmodules b/.gitmodules index 9fda0ce..5d76261 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,6 @@ + [submodule "kuksa-databroker"] path = submodules/kuksa-databroker - url = https://github.com/SoftwareDefinedVehicle/kuksa-databroker.git - branch = rel-0.5.0 + url = https://github.com/boschglobal/kuksa-databroker.git + branch = prep-rel-0.5.0 diff --git a/docs/building.md b/docs/building.md index f7c81ce..5be01e2 100644 --- a/docs/building.md +++ b/docs/building.md @@ -10,7 +10,7 @@ cd kuksa-client Hint: If you want to use another branch than master exchange the first command with ```console -git submodule update --recursive --remote +git submodule update --recursive --remote --init ``` First we suggest you create a dedicated [python virtual environment](https://docs.python.org/3/library/venv.html) for kuksa-client: diff --git a/kuksa-client/Dockerfile b/kuksa-client/Dockerfile index 4f72368..f0b3019 100644 --- a/kuksa-client/Dockerfile +++ b/kuksa-client/Dockerfile @@ -18,6 +18,9 @@ RUN pip install --upgrade pip build pyinstaller # We must copy the whole repository otherwise version lookup by tag would not work COPY . /kuksa-python-sdk/ WORKDIR /kuksa-python-sdk/kuksa-client +RUN git submodule update --recursive --remote --init +# install files from submodules to kuksa-client repo to generate protos out of it +RUN pip install -r requirements.txt -e . RUN python3 -m build # We install globally on build container, so pyinstaller can easily gather all files diff --git a/kuksa-client/setup.py b/kuksa-client/setup.py index 3c9ac71..f276735 100644 --- a/kuksa-client/setup.py +++ b/kuksa-client/setup.py @@ -43,13 +43,7 @@ def finalize_options(self): def run(self): from grpc_tools import command # pylint: disable=import-outside-toplevel - for root, dirs, files in os.walk(PROTO_PATH): - 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) + command.build_package_protos(".", strict_mode=True) @@ -67,6 +61,13 @@ class SDistCommand(BuildPackageProtos, sdist.sdist): class DevelopCommand(BuildPackageProtos, _develop): def run(self): + for root, dirs, files in os.walk(PROTO_PATH): + 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) self.run_command("build_pb2") super().run()