@@ -13,29 +13,57 @@ jobs:
1313 fail-fast : false
1414 matrix :
1515 python-version : ["3.9", "3.10", "3.11", "3.12"]
16+
1617 steps :
18+ # TODO: upgrade to HugeGraph 1.5.0 (need to update the test cases)
19+ - name : Prepare HugeGraph Server Environment
20+ run : |
21+ docker run -d --name=graph -p 8080:8080 -e PASSWORD=admin hugegraph/hugegraph:1.3.0
22+ #sleep 5
23+
1724 - uses : actions/checkout@v4
25+
1826 - name : Set up Python ${{ matrix.python-version }}
1927 uses : actions/setup-python@v5
2028 with :
2129 python-version : ${{ matrix.python-version }}
22- cache : ' pip '
23- - name : Install dependencies
30+
31+ - name : Install uv
2432 run : |
25- python -m pip install --upgrade pip
26- pip install pytest
27- pip install -r ./hugegraph-python-client/requirements.txt
28- - name : Prepare HugeGraph Server Environment
29- # TODO: update the HugeGraph Server version to 1.5.0
33+ curl -LsSf https://astral.sh/uv/install.sh | sh
34+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
35+
36+ - name : Cache dependencies
37+ id : cache-deps
38+ uses : actions/cache@v4
39+ with :
40+ path : |
41+ .venv
42+ ~/.cache/uv
43+ ~/.cache/pip
44+ key : ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('hugegraph-python-client/requirements.txt') }}
45+ restore-keys : |
46+ ${{ runner.os }}-venv-${{ matrix.python-version }}-
47+ ${{ runner.os }}-venv-
48+
49+ # TODO: use pyproject.toml later
50+ - name : Install dependencies
51+ if : steps.cache-deps.outputs.cache-hit != 'true'
3052 run : |
31- docker run -d --name=graph -p 8080:8080 -e PASSWORD=admin hugegraph/hugegraph:1.3.0
32- sleep 20
53+ uv venv
54+ source .venv/bin/activate
55+ uv pip install pytest
56+ uv pip install -r ./hugegraph-python-client/requirements.txt
57+
3358 - name : Test example
3459 run : |
60+ ls -al && source .venv/bin/activate
3561 export PYTHONPATH=$(pwd)/hugegraph-python-client/src
3662 echo ${PYTHONPATH}
3763 python hugegraph-python-client/src/pyhugegraph/example/hugegraph_example.py
64+
3865 - name : Test with pytest
3966 run : |
67+ ls -al ../ && source ../.venv/bin/activate
4068 pytest
4169 working-directory : hugegraph-python-client
0 commit comments