Skip to content

Commit a03f4bc

Browse files
committed
fix: k8s generated files now properly setuputils installed
1 parent decd414 commit a03f4bc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sdk/python/v1beta1/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dist/
33

44
# Katib gRPC APIs
55
kubeflow/katib/katib_api_pb2.py
6-
kubeflow/katib/k8s
6+
k8s

sdk/python/v1beta1/setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@
3636
katib_grpc_api_file, "kubeflow/katib/katib_api_pb2.py",
3737
)
3838
# The k8s path should exist if the api file exists (in a <py3.8 compliant way)
39-
shutil.rmtree("kubeflow/katib/k8s", ignore_errors=True)
39+
shutil.rmtree("k8s", ignore_errors=True)
4040
shutil.copytree(
41-
katib_grpc_api_k8s_dep, "kubeflow/katib/k8s",
41+
katib_grpc_api_k8s_dep, "k8s", ignore=shutil.ignore_patterns("__pycache__")
4242
)
43+
# Make k8s a valid setuptools package by adding __init__.py at all levels
44+
for root, _, _ in os.walk("k8s"):
45+
with open(os.path.join(root, "__init__.py"), "w"):
46+
pass
4347

4448
setuptools.setup(
4549
name="kubeflow-katib",
@@ -50,7 +54,7 @@
5054
url="https://github.com/kubeflow/katib/tree/master/sdk/python/v1beta1",
5155
description="Katib Python SDK for APIVersion v1beta1",
5256
long_description="Katib Python SDK for APIVersion v1beta1",
53-
packages=setuptools.find_packages(include=("kubeflow*")),
57+
packages=setuptools.find_packages(include=("kubeflow*", "k8s*")),
5458
package_data={},
5559
include_package_data=False,
5660
zip_safe=False,

0 commit comments

Comments
 (0)