Skip to content

Commit

Permalink
Remove Python Legacy Client
Browse files Browse the repository at this point in the history
  • Loading branch information
N-o-Z committed Dec 9, 2024
1 parent 6bb2b58 commit c3214fd
Show file tree
Hide file tree
Showing 415 changed files with 4 additions and 79,961 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/python-api-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,66 +72,3 @@ jobs:
destination_folder: /
user_email: '[email protected]'
user_name: 'python-docs-action'

deploy-legacy:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
# Extract the version to 'version' based on workflow_dispatch or triggered tag in the published event
- name: Extract version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "tag=$(echo ${{ github.event.inputs.tag }} | sed s/^v//)" >> $GITHUB_OUTPUT
else
echo "tag=$(echo ${GITHUB_REF##*/} | sed s/^v//)" >> $GITHUB_OUTPUT
fi
id: version

- name: Python build and make legacy package
run: make package-python-client PACKAGE_VERSION=${{ steps.version.outputs.tag }}

- name: Python legacy SDK legacy publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: clients/python-legacy/dist/
verbose: true

- name: Extract docs version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "tag=$(echo ${{ github.event.inputs.tag }} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
else
echo "tag=$(echo ${GITHUB_REF##*/} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
fi
id: docver

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: clients/python-legacy
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Build legacy release as latest
working-directory: clients/python-legacy
run: bundle exec jekyll build -d _site -b /

- name: Build legacy release ${{ steps.docver.outputs.tag }}
working-directory: clients/python-legacy
run: bundle exec jekyll build -d _site/${{ steps.docver.outputs.tag }} -b /${{ steps.docver.outputs.tag }}

- name: Publish legacy to docs repository
uses: dmnemec/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN }}
with:
source_file: clients/python-legacy/_site/.
destination_repo: treeverse/docs-lakefs-python
destination_folder: /
user_email: '[email protected]'
user_name: 'python-docs-action'
33 changes: 4 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ UID_GID := $(shell id -u):$(shell id -g)
CLIENT_JARS_BUCKET="s3://treeverse-clients-us-east/"

# https://openapi-generator.tech
OPENAPI_LEGACY_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v5.3.0
OPENAPI_LEGACY_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_LEGACY_GENERATOR_IMAGE)
OPENAPI_GENERATOR_IMAGE=treeverse/openapi-generator-cli:v7.0.0.1
OPENAPI_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE)
OPENAPI_RUST_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v7.5.0
Expand Down Expand Up @@ -110,23 +108,7 @@ tools: ## Install tools
$(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
$(GOCMD) install github.com/bufbuild/buf/cmd/buf@$(BUF_CLI_VERSION)

client-python: sdk-python-legacy sdk-python

sdk-python-legacy: api/swagger.yml ## Generate SDK for Python client - openapi generator version 5.3.0
# remove the build folder as it also holds lakefs_client folder which keeps because we skip it during find
rm -rf clients/python-legacy/build; cd clients/python-legacy && \
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 -or -name python-codegen-config.yaml \) -delete
$(OPENAPI_LEGACY_GENERATOR) generate \
-i /mnt/$< \
-g python \
-t /mnt/clients/python-legacy/templates \
--package-name lakefs_client \
--http-user-agent "lakefs-python-sdk/$(PACKAGE_VERSION)-legacy" \
--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-legacy \
-c /mnt/clients/python-legacy/python-codegen-config.yaml \
-o /mnt/clients/python-legacy \
--ignore-file-override /mnt/clients/python/.openapi-generator-ignore
client-python: sdk-python

sdk-python: api/swagger.yml ## Generate SDK for Python client - openapi generator version 7.0.0
# remove the build folder as it also holds lakefs_sdk folder which keeps because we skip it during find
Expand Down Expand Up @@ -166,14 +148,10 @@ client-java: api/swagger.yml api/java-gen-ignore ## Generate SDK for Java (and
--additional-properties disallowAdditionalPropertiesIfNotPresent=false,useSingleRequestParameter=true,hideGenerationTimestamp=true,artifactVersion=$(PACKAGE_VERSION),parentArtifactId=lakefs-parent,parentGroupId=io.lakefs,parentVersion=0,groupId=io.lakefs,artifactId='sdk',artifactDescription='lakeFS OpenAPI Java client',artifactUrl=https://lakefs.io,apiPackage=io.lakefs.clients.sdk,modelPackage=io.lakefs.clients.sdk.model,mainPackage=io.lakefs.clients.sdk,[email protected],developerName='Treeverse lakeFS dev',developerOrganization='lakefs.io',developerOrganizationUrl='https://lakefs.io',licenseName=apache2,licenseUrl=http://www.apache.org/licenses/,scmConnection=scm:git:[email protected]:treeverse/lakeFS.git,scmDeveloperConnection=scm:git:[email protected]:treeverse/lakeFS.git,scmUrl=https://github.com/treeverse/lakeFS \
-o /mnt/clients/java

.PHONY: clients client-python sdk-python-legacy sdk-python client-java
.PHONY: clients client-python sdk-python client-java
clients: client-python client-java sdk-rust

package-python: package-python-client package-python-sdk

package-python-client: client-python
$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt -e HOME=/tmp/ -w /mnt/clients/python-legacy $(PYTHON_IMAGE) /bin/bash -c \
"python -m pip install build --user && python -m build --sdist --wheel --outdir dist/"
package-python: package-python-sdk package-python-wrapper

package-python-sdk: sdk-python
$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt -e HOME=/tmp/ -w /mnt/clients/python $(PYTHON_IMAGE) /bin/bash -c \
Expand Down Expand Up @@ -294,10 +272,7 @@ validate-wrapgen-testcode: gen-code
validate-reference:
git diff --quiet -- docs/reference/cli.md || (echo "Modification verification failed! docs/reference/cli.md"; false)

validate-client-python: validate-python-sdk-legacy validate-python-sdk

validate-python-sdk-legacy:
git diff --quiet -- clients/python-legacy || (echo "Modification verification failed! python client"; false)
validate-client-python: validate-python-sdk

validate-python-sdk:
git diff --quiet -- clients/python || (echo "Modification verification failed! python client"; false)
Expand Down
1 change: 0 additions & 1 deletion clients/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
java/** linguist-generated
python/** linguist-generated
python-legacy/** linguist-generated
python/Gemfile linguist-generated=false
python/Gemfile.lock linguist-generated=false
python/_config.yml linguist-generated=false
Expand Down
66 changes: 0 additions & 66 deletions clients/python-legacy/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions clients/python-legacy/.gitlab-ci.yml

This file was deleted.

27 changes: 0 additions & 27 deletions clients/python-legacy/.openapi-generator-ignore

This file was deleted.

Loading

0 comments on commit c3214fd

Please sign in to comment.