Skip to content

Commit

Permalink
fix: k8s generated files now properly setuputils installed
Browse files Browse the repository at this point in the history
  • Loading branch information
a9p committed Jun 11, 2023
1 parent decd414 commit a03f4bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sdk/python/v1beta1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ dist/

# Katib gRPC APIs
kubeflow/katib/katib_api_pb2.py
kubeflow/katib/k8s
k8s
10 changes: 7 additions & 3 deletions sdk/python/v1beta1/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
katib_grpc_api_file, "kubeflow/katib/katib_api_pb2.py",
)
# The k8s path should exist if the api file exists (in a <py3.8 compliant way)
shutil.rmtree("kubeflow/katib/k8s", ignore_errors=True)
shutil.rmtree("k8s", ignore_errors=True)
shutil.copytree(
katib_grpc_api_k8s_dep, "kubeflow/katib/k8s",
katib_grpc_api_k8s_dep, "k8s", ignore=shutil.ignore_patterns("__pycache__")
)
# Make k8s a valid setuptools package by adding __init__.py at all levels
for root, _, _ in os.walk("k8s"):
with open(os.path.join(root, "__init__.py"), "w"):
pass

setuptools.setup(
name="kubeflow-katib",
Expand All @@ -50,7 +54,7 @@
url="https://github.com/kubeflow/katib/tree/master/sdk/python/v1beta1",
description="Katib Python SDK for APIVersion v1beta1",
long_description="Katib Python SDK for APIVersion v1beta1",
packages=setuptools.find_packages(include=("kubeflow*")),
packages=setuptools.find_packages(include=("kubeflow*", "k8s*")),
package_data={},
include_package_data=False,
zip_safe=False,
Expand Down

0 comments on commit a03f4bc

Please sign in to comment.