refactor: Replace per req permit_editable_wheels by a preparer and bu… #10703
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| # Tags for all potential release numbers till 2030. | |
| - "2[0-9].[0-3]" # 20.0 -> 29.3 | |
| - "2[0-9].[0-3].[0-9]+" # 20.0.0 -> 29.3.[0-9]+ | |
| pull_request: | |
| schedule: | |
| - cron: 0 0 * * MON # Run every Monday at 00:00 UTC | |
| workflow_dispatch: | |
| # allow manual runs on branches without a PR | |
| env: | |
| # The "FORCE_COLOR" variable, when set to 1, | |
| # tells Nox to colorize itself. | |
| FORCE_COLOR: "1" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| docs: | |
| name: docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.x" | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| - run: python -m nox -s docs | |
| determine-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tests: ${{ steps.filter.outputs.tests }} | |
| vendoring: ${{ steps.filter.outputs.vendoring }} | |
| steps: | |
| # For pull requests it's not necessary to checkout the code | |
| - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4 | |
| id: filter | |
| with: | |
| filters: | | |
| vendoring: | |
| # Anything that's touching "vendored code" | |
| - "src/pip/_vendor/**" | |
| - "pyproject.toml" | |
| - "noxfile.py" | |
| tests: | |
| # Anything that's touching code-related stuff | |
| - ".github/workflows/ci.yml" | |
| - "src/**" | |
| - "tests/**" | |
| - "noxfile.py" | |
| # The test suite should also run when cutting a release | |
| # (which is the only time this file is modified). | |
| - "NEWS.rst" | |
| if: github.event_name == 'pull_request' | |
| packaging: | |
| name: packaging / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Set up git credentials | |
| run: | | |
| git config --global user.email "pypa-dev@googlegroups.com" | |
| git config --global user.name "pip" | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| - run: python -m nox -s prepare-release -- 99.9 | |
| - run: python -m nox -s build-release -- 99.9 | |
| - run: pipx run check-sdist | |
| vendoring: | |
| name: vendoring | |
| runs-on: ubuntu-latest | |
| needs: [determine-changes] | |
| if: >- | |
| needs.determine-changes.outputs.vendoring == 'true' || | |
| github.event_name != 'pull_request' | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.x" | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| - run: python -m nox -s vendoring | |
| - run: git diff --exit-code | |
| tests-unix: | |
| name: tests / ${{ matrix.python.version || matrix.python }} / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: [determine-changes] | |
| if: >- | |
| needs.determine-changes.outputs.tests == 'true' || | |
| github.event_name != 'pull_request' | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| - "3.15" | |
| - "3.14t" | |
| include: | |
| # Oldest patch release per minor version on ubuntu-latest, | |
| # to catch backport/bug fix regressions. Constrained by what | |
| # actions/setup-python ships for the runner OS (ubuntu-24.04). | |
| # See: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | |
| - os: ubuntu-latest | |
| python: { key: "3.10", version: "3.10.4" } | |
| - os: ubuntu-latest | |
| python: { key: "3.11", version: "3.11.0" } | |
| - os: ubuntu-latest | |
| python: { key: "3.12", version: "3.12.0" } | |
| - os: ubuntu-latest | |
| python: { key: "3.13", version: "3.13.0" } | |
| - os: ubuntu-latest | |
| python: { key: "3.14", version: "3.14.0" } | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python.version || matrix.python }} | |
| allow-prereleases: true | |
| - name: Set PYTHON_GIL | |
| if: endsWith(matrix.python.version || matrix.python, 't') | |
| run: | | |
| echo "PYTHON_GIL=0" >> "$GITHUB_ENV" | |
| - name: Install Ubuntu dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install brz subversion | |
| - name: Install MacOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| DEPS=breezy | |
| if ! which svn; then | |
| DEPS="${DEPS} subversion" | |
| fi | |
| brew install ${DEPS} | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| # Main check | |
| - name: Run unit tests | |
| run: >- | |
| python -m nox -s test-${{ matrix.python.key || matrix.python }} -- | |
| tests/unit | |
| --verbose --numprocesses auto --showlocals | |
| - name: Run integration tests | |
| run: >- | |
| python -m nox -s test-${{ matrix.python.key || matrix.python }} --no-install -- | |
| tests/functional | |
| --verbose --numprocesses auto --showlocals | |
| --durations=15 | |
| tests-windows: | |
| name: tests / ${{ matrix.python }} / ${{ matrix.os }} / ${{ matrix.group }} | |
| runs-on: ${{ matrix.os }}-latest | |
| needs: [determine-changes] | |
| if: >- | |
| needs.determine-changes.outputs.tests == 'true' || | |
| github.event_name != 'pull_request' | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: [Windows] | |
| python: | |
| - "3.10" | |
| # Commented out, since Windows tests are expensively slow, | |
| # only test the oldest and newest Python supported by pip | |
| # - "3.11" | |
| # - "3.12" | |
| # - "3.13" | |
| - "3.14" | |
| - "3.15" | |
| - "3.14t" | |
| # Windows is slow, so shard unit + functional across runners, split by a | |
| # stable hash of each test's node id (see --num-test-groups in conftest). | |
| group: [1, 2, 3] | |
| steps: | |
| # The D: drive is significantly faster than the system C: drive. | |
| # https://github.com/actions/runner-images/issues/8755 | |
| - name: Set TEMP to D:/Temp | |
| run: | | |
| mkdir "D:\\Temp" | |
| echo "TEMP=D:\\Temp" >> $env:GITHUB_ENV | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| allow-prereleases: true | |
| - name: Set PYTHON_GIL | |
| if: endsWith(matrix.python, 't') | |
| run: | | |
| echo "PYTHON_GIL=0" >> "$GITHUB_ENV" | |
| - name: Install Subversion | |
| shell: pwsh | |
| run: | | |
| for ($i = 1; $i -le 3; $i++) { | |
| winget source reset --force | |
| winget source update winget | |
| winget install --source winget --accept-source-agreements --accept-package-agreements -e --id Slik.Subversion | |
| if ($LASTEXITCODE -eq 0) { break } | |
| if ($i -eq 3) { exit $LASTEXITCODE } | |
| Start-Sleep -Seconds (10 * $i) | |
| } | |
| echo "C:\Program Files\SlikSvn\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| # Main check. worksteal rebalances the long tail of slow install tests | |
| # onto idle workers: | |
| # https://pytest-xdist.readthedocs.io/en/stable/distribution.html | |
| - name: Run tests (shard ${{ matrix.group }} of 3) | |
| run: >- | |
| python -m nox -s test-${{ matrix.python }} -- | |
| tests/unit tests/functional | |
| --num-test-groups 3 --test-group ${{ matrix.group }} | |
| --verbose --numprocesses auto --showlocals --durations=15 | |
| --dist worksteal | |
| tests-zipapp: | |
| name: tests / zipapp | |
| # The macos-latest (M1) runners are the fastest available on GHA, even | |
| # beating out the ubuntu-latest runners. The zipapp tests are slow by | |
| # nature, and we don't care where they run, so we pick the fastest one. | |
| runs-on: macos-latest | |
| needs: [determine-changes] | |
| if: >- | |
| needs.determine-changes.outputs.tests == 'true' || | |
| github.event_name != 'pull_request' | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install MacOS dependencies | |
| run: brew install breezy subversion | |
| - run: python -m pip install . | |
| - run: python -m pip install nox | |
| # Main check | |
| - name: Run integration tests | |
| run: >- | |
| python -m nox -s test-3.10 -- | |
| tests/functional | |
| --verbose --numprocesses auto --showlocals | |
| --durations=15 | |
| --use-zipapp | |
| check: # This job does nothing and is only used for the branch protection | |
| if: always() | |
| needs: | |
| - determine-changes | |
| - docs | |
| - packaging | |
| - tests-unix | |
| - tests-windows | |
| - tests-zipapp | |
| - vendoring | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1 | |
| with: | |
| allowed-skips: >- | |
| ${{ | |
| ( | |
| needs.determine-changes.outputs.vendoring != 'true' | |
| && github.event_name == 'pull_request' | |
| ) | |
| && 'vendoring' | |
| || '' | |
| }} | |
| , | |
| ${{ | |
| ( | |
| needs.determine-changes.outputs.tests != 'true' | |
| && github.event_name == 'pull_request' | |
| ) | |
| && ' | |
| tests-unix, | |
| tests-windows, | |
| tests-zipapp, | |
| tests-importlib-metadata, | |
| ' | |
| || '' | |
| }} | |
| jobs: ${{ toJSON(needs) }} |