Skip to content

Commit 656c968

Browse files
authored
Merge pull request #237 from neo4j/gha-use-uv
Use uv in Github actions
2 parents ba34d23 + 3da00ee commit 656c968

File tree

6 files changed

+27
-37
lines changed

6 files changed

+27
-37
lines changed

.github/workflows/code-style.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ name: Check code style
44
on:
55
# Triggers the workflow on push or pull request events but only for the "main" branch
66
push:
7-
branches: [ "main" ]
7+
branches: ["main"]
88
pull_request:
99
paths:
1010
- "python-wrapper/**" # python code + its resources
11-
branches: [ "main" ]
11+
branches: ["main"]
1212

1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
@@ -27,15 +27,13 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929

30-
- uses: actions/setup-python@v5
30+
- name: Install uv and set the Python version
31+
uses: astral-sh/setup-uv@v6
3132
with:
32-
python-version: '3.11'
33-
cache: 'pip'
34-
cache-dependency-path: pyproject.toml
35-
- run: pip install ".[dev]"
36-
- run: pip install ".[pandas]"
37-
- run: pip install ".[gds]"
38-
- run: pip install ".[snowflake]"
33+
python-version: "3.11"
34+
enable-cache: true
35+
- run: uv venv
36+
- run: uv pip install ".[dev, pandas, gds, snowflake]"
3937

4038
- name: Check code style
41-
run: cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh
39+
run: source .venv/bin/activate && cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh

.github/workflows/gds-integration-tests.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Run GDS integration tests
44
on:
55
# Triggers the workflow on push or pull request events but only for the "main" branch
66
push:
7-
branches: [ "main" ]
7+
branches: ["main"]
88
# Skip on this check PR to reduce number of AuraDS instances created
99

1010
# Allows you to run this workflow manually from the Actions tab
@@ -28,19 +28,16 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030

31-
- uses: actions/setup-python@v5
31+
- name: Install uv and set the Python version
32+
uses: astral-sh/setup-uv@v6
3233
with:
33-
python-version: "3.12"
34-
cache: 'pip'
35-
cache-dependency-path: pyproject.toml
36-
- run: pip install ".[dev]"
37-
- run: pip install ".[pandas]"
38-
- run: pip install ".[gds]"
39-
- run: pip install ".[snowflake]"
34+
python-version: "3.11"
35+
enable-cache: true
36+
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
4037

4138
- name: Run tests
4239
env:
4340
AURA_API_CLIENT_ID: 4V1HYCYEeoU4dSxThKnBeLvE2U4hSphx
4441
AURA_API_CLIENT_SECRET: ${{ secrets.AURA_API_CLIENT_SECRET }}
4542
AURA_API_TENANT_ID: eee7ec28-6b1a-5286-8e3a-3362cc1c4c78
46-
run: pytest tests/ --include-neo4j-and-gds
43+
run: uv run pytest tests/ --include-neo4j-and-gds

.github/workflows/snowflake-integration-tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131

32-
- uses: actions/setup-python@v5
32+
- name: Install uv and set the Python version
33+
uses: astral-sh/setup-uv@v6
3334
with:
3435
python-version: "3.11"
35-
cache: "pip"
36-
cache-dependency-path: pyproject.toml
37-
- run: pip install ".[dev]"
38-
- run: pip install ".[pandas]"
39-
- run: pip install ".[gds]"
36+
enable-cache: true
37+
- run: uv sync --extra dev --extra pandas --extra snowflake
4038

4139
- name: Run tests
4240
env:

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@ jobs:
3333
steps:
3434
- uses: actions/checkout@v4
3535

36-
- uses: actions/setup-python@v5
36+
- name: Install uv and set the Python version
37+
uses: astral-sh/setup-uv@v6
3738
with:
3839
python-version: ${{ matrix.python-version }}
39-
cache: "pip"
40-
cache-dependency-path: pyproject.toml
41-
- run: pip install ".[dev]"
42-
- run: pip install ".[pandas]"
43-
- run: pip install ".[neo4j]"
44-
- run: pip install ".[gds]"
45-
- run: pip install ".[snowflake]"
40+
enable-cache: true
41+
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
4642

4743
- name: Run tests
48-
run: pytest tests/
44+
run: uv run pytest tests/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ out/*
2727
.idea
2828

2929
.dmypy.json
30+
python-wrapper/uv.lock

scripts/checkstyle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -o pipefail
77

88
python -m ruff check .
99
python -m ruff format --check .
10-
mypy --config-file "${GIT_ROOT}/python-wrapper/pyproject.toml" .
10+
python -m mypy --config-file "${GIT_ROOT}/python-wrapper/pyproject.toml" .
1111

1212

1313
if [ "${SKIP_NOTEBOOKS:-false}" == "true" ]; then

0 commit comments

Comments
 (0)