Skip to content

Commit

Permalink
Python SDK LakeFSClient generated properties per API (#6296)
Browse files Browse the repository at this point in the history
* Python SDK genrate code for LakeFSClient - property per API

Each API will have `<name>_api` property as part of the LakeFSClient.
For backward compatibility all current properties, without `_api` were
added but will be deprecated

* use properties to deprecate old members
  • Loading branch information
nopcoder authored Aug 1, 2023
1 parent a26609e commit 7f1e8ee
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 31 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ tools: ## Install tools
client-python: api/swagger.yml ## Generate SDK for Python client
# remove the build folder as it also holds lakefs_client folder which keeps because we skip it during find
rm -rf clients/python/build; cd clients/python && \
find . -depth -name lakefs_client -prune -o ! \( -name client.py -or -name Gemfile -or -name Gemfile.lock -or -name _config.yml -or -name .openapi-generator-ignore -or -name templates -or -name setup.mustache \) -delete
find . -depth -name lakefs_client -prune -o ! \( -name Gemfile -or -name Gemfile.lock -or -name _config.yml -or -name .openapi-generator-ignore -or -name templates -or -name setup.mustache -or -name client.mustache \) -delete
$(OPENAPI_GENERATOR) generate \
-i /mnt/$< \
-g python \
Expand All @@ -121,6 +121,7 @@ client-python: api/swagger.yml ## Generate SDK for Python client
--http-user-agent "lakefs-python-sdk/$(PACKAGE_VERSION)" \
--git-user-id treeverse --git-repo-id lakeFS \
--additional-properties=infoName=Treeverse,[email protected],packageName=lakefs_client,packageVersion=$(PACKAGE_VERSION),projectName=lakefs-client,packageUrl=https://github.com/treeverse/lakeFS/tree/master/clients/python \
-c /mnt/clients/python-codegen-config.yaml \
-o /mnt/clients/python

client-java: api/swagger.yml ## Generate SDK for Java (and Scala) client
Expand Down
5 changes: 5 additions & 0 deletions clients/python-codegen-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files:
client.mustache:
templateType: SupportingFiles
folder: lakefs_client
destinationFilename: client.py
1 change: 0 additions & 1 deletion clients/python/.openapi-generator-ignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/.openapi-generator/FILES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 142 additions & 29 deletions clients/python/lakefs_client/client.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 146 additions & 0 deletions clients/python/templates/client.mustache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7f1e8ee

Please sign in to comment.