diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 5ff74165..8d4eed4d 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,13 @@ 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 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 diff --git a/.github/workflows/gds-integration-tests.yml b/.github/workflows/gds-integration-tests.yml index d03794bd..2f901bf9 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 f8f3d6ce..b28d6446 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 91208a4c..413ae061 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 60dddf2d..e0904c4b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ out/* .idea .dmypy.json +python-wrapper/uv.lock diff --git a/scripts/checkstyle.sh b/scripts/checkstyle.sh index 6d5d70d3..45bc4295 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