diff --git a/.github/workflows/python-package-develop.yml b/.github/workflows/python-package-develop.yml index ee303c091..fc2c24e54 100644 --- a/.github/workflows/python-package-develop.yml +++ b/.github/workflows/python-package-develop.yml @@ -28,8 +28,31 @@ jobs: filters: | labelbox: - 'libs/labelbox/**' + get_sdk_versions: + runs-on: ubuntu-latest + outputs: + sdk_versions: ${{ steps.get_sdk_versions.outputs.sdk_versions }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.event.repository.default_branch }} + + - name: Fetch tags + run: git fetch --tags + + - name: Get Latest SDK versions + id: get_sdk_versions + run: | + sdk_versions=$(git tag --list --sort=-version:refname "v.*" | head -n 4 | jq -R -s -c 'split("\n")[:-1]') + if [ -z "$sdk_versions" ]; then + echo "No tags found" + exit 1 + fi + echo "sdk_versions=$sdk_versions" + echo "sdk_versions=$sdk_versions" >> $GITHUB_OUTPUT build: - needs: ['path-filter'] + needs: ['path-filter', 'get_sdk_versions'] if: ${{ needs.path-filter.outputs.labelbox == 'true' }} strategy: fail-fast: false @@ -38,15 +61,19 @@ jobs: - python-version: 3.8 api-key: STAGING_LABELBOX_API_KEY_2 da-test-key: DA_GCP_LABELBOX_API_KEY + sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[3] }} - python-version: 3.9 api-key: STAGING_LABELBOX_API_KEY_3 da-test-key: DA_GCP_LABELBOX_API_KEY + sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[2] }} - python-version: "3.10" api-key: STAGING_LABELBOX_API_KEY_4 da-test-key: DA_GCP_LABELBOX_API_KEY + sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[1] }} - python-version: 3.11 api-key: STAGING_LABELBOX_API_KEY da-test-key: DA_GCP_LABELBOX_API_KEY + sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[0] }} - python-version: 3.12 api-key: STAGING_LABELBOX_API_KEY_5 da-test-key: DA_GCP_LABELBOX_API_KEY @@ -55,6 +82,7 @@ jobs: python-version: ${{ matrix.python-version }} api-key: ${{ matrix.api-key }} da-test-key: ${{ matrix.da-test-key }} + sdk-version: ${{ matrix.sdk-version }} fixture-profile: true test-env: 'staging' secrets: inherit diff --git a/.github/workflows/python-package-shared.yml b/.github/workflows/python-package-shared.yml index d0d2d1c8d..4311020d8 100644 --- a/.github/workflows/python-package-shared.yml +++ b/.github/workflows/python-package-shared.yml @@ -12,6 +12,9 @@ on: da-test-key: required: true type: string + sdk-version: + required: false + type: string test-env: required: true type: string @@ -41,7 +44,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} + ref: ${{ inputs.sdk-version || github.head_ref }} - uses: ./.github/actions/python-package-shared-setup with: rye-version: ${{ vars.RYE_VERSION }} @@ -61,7 +64,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} + ref: ${{ inputs.sdk-version || github.head_ref }} - uses: ./.github/actions/python-package-shared-setup with: rye-version: ${{ vars.RYE_VERSION }} diff --git a/.python-version b/.python-version index 143c2f5d0..9ad6380c1 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.19 +3.8.18 diff --git a/pyproject.toml b/pyproject.toml index ebce059f5..6e0d208c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ members = ["libs/*", "examples"] [tool.pytest.ini_options] # https://github.com/pytest-dev/pytest-rerunfailures/issues/99 -addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n auto --cov=labelbox --import-mode=importlib --order-group-scope=module" +addopts = "-rP -vvv" markers = """ slow: marks tests as slow (deselect with '-m "not slow"') """