Skip to content

Commit e818d3a

Browse files
authored
[#6636] feat(client-py): add Python 3.12 support for client testing (#6637)
### What changes were proposed in this pull request? Tests could not be performed with Python 3.12, although the client supports version 3.12. ### Why are the changes needed? It's important to test the Python client with all supported versions. Fix: #6636 ### Does this PR introduce _any_ user-facing change? No at all. It only updates some dependecies: - Patch: - `requests` from `2.32.2` to [`2.32.3`](https://github.com/psf/requests/releases/tag/v2.32.3) (latest) - `dataclasses-json` from `0.6.6` to [`0.6.7`](https://github.com/lidatong/dataclasses-json/releases/tag/v0.6.7) (latest) - Minor: - `llama-index` from `0.10.40` to [`0.11.18`](https://github.com/run-llama/llama_index/blob/main/CHANGELOG.md#llama-index-core-01118) (this version supports python 3.13) - `cachetools` from `5.3.3` to [`5.5.2`](https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst#v552-2025-02-20) (latest) - `pandas` from `2.0.3` to [`2.2.3`](https://github.com/pandas-dev/pandas/releases/tag/v2.2.3) (if py version > 3.8) ### How was this patch tested? [how-to-use-python-client.md](https://github.com/apache/gravitino/blob/main/docs/how-to-use-python-client.md) ### Note I also tried Python 3.13, but it's not supported by `pandas`. See: pandas-dev/pandas#59057
1 parent 0b3c608 commit e818d3a

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

.github/workflows/python-integration-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: |
7474
./gradlew compileDistribution -x test -PjdkVersion=${{ matrix.java-version }}
7575
76-
for pythonVersion in "3.8" "3.9" "3.10" "3.11"
76+
for pythonVersion in "3.8" "3.9" "3.10" "3.11" "3.12"
7777
do
7878
echo "Use Python version ${pythonVersion} to test the Python client."
7979
./gradlew -PjdkVersion=${{ matrix.java-version }} -PpythonVersion=${pythonVersion} -PskipDockerTests=false :clients:client-python:test

clients/client-python/requirements-dev.txt

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
requests==2.32.2
19-
dataclasses-json==0.6.6
18+
requests==2.32.3
19+
dataclasses-json==0.6.7
2020
pylint==3.2.2
2121
black==24.4.2
2222
twine==5.1.1
2323
coverage==7.5.1
24-
pandas==2.0.3
24+
# pandas 2.0.3 is the last version that supports Python 3.8,
25+
# use it if you need to run tests on Python 3.8;
26+
# otherwise, use the version that also supports Python 3.12.
27+
pandas==2.0.3 ; python_version == '3.8'
28+
pandas==2.2.3 ; python_version > '3.8'
2529
pyarrow==15.0.2
26-
llama-index==0.10.40
30+
llama-index==0.11.18
2731
tenacity==8.3.0
28-
cachetools==5.3.3
32+
cachetools==5.5.2
2933
readerwriterlock==1.0.9
3034
docker==7.1.0
3135
pyjwt[crypto]==2.8.0

clients/client-python/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818

1919
# the tools to publish the python client to Pypi
20-
requests==2.32.2
21-
dataclasses-json==0.6.6
20+
requests==2.32.3
21+
dataclasses-json==0.6.7
2222
readerwriterlock==1.0.9
2323
fsspec==2024.3.1
2424
pyarrow==15.0.2
25-
cachetools==5.3.3
25+
cachetools==5.5.2
2626
gcsfs==2024.3.1
2727
s3fs==2024.3.1
2828
ossfs==2023.12.0

docs/how-to-build.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license: "This software is licensed under the Apache License version 2."
1313
+ Linux or macOS operating system
1414
+ Git
1515
+ A Java Development Kit, version 8 to 17, installed in your environment to launch Gradle
16-
+ Python 3.8, 3.9, 3.10, or 3.11 to build the Gravitino Python client
16+
+ Python 3.8, 3.9, 3.10, 3.11, or 3.12 to build the Gravitino Python client
1717
+ Optionally, Docker to run integration tests
1818

1919
:::info Please read the following notes before trying to build Gravitino.
@@ -59,7 +59,7 @@ license: "This software is licensed under the Apache License version 2."
5959

6060
The `./gradlew build` command builds all the Gravitino components, including the Gravitino server, Java and Python clients, Trino and Spark connectors, and more.
6161

62-
For the Python client, the `./gradlew build` command builds the Python client with Python 3.8 by default. If you want to use Python 3.9, 3.10, or 3.11 to build, please modify the property `pythonVersion` to 3.9, 3.10, or 3.11 in the `gradle.properties` file, or specify the version with `-P` like:
62+
For the Python client, the `./gradlew build` command builds the Python client with Python 3.8 by default. If you want to use Python 3.9, 3.10, 3.11, or 3.12 to build, please modify the property `pythonVersion` to 3.9, 3.10, 3.11, or 3.12 in the `gradle.properties` file, or specify the version with `-P` like:
6363

6464
```shell
6565
./gradlew build -PpythonVersion=3.9
@@ -77,6 +77,12 @@ license: "This software is licensed under the Apache License version 2."
7777
./gradlew build -PpythonVersion=3.11
7878
```
7979

80+
Or:
81+
82+
```shell
83+
./gradlew build -PpythonVersion=3.12
84+
```
85+
8086
If you want to build a module on its own, like the Spark connector, you can use Gradle to build a module with a specific name, like so:
8187

8288
```shell

0 commit comments

Comments
 (0)