World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#2518] feat(build): support Github CI for client-python (#2684)
Peidian li004fe892d00d
diff --git a/.github/workflows/backend-integration-test.yml b/.github/workflows/backend-integration-test.ymlindex 0925fad7cc..795e26c62a 100644--- a/.github/workflows/backend-integration-test.yml+++ b/.github/workflows/backend-integration-test.yml@@ -26,7 +26,10 @@ jobs:- api/**- bin/**- catalogs/**- - clients/**+ - clients/client-java/**+ - clients/client-java-runtime/**+ - clients/filesystem-hadoop3/**+ - clients/filesystem-hadoop3-runtime/**- common/**- conf/**- core/**diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 9e262a1426..3e2b62de48 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -27,7 +27,10 @@ jobs:- api/**- bin/**- catalogs/**- - clients/**+ - clients/client-java/**+ - clients/client-java-runtime/**+ - clients/filesystem-hadoop3/**+ - clients/filesystem-hadoop3-runtime/**- common/**- conf/**- core/**diff --git a/.github/workflows/frontend-integration-test.yml b/.github/workflows/frontend-integration-test.ymlindex de2062910f..9c5648a6c5 100644--- a/.github/workflows/frontend-integration-test.yml+++ b/.github/workflows/frontend-integration-test.yml@@ -26,7 +26,10 @@ jobs:- api/**- bin/**- catalogs/**- - clients/**+ - clients/client-java/**+ - clients/client-java-runtime/**+ - clients/filesystem-hadoop3/**+ - clients/filesystem-hadoop3-runtime/**- common/**- conf/**- core/**diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.ymlnew file mode 100644index 0000000000..3e261024ec--- /dev/null+++ b/.github/workflows/python-ci.yml@@ -0,0 +1,25 @@+name: 'Python CI'++on:+ push:+ branches: [ "main", "branch-*" ]++ pull_request:+ branches: [ "main", "branch-*" ]+ paths:+ - 'clients/client-python/**'+concurrency:+ group: ${{ github.worklfow }}-${{ github.event.pull_request.number || github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_requests' }}++jobs:+ test:+ runs-on: ubuntu-latest+ strategy:+ matrix:+ python: [ '3.8', '3.9', '3.10', '3.11' ]++ steps:+ - uses: actions/checkout@v4+ - name: Unit tests+ run: ./gradlew clean clients:client-python:test\ No newline at end of filediff --git a/clients/client-python/build.gradle.kts b/clients/client-python/build.gradle.ktsnew file mode 100644index 0000000000..9c48201a14--- /dev/null+++ b/clients/client-python/build.gradle.kts@@ -0,0 +1,37 @@+/*+ * Copyright 2024 Datastrato Pvt Ltd.+ * This software is licensed under the Apache License version 2.+ */++tasks.withType(Exec::class) {+ workingDir = file("${project.projectDir}")+}++tasks {+ val pythonVersion by registering(Exec::class) {+ commandLine("python", "--version")+ }++ val installPip by registering(Exec::class) {+ dependsOn(pythonVersion)+ commandLine("python", "-m", "pip", "install", "--upgrade", "pip")+ }++ val installDeps by registering(Exec::class) {+ dependsOn(installPip)+ commandLine("python", "-m", "pip", "install", "-r", "requirements.txt")+ }++ val pyTest by registering(Exec::class) {+ dependsOn(installDeps)+ commandLine("pytest", "${project.projectDir}/tests")+ }++ test {+ dependsOn(pyTest)+ }++ clean {+ delete("build")+ }+}diff --git a/settings.gradle.kts b/settings.gradle.ktsindex a98a37c21e..bf872bc0ef 100644--- a/settings.gradle.kts+++ b/settings.gradle.kts@@ -20,7 +20,13 @@ include()include("catalogs:catalog-hadoop")include("catalogs:catalog-messaging-kafka")-include("clients:client-java", "clients:client-java-runtime", "clients:filesystem-hadoop3", "clients:filesystem-hadoop3-runtime")+include(+ "clients:client-java",+ "clients:client-java-runtime",+ "clients:filesystem-hadoop3",+ "clients:filesystem-hadoop3-runtime",+ "clients:client-python"+)include("trino-connector")include("spark-connector")include("web")