From 12b9e16bb4f2054fe074945e3e68d8d2fd78f5e5 Mon Sep 17 00:00:00 2001 From: Marcin Wojtyczka Date: Tue, 4 Feb 2025 15:14:05 +0100 Subject: [PATCH] disable integration tests on forks Require pyspark dependencies only for tests and cli --- .github/workflows/acceptance.yml | 8 ++++++-- labs.yml | 1 + pyproject.toml | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index f40d6d57..66f529bc 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -20,7 +20,9 @@ concurrency: jobs: integration: - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false + # Only run this job for PRs from branches on the main repository and not from forks. + # Workflows triggered by PRs from forks don't have access to the tool environment. + if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork environment: tool runs-on: larger steps: @@ -55,7 +57,9 @@ jobs: ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} serverless_integration: - if: github.event_name == 'pull_request' && github.event.pull_request.draft == false + # Only run this job for PRs from branches on the main repository and not from forks. + # Workflows triggered by PRs from forks don't have access to the tool environment. + if: github.event_name == 'pull_request' && !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork environment: tool runs-on: larger env: diff --git a/labs.yml b/labs.yml index 24d6e2bb..a5419efd 100644 --- a/labs.yml +++ b/labs.yml @@ -3,6 +3,7 @@ name: dqx description: Data Quality Framework for PySpark Workloads install: script: src/databricks/labs/dqx/installer/install.py + extras: cli uninstall: script: src/databricks/labs/dqx/installer/uninstall.py entrypoint: src/databricks/labs/dqx/cli.py diff --git a/pyproject.toml b/pyproject.toml index 2df80299..cc04efce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,9 +30,11 @@ classifiers = [ dependencies = ["databricks-labs-blueprint>=0.9.1,<0.10", "databricks-sdk~=0.30", "databricks-labs-lsql>=0.5,<0.15", - "pyspark~=3.5.0" # required by the CLI to work correctly ] +[project.optional-dependencies] +cli = ["pyspark~=3.5.0"] + [project.entry-points.databricks] runtime = "databricks.labs.dqx.runtime:main" @@ -70,6 +72,7 @@ dependencies = [ "types-PyYAML~=6.0.12", "types-requests~=2.31.0", "databricks-connect~=15.4", + "pyspark~=3.5.0", ] python="3.10"