-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bump-pytest-8
- Loading branch information
Showing
487 changed files
with
246,183 additions
and
4,684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
name: Cloud API Compatibility | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/api-compatibility-tests.yaml | ||
- "**/*.py" | ||
- requirements*.txt | ||
- setup.cfg | ||
- compat-tests | ||
push: | ||
branches: | ||
- main | ||
|
||
# Limit concurrency by workflow/branch combination. | ||
# | ||
# For pull request builds, pushing additional changes to the | ||
# branch will cancel prior in-progress and pending builds. | ||
# | ||
# For builds triggered on a branch push, additional changes | ||
# will wait for prior builds to complete before starting. | ||
# | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
compatibility-tests: | ||
|
||
timeout-minutes: 10 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Versioneer only generates correct versions with a full fetch | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
submodules: true | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
id: setup_python | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: UV Cache | ||
# Manually cache the uv cache directory | ||
# until setup-python supports it: | ||
# https://github.com/actions/setup-python/issues/822 | ||
uses: actions/cache@v4 | ||
id: cache-uv | ||
with: | ||
path: ~/.cache/uv | ||
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt') }} | ||
|
||
- name: Install packages | ||
run: | | ||
python -m pip install -U uv | ||
uv pip install --upgrade --system -e .[dev] 'pydantic>=2.4,<3' | ||
- name: Create Cloud OpenAPI JSON | ||
working-directory: compat-tests | ||
run: curl https://api.prefect.cloud/api/openapi.json > cloud_schema.json | ||
|
||
- name: Create OSS OpenAPI JSON | ||
working-directory: compat-tests | ||
run: python ../scripts/generate_oss_openapi_schema.py | ||
|
||
- name: Run API compatibility tests | ||
working-directory: compat-tests | ||
run: pytest -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
.github/workflows/create-tags-for-changed-integrations.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Create tags for changed integrations | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-integrations-tags: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U packaging gh-util | ||
- name: Get previous tag | ||
id: get-previous-tag | ||
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | ||
|
||
- name: Push tags for changed integrations | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PREVIOUS_TAG: ${{ steps.get-previous-tag.outputs.tag }} | ||
CURRENT_COMMIT: ${{ github.sha }} | ||
|
||
run: python scripts/create_tags_for_changed_collections.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Integrations Packages Tests | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "src/integrations/*/**" | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "src/integrations/*/**" | ||
|
||
jobs: | ||
prepare-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
- name: Generate matrix | ||
id: set-matrix | ||
run: | | ||
if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then | ||
COMMIT_RANGE="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" | ||
else | ||
COMMIT_RANGE="${{ github.event.before }}..${{ github.event.after }}" | ||
fi | ||
python scripts/generate_integration_package_tests_matrix.py "$COMMIT_RANGE" > matrix.json | ||
cat matrix.json | ||
echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT | ||
run-tests: | ||
name: Run Tests for ${{ matrix.package }} on Python ${{ matrix.python-version }} | ||
needs: prepare-matrix | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} | ||
fail-fast: false | ||
steps: | ||
- name: Display current test matrix | ||
run: echo '${{ toJSON(matrix) }}' | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
id: setup_python | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: UV Cache | ||
# Manually cache the uv cache directory | ||
# until setup-python supports it: | ||
# https://github.com/actions/setup-python/issues/822 | ||
uses: actions/cache@v4 | ||
id: cache-uv | ||
with: | ||
path: ~/.cache/uv | ||
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles(format('src/integrations/{0}/pyproject.toml', matrix.package)) }} | ||
|
||
- name: Install dependencies | ||
working-directory: src/integrations/${{ matrix.package }} | ||
run: | | ||
python -m pip install -U uv | ||
uv pip install --upgrade --system -e .[dev] | ||
- name: Run tests | ||
env: | ||
PREFECT_API_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///./orion-tests.db" | ||
working-directory: src/integrations/${{ matrix.package }} | ||
run: > | ||
pytest tests | ||
--numprocesses auto | ||
--maxprocesses 6 | ||
--dist loadscope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Publish integration package to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "prefect-\\w+-[0-9]+.*" | ||
|
||
jobs: | ||
build-pypi-dists: | ||
name: Build Python package | ||
runs-on: ubuntu-latest | ||
outputs: | ||
PACKAGE_NAME: ${{ steps.package_name.outputs.PACKAGE_NAME }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.commit }} | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Extract package name | ||
id: package_name | ||
run: | | ||
TAG_NAME=${{ github.ref_name }} | ||
PACKAGE_NAME=$(echo $TAG_NAME | sed 's/-[0-9][.0-9]*$//') | ||
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
cache: "pip" | ||
cache-dependency-path: "requirements*.txt" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade build | ||
working-directory: src/integrations/${{ steps.package_name.outputs.PACKAGE_NAME }} | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --wheel | ||
python -m build --sdist | ||
working-directory: src/integrations/${{ steps.package_name.outputs.PACKAGE_NAME }} | ||
|
||
- name: Publish build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.package_name.outputs.PACKAGE_NAME }}-pypi-dists | ||
path: "./src/integrations/${{ steps.package_name.outputs.PACKAGE_NAME }}/dist" | ||
|
||
publish-pypi-dists: | ||
name: Publish to PyPI | ||
environment: "prod" | ||
needs: build-pypi-dists | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ needs.build-pypi-dists.outputs.PACKAGE_NAME}}-pypi-dists | ||
path: "./dist" | ||
|
||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.