diff --git a/.github/workflows/_compile_integration_test.yml b/.github/workflows/_compile_integration_test.yml index ea4d4625930..a2ff7b85846 100644 --- a/.github/workflows/_compile_integration_test.yml +++ b/.github/workflows/_compile_integration_test.yml @@ -12,9 +12,6 @@ on: type: string description: "Python version to use" -env: - POETRY_VERSION: "1.8.4" - jobs: build: defaults: @@ -22,25 +19,22 @@ jobs: working-directory: ${{ inputs.working-directory }} runs-on: ubuntu-latest timeout-minutes: 20 - name: "poetry run pytest -m compile tests/integration_tests #${{ inputs.python-version }}" + name: "uv run pytest -m compile tests/integration_tests #${{ inputs.python-version }}" steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ inputs.python-version }} + uv + uses: "./.github/actions/uv_setup" with: python-version: ${{ inputs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: compile-integration - name: Install integration dependencies shell: bash - run: poetry install --with=test_integration,test + run: uv sync --group test --group test_integration - name: Check integration tests compile shell: bash - run: poetry run pytest -m compile tests/integration_tests + run: uv run pytest -m compile tests/integration_tests - name: Ensure the tests did not create any additional files shell: bash diff --git a/.github/workflows/_integration_test.yml b/.github/workflows/_integration_test.yml index 798ea62b44e..98e6f26ffde 100644 --- a/.github/workflows/_integration_test.yml +++ b/.github/workflows/_integration_test.yml @@ -11,9 +11,6 @@ on: type: string description: "Python version to use" -env: - POETRY_VERSION: "1.8.4" - jobs: build: defaults: @@ -24,22 +21,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ inputs.python-version }} + uv + uses: "./.github/actions/uv_setup" with: python-version: ${{ inputs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - name: Install dependencies shell: bash - run: poetry install --with test,test_integration + run: uv sync --group test --group test_integration - name: Install deps outside pyproject if: ${{ startsWith(inputs.working-directory, 'libs/community/') }} shell: bash - run: poetry run pip install "boto3<2" "google-cloud-aiplatform<2" + run: uv pip install "boto3<2" "google-cloud-aiplatform<2" - name: Run integration tests shell: bash diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml index 993fd418211..50eb65ff104 100644 --- a/.github/workflows/_lint.yml +++ b/.github/workflows/_lint.yml @@ -13,7 +13,6 @@ on: description: "Python version to use" env: - POETRY_VERSION: "1.8.4" WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} # This env var allows us to get inline annotations when ruff has complaints. @@ -27,25 +26,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ inputs.python-version }} + uv + uses: "./.github/actions/uv_setup" with: - python-version: ${{ inputs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: lint-with-extras - - - name: Check Poetry File - shell: bash - working-directory: ${{ inputs.working-directory }} - run: | - poetry check - - - name: Check lock file - shell: bash - working-directory: ${{ inputs.working-directory }} - run: | - poetry lock --check + python-version: ${{ inputs.python-version }}= - name: Install dependencies # Also installs dev/lint/test/typing dependencies, to ensure we have @@ -58,17 +42,7 @@ jobs: # It doesn't matter how you change it, any change will cause a cache-bust. working-directory: ${{ inputs.working-directory }} run: | - poetry install --with lint,typing - - - name: Get .mypy_cache to speed up mypy - uses: actions/cache@v4 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2" - with: - path: | - ${{ env.WORKDIR }}/.mypy_cache - key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ inputs.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }} - + uv sync --group lint --group typing - name: Analysing the code with our lint working-directory: ${{ inputs.working-directory }} @@ -87,21 +61,12 @@ jobs: if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') }} working-directory: ${{ inputs.working-directory }} run: | - poetry install --with test + uv sync --group test - name: Install unit+integration test dependencies if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }} working-directory: ${{ inputs.working-directory }} run: | - poetry install --with test,test_integration - - - name: Get .mypy_cache_test to speed up mypy - uses: actions/cache@v4 - env: - SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2" - with: - path: | - ${{ env.WORKDIR }}/.mypy_cache_test - key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ inputs.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }} + uv sync --group test --group test_integration - name: Analysing the code with our lint working-directory: ${{ inputs.working-directory }} diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 5471ed76cbd..e40915350a8 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -12,9 +12,6 @@ on: type: string description: "Python version to use" -env: - POETRY_VERSION: "1.8.4" - jobs: build: defaults: @@ -26,17 +23,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ inputs.python-version }} + uv + uses: "./.github/actions/uv_setup" id: setup-python with: python-version: ${{ inputs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - name: Install dependencies shell: bash - run: poetry install --with test + run: uv sync --all-extras --dev - name: Run core tests shell: bash @@ -48,9 +42,9 @@ jobs: id: min-version shell: bash run: | - poetry run pip install packaging tomli requests - python_version="$(poetry run python --version | awk '{print $2}')" - min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request $python_version)" + uv run pip install packaging tomli requests + python_version="$(uv run python --version | awk '{print $2}')" + min_versions="$(uv run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request $python_version)" echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT" echo "min-versions=$min_versions" @@ -59,8 +53,7 @@ jobs: env: MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }} run: | - poetry run pip install uv - poetry run uv pip install $MIN_VERSIONS + uv run pip install $MIN_VERSIONS make tests working-directory: ${{ inputs.working-directory }} diff --git a/.github/workflows/_test_pydantic.yml b/.github/workflows/_test_pydantic.yml index 50831fd8f12..4501c0ebcc0 100644 --- a/.github/workflows/_test_pydantic.yml +++ b/.github/workflows/_test_pydantic.yml @@ -17,9 +17,6 @@ on: type: string description: "Pydantic version to test." -env: - POETRY_VERSION: "1.8.4" - jobs: build: defaults: @@ -31,21 +28,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ inputs.python-version }} + uv + uses: "./.github/actions/uv_setup" with: python-version: ${{ inputs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - name: Install dependencies shell: bash - run: poetry install --with test + run: uv sync --group test - name: Overwrite pydantic version shell: bash - run: poetry run pip install pydantic~=${{ inputs.pydantic-version }} + run: uv pip install pydantic~=${{ inputs.pydantic-version }} - name: Run core tests shell: bash diff --git a/.github/workflows/check_diffs.yml b/.github/workflows/check_diffs.yml index 8e3bdadff88..14640324016 100644 --- a/.github/workflows/check_diffs.yml +++ b/.github/workflows/check_diffs.yml @@ -17,9 +17,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - POETRY_VERSION: "1.8.4" - jobs: build: runs-on: ubuntu-latest @@ -127,21 +124,17 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.job-configs.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" + - name: Set up Python ${{ matrix.job-configs.python-version }} + uv + uses: "./.github/actions/uv_setup" with: python-version: ${{ matrix.job-configs.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ matrix.job-configs.working-directory }} - cache-key: extended - name: Install dependencies shell: bash run: | - echo "Running extended tests, installing dependencies with poetry..." - poetry install --with test - poetry run pip install uv - poetry run uv pip install -r extended_testing_deps.txt + echo "Running extended tests, installing dependencies with uv..." + uv sync --group test + uv pip install -r extended_testing_deps.txt - name: Run extended tests run: make extended_tests