From ddd2e08649de464ee55030b9f79c6f996293bc6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 21:47:41 +0100 Subject: [PATCH 1/6] Switch from pip to uv faster dependency resolution --- .github/workflows/code-style.yml | 19 ++++++++----------- .github/workflows/gds-integration-tests.yml | 17 +++++++---------- .../workflows/snowflake-integration-tests.yml | 10 ++++------ .github/workflows/unit-tests.yml | 14 +++++--------- .gitignore | 1 + 5 files changed, 25 insertions(+), 36 deletions(-) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 5ff7416..addd3d7 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -4,11 +4,11 @@ name: Check code style on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] + branches: ["main"] pull_request: paths: - "python-wrapper/**" # python code + its resources - branches: [ "main" ] + branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -27,15 +27,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv and set the Python version + uses: astral-sh/setup-uv@v6 with: - python-version: '3.11' - cache: 'pip' - cache-dependency-path: pyproject.toml - - run: pip install ".[dev]" - - run: pip install ".[pandas]" - - run: pip install ".[gds]" - - run: pip install ".[snowflake]" + python-version: "3.11" + enable-cache: true + - run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake - name: Check code style - run: cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh + run: cd ${GITHUB_WORKSPACE} && uv run ./scripts/checkstyle.sh diff --git a/.github/workflows/gds-integration-tests.yml b/.github/workflows/gds-integration-tests.yml index d03794b..2f901bf 100644 --- a/.github/workflows/gds-integration-tests.yml +++ b/.github/workflows/gds-integration-tests.yml @@ -4,7 +4,7 @@ name: Run GDS integration tests on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] + branches: ["main"] # Skip on this check PR to reduce number of AuraDS instances created # Allows you to run this workflow manually from the Actions tab @@ -28,19 +28,16 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv and set the Python version + uses: astral-sh/setup-uv@v6 with: - python-version: "3.12" - cache: 'pip' - cache-dependency-path: pyproject.toml - - run: pip install ".[dev]" - - run: pip install ".[pandas]" - - run: pip install ".[gds]" - - run: pip install ".[snowflake]" + python-version: "3.11" + enable-cache: true + - run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake - name: Run tests env: AURA_API_CLIENT_ID: 4V1HYCYEeoU4dSxThKnBeLvE2U4hSphx AURA_API_CLIENT_SECRET: ${{ secrets.AURA_API_CLIENT_SECRET }} AURA_API_TENANT_ID: eee7ec28-6b1a-5286-8e3a-3362cc1c4c78 - run: pytest tests/ --include-neo4j-and-gds \ No newline at end of file + run: uv run pytest tests/ --include-neo4j-and-gds diff --git a/.github/workflows/snowflake-integration-tests.yml b/.github/workflows/snowflake-integration-tests.yml index f8f3d6c..b28d644 100644 --- a/.github/workflows/snowflake-integration-tests.yml +++ b/.github/workflows/snowflake-integration-tests.yml @@ -29,14 +29,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv and set the Python version + uses: astral-sh/setup-uv@v6 with: python-version: "3.11" - cache: "pip" - cache-dependency-path: pyproject.toml - - run: pip install ".[dev]" - - run: pip install ".[pandas]" - - run: pip install ".[gds]" + enable-cache: true + - run: uv sync --extra dev --extra pandas --extra snowflake - name: Run tests env: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 91208a4..413ae06 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -33,16 +33,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv and set the Python version + uses: astral-sh/setup-uv@v6 with: python-version: ${{ matrix.python-version }} - cache: "pip" - cache-dependency-path: pyproject.toml - - run: pip install ".[dev]" - - run: pip install ".[pandas]" - - run: pip install ".[neo4j]" - - run: pip install ".[gds]" - - run: pip install ".[snowflake]" + enable-cache: true + - run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake - name: Run tests - run: pytest tests/ + run: uv run pytest tests/ diff --git a/.gitignore b/.gitignore index 60dddf2..e0904c4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ out/* .idea .dmypy.json +python-wrapper/uv.lock From 77617210648f322c0ef5b58fcf9d2861ca461cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 21:58:52 +0100 Subject: [PATCH 2/6] Fix checkstyle uv run --- .github/workflows/code-style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index addd3d7..697dcc1 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -35,4 +35,4 @@ jobs: - run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake - name: Check code style - run: cd ${GITHUB_WORKSPACE} && uv run ./scripts/checkstyle.sh + run: cd ${GITHUB_WORKSPACE} && uv run bash ./scripts/checkstyle.sh From 7c842a011f128772bc518554f010f1c124112287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 22:10:37 +0100 Subject: [PATCH 3/6] Install checkstyle deps via uv pip hoping to resolve dependency resolution error for ruff --- .github/workflows/code-style.yml | 2 +- scripts/checkstyle.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 697dcc1..1400296 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -32,7 +32,7 @@ jobs: with: python-version: "3.11" enable-cache: true - - run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake + - run: uv pip install ".[dev, pandas, gds, snowflake]" - name: Check code style run: cd ${GITHUB_WORKSPACE} && uv run bash ./scripts/checkstyle.sh diff --git a/scripts/checkstyle.sh b/scripts/checkstyle.sh index 6d5d70d..45bc429 100755 --- a/scripts/checkstyle.sh +++ b/scripts/checkstyle.sh @@ -7,7 +7,7 @@ set -o pipefail python -m ruff check . python -m ruff format --check . -mypy --config-file "${GIT_ROOT}/python-wrapper/pyproject.toml" . +python -m mypy --config-file "${GIT_ROOT}/python-wrapper/pyproject.toml" . if [ "${SKIP_NOTEBOOKS:-false}" == "true" ]; then From b47994da1526de59a0dd6ed51a561c58cc6a3522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 22:15:10 +0100 Subject: [PATCH 4/6] Activate venv for codestyle gha --- .github/workflows/code-style.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 1400296..b3c0c4c 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -32,6 +32,7 @@ jobs: with: python-version: "3.11" enable-cache: true + - run: uv venv && source .venv/bin/activate - run: uv pip install ".[dev, pandas, gds, snowflake]" - name: Check code style From 2a301f57c55eea06fc501b9dc90333e5fecf773f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 22:16:30 +0100 Subject: [PATCH 5/6] Dont run checkstyle via uv work around issue of uv not finding ruff --- .github/workflows/code-style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index b3c0c4c..04078a8 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -36,4 +36,4 @@ jobs: - run: uv pip install ".[dev, pandas, gds, snowflake]" - name: Check code style - run: cd ${GITHUB_WORKSPACE} && uv run bash ./scripts/checkstyle.sh + run: cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh From 3da00eeb5956d81deb57cea23c34f12357b5b839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Sun, 26 Oct 2025 22:18:23 +0100 Subject: [PATCH 6/6] Fix sourcing venv --- .github/workflows/code-style.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 04078a8..8d4eed4 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -32,8 +32,8 @@ jobs: with: python-version: "3.11" enable-cache: true - - run: uv venv && source .venv/bin/activate + - run: uv venv - run: uv pip install ".[dev, pandas, gds, snowflake]" - name: Check code style - run: cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh + run: source .venv/bin/activate && cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh