| name: Python Dependency Tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '10 2 * * *' | |
| pull_request: | |
| branches: ['master', 'release-*'] | |
| tags: 'v*' | |
| # paths where Beam Python's dependencies are configured. | |
| paths: ['sdks/python/setup.py', 'sdks/python/pyproject.toml', 'sdks/python/container/base_image_requirements_manual.txt', 'release/trigger_all_tests.json'] | |
| # This allows a subsequently queued workflow run to interrupt previous runs | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.sender.login}}' | |
| cancel-in-progress: true | |
| jobs: | |
| python_dependency_tests: | |
| permissions: | |
| issues: write | |
| name: 'Python Dependency Tests' | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| params: [ | |
| { "py_ver": "3.11", "py_env": "py311" }, | |
| { "py_ver": "3.12", "py_env": "py312" }, | |
| { "py_ver": "3.13", "py_env": "py313" }, | |
| { "py_ver": "3.14", "py_env": "py314" }, | |
| ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Install libsnappy-dev | |
| run: sudo apt-get update && sudo apt-get install -y libsnappy-dev | |
| - name: Install python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.params.py_ver }} | |
| - name: Install base_image_requirements.txt | |
| working-directory: ./sdks/python | |
| run: pip install --no-deps -r container/${{ matrix.params.py_env }}/base_image_requirements.txt | |
| - name: Install Apache Beam | |
| working-directory: ./sdks/python | |
| run: pip install --no-deps -v -e .[test,gcp,interactive,dataframe,aws,azure] | |
| - name: Run pip check | |
| run: pip check || (echo "Workflow failed. It can be due to conflicting dependencies or does not include required Beam's dependencies. If Beam dependencies have changed, you need to regenerate base_image_requirements.txt. See https://s.apache.org/beam-python-requirements-generate" && exit 1) |