diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/ci.yml similarity index 52% rename from .azure-pipelines/windows.yml rename to .azure-pipelines/ci.yml index 9d1bf5385d0..aafb646638c 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/ci.yml @@ -1,8 +1,10 @@ jobs: -- template: jobs/test-windows.yml +- template: jobs/test.yml parameters: - vmImage: vs2017-win2016 + vmImage: macos-10.14 + osName: MacOS -- template: jobs/package.yml +- template: jobs/test-windows.yml parameters: vmImage: vs2017-win2016 + osName: Windows diff --git a/.azure-pipelines/jobs/package.yml b/.azure-pipelines/jobs/package.yml deleted file mode 100644 index 8663720de9c..00000000000 --- a/.azure-pipelines/jobs/package.yml +++ /dev/null @@ -1,36 +0,0 @@ -parameters: - vmImage: - -jobs: -- job: Package - dependsOn: - - Test_Primary - - Test_Secondary - pool: - vmImage: ${{ parameters.vmImage }} - - steps: - - task: UsePythonVersion@0 - displayName: Use Python 3 latest - inputs: - versionSpec: '3' - - - bash: | - git config --global user.email "pypa-dev@googlegroups.com" - git config --global user.name "pip" - displayName: Setup Git credentials - - - bash: pip install nox - displayName: Install dependencies - - - bash: nox -s prepare-release -- 99.9 - displayName: Prepare dummy release - - - bash: nox -s build-release -- 99.9 - displayName: Generate distributions for the dummy release - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: dist' - inputs: - pathtoPublish: dist - artifactName: dist diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index 1a933a6934b..5fd36871e56 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -1,68 +1,87 @@ parameters: vmImage: + osName: jobs: -- job: Test_Primary - displayName: Test Primary +- job: Test_Primary_${{ parameters.osName }}_one + displayName: Tests / ${{ parameters.osName }} / pool: vmImage: ${{ parameters.vmImage }} strategy: matrix: - Python27-x86: + "2.7-x86 / 1": python.version: '2.7' python.architecture: x86 - Python27-x64: + "2.7 / 1": python.version: '2.7' python.architecture: x64 - useVenv: true - Python35-x64: - python.version: '3.5' - python.architecture: x64 - Python36-x64: - python.version: '3.6' + "3.8 / 1": + python.version: '3.8' python.architecture: x64 - useVenv: true - Python37-x64: - python.version: '3.7' + + steps: + - template: ../steps/run-tests-windows.yml + parameters: + testGroup: one + +- job: Test_Primary_${{ parameters.osName }}_two + displayName: Tests / ${{ parameters.osName }} / + + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + matrix: + "2.7-x86 / 2": + python.version: '2.7' + python.architecture: x86 + "2.7 / 2": + python.version: '2.7' python.architecture: x64 - Python38-x64: + "3.8 / 2": python.version: '3.8' python.architecture: x64 - maxParallel: 6 steps: - template: ../steps/run-tests-windows.yml parameters: - runIntegrationTests: true - useVenv: '$(useVenv)' + testGroup: two -- job: Test_Secondary - displayName: Test Secondary +- job: Test_Secondary_${{ parameters.osName }} + displayName: Tests / ${{ parameters.osName }} / # Don't run integration tests for these runs - # Run after Test_Primary so we don't devour time and jobs if tests are going to fail - dependsOn: Test_Primary + # Run after Test_Primary_* so we don't devour time and jobs. + dependsOn: + - Test_Primary_${{ parameters.osName }}_one + - Test_Primary_${{ parameters.osName }}_two pool: vmImage: ${{ parameters.vmImage }} strategy: matrix: - # This is for Windows, so test x86 builds - Python35-x86: + "3.5": + python.version: '3.5' + python.architecture: x64 + "3.6": + python.version: '3.6' + python.architecture: x64 + "3.7": + python.version: '3.7' + python.architecture: x64 + "3.5-x86": python.version: '3.5' python.architecture: x86 - Python36-x86: + "3.6-x86": python.version: '3.6' python.architecture: x86 - Python37-x86: + "3.7-x86": python.version: '3.7' python.architecture: x86 - Python38-x86: + "3.8-x86": python.version: '3.8' python.architecture: x86 - maxParallel: 6 steps: - template: ../steps/run-tests-windows.yml parameters: - runIntegrationTests: false + testGroup: unit diff --git a/.azure-pipelines/jobs/test.yml b/.azure-pipelines/jobs/test.yml index 68b6e5268e1..eeef5ffa951 100644 --- a/.azure-pipelines/jobs/test.yml +++ b/.azure-pipelines/jobs/test.yml @@ -1,44 +1,43 @@ parameters: vmImage: + osName: jobs: -- job: Test_Primary - displayName: Test Primary +- job: Test_Primary_${{ parameters.osName }} + displayName: Tests / ${{ parameters.osName }} / pool: vmImage: ${{ parameters.vmImage }} strategy: matrix: - Python27: + "2.7": python.version: '2.7' python.architecture: x64 - Python36: + "3.6": python.version: '3.6' python.architecture: x64 - maxParallel: 2 steps: - template: ../steps/run-tests.yml -- job: Test_Secondary - displayName: Test Secondary +- job: Test_Secondary_${{ parameters.osName }} + displayName: Tests / ${{ parameters.osName }} / # Run after Test_Primary so we don't devour time and jobs if tests are going to fail - dependsOn: Test_Primary + dependsOn: Test_Primary_${{ parameters.osName }} pool: vmImage: ${{ parameters.vmImage }} strategy: matrix: - Python35: + "3.5": python.version: '3.5' python.architecture: x64 - Python37: + "3.7": python.version: '3.7' python.architecture: x64 - Python38: + "3.8": python.version: '3.8' python.architecture: x64 - maxParallel: 4 steps: - template: ../steps/run-tests.yml diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml deleted file mode 100644 index 6965a15fc6d..00000000000 --- a/.azure-pipelines/linux.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: -- template: jobs/test.yml - parameters: - vmImage: ubuntu-16.04 - -- template: jobs/package.yml - parameters: - vmImage: ubuntu-16.04 diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml deleted file mode 100644 index 85c2a0246af..00000000000 --- a/.azure-pipelines/macos.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: -- template: jobs/test.yml - parameters: - vmImage: macos-10.14 - -- template: jobs/package.yml - parameters: - vmImage: macos-10.14 diff --git a/.azure-pipelines/steps/run-tests-windows.yml b/.azure-pipelines/steps/run-tests-windows.yml index 3832e46621b..653a1f58f5d 100644 --- a/.azure-pipelines/steps/run-tests-windows.yml +++ b/.azure-pipelines/steps/run-tests-windows.yml @@ -1,6 +1,10 @@ parameters: - runIntegrationTests: - useVenv: false +- name: testGroup + type: string + values: + - unit + - one + - two steps: - task: UsePythonVersion@0 @@ -28,15 +32,17 @@ steps: - bash: pip install --upgrade 'virtualenv<20' setuptools tox displayName: Install Tox -- script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml - env: - TEMP: "R:\\Temp" - displayName: Tox run unit tests +# Lots of fun logic, for... running the correct tests. +- ${{ if in(parameters.testGroup, 'unit', 'one') }}: + - script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml + env: + TEMP: "R:\\Temp" + displayName: Run unit tests -- ${{ if eq(parameters.runIntegrationTests, 'true') }}: +- ${{ if in(parameters.testGroup, 'one', 'two') }}: - powershell: | # Fix Git SSL errors - pip install certifi tox + pip install certifi python -m certifi > cacert.txt $env:GIT_SSL_CAINFO = $(Get-Content cacert.txt) @@ -44,11 +50,14 @@ steps: # https://bugs.python.org/issue18199 $env:TEMP = "R:\Temp" - tox -e py -- $env:USE_VENV_ARG -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml - displayName: Tox run integration tests + pip install tox + tox -e py -- -k $env:SELECTOR -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml env: - ${{ if eq(parameters.useVenv, 'true') }}: - USE_VENV_ARG: "--use-venv" + ${{ if eq(parameters.testGroup, 'one') }}: + SELECTOR: "not test_install" + ${{ if eq(parameters.testGroup, 'two') }}: + SELECTOR: "test_install" + displayName: Run integration tests - task: PublishTestResults@2 displayName: Publish Test Results diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..04cc364ee1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,141 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + schedule: + # Run every Friday at 18:02 UTC + - cron: 2 18 * * 5 + +jobs: + dev-tools: + name: Quality Check / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + strategy: + matrix: + os: [Ubuntu, Windows, MacOS] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Set PY (for pre-commit cache) + run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + - name: pre-commit cache + uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + # Setup + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install tox + run: python -m pip install tox + + # Main check + - run: python -m tox -e "lint,docs" + + packaging: + name: Packaging / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + strategy: + matrix: + os: [Ubuntu, Windows, MacOS] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + # Setup + - name: Set up git credentials + run: | + git config --global user.email "pypa-dev@googlegroups.com" + git config --global user.name "pip" + + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install tox and nox + run: python -m pip install tox nox + + # Main check + - name: Check vendored packages + run: python -m tox -e "vendoring" + + - name: Prepare dummy release + run: nox -s prepare-release -- 99.9 + + - name: Generate distributions for the dummy release + run: nox -s build-release -- 99.9 + + tests: + name: Tests / ${{ matrix.python }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + needs: dev-tools + + strategy: + fail-fast: false + matrix: + os: [Ubuntu, Windows] + python: [2.7, 3.5, 3.6, 3.7, 3.8] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + # Setup + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install tox + run: python -m pip install tox 'virtualenv<20' + + # Main check + - name: Run unit tests + run: >- + python -m tox -e py -- + -m unit + --verbose + --numprocesses auto + - name: Run integration tests + run: >- + python -m tox -e py -- + -m integration + --verbose + --numprocesses auto + --duration=5 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml deleted file mode 100644 index 512969b0dff..00000000000 --- a/.github/workflows/linting.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Linting - -on: - push: - pull_request: - schedule: - # Run every Friday at 18:02 UTC - - cron: 2 18 * * 5 - -jobs: - lint: - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }}-latest - env: - TOXENV: lint,docs,vendoring - - strategy: - matrix: - os: - - Ubuntu - - Windows - - MacOS - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - # Setup Caching - - name: pip cache - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} - restore-keys: | - ${{ runner.os }}-pip- - ${{ runner.os }}- - - - name: Set PY (for pre-commit cache) - run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - - name: pre-commit cache - uses: actions/cache@v1 - with: - path: ~/.cache/pre-commit - key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - # Get the latest tox - - name: Install tox - run: python -m pip install tox - - # Main check - - run: python -m tox diff --git a/.travis.yml b/.travis.yml index b44b07b1e99..7dea6041692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,6 @@ jobs: - stage: primary env: TOXENV=docs - env: TOXENV=lint - - env: TOXENV=vendoring - # Latest CPython - - env: GROUP=1 - python: 2.7 - - env: GROUP=2 - python: 2.7 - - env: GROUP=1 - - env: GROUP=2 # Complete checking for ensuring compatibility # PyPy @@ -38,19 +30,6 @@ jobs: python: pypy2.7-7.1.1 - env: GROUP=2 python: pypy2.7-7.1.1 - # Other Supported CPython - - env: GROUP=1 - python: 3.7 - - env: GROUP=2 - python: 3.7 - - env: GROUP=1 - python: 3.6 - - env: GROUP=2 - python: 3.6 - - env: GROUP=1 - python: 3.5 - - env: GROUP=2 - python: 3.5 # Test experimental stuff that are not part of the standard pip usage. # Helpful for developers working on them to see how they're doing. diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index dbd80eb6cef..1ff7e9bd88e 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -79,13 +79,13 @@ Current run tests Developer tasks --------------- -======== =============== ================ ================== ============ - OS docs lint vendoring packages -======== =============== ================ ================== ============ -Linux Travis, Github Travis, Github Travis, Github Azure -Windows Azure -MacOS Azure -======== =============== ================ ================== ============ +======== =============== ================ =========== ========== + OS docs lint vendoring packages +======== =============== ================ =========== ========== +Linux Travis, Github Travis, Github Github Github +Windows Github Github Github Github +MacOS Github Github Github Github +======== =============== ================ =========== ========== Actual testing -------------- @@ -109,11 +109,11 @@ Actual testing | Windows +----------+-------+---------------+-----------------+ | | | CP2.7 | Azure | Azure | | | +-------+---------------+-----------------+ -| | | CP3.5 | Azure | Azure | +| | | CP3.5 | Azure | | | | +-------+---------------+-----------------+ -| | | CP3.6 | Azure | Azure | +| | | CP3.6 | Azure | | | | +-------+---------------+-----------------+ -| | x64 | CP3.7 | Azure | Azure | +| | x64 | CP3.7 | Azure | | | | +-------+---------------+-----------------+ | | | CP3.8 | Azure | Azure | | | +-------+---------------+-----------------+ @@ -135,15 +135,15 @@ Actual testing | | +-------+---------------+-----------------+ | | | PyPy3 | | | | Linux +----------+-------+---------------+-----------------+ -| | | CP2.7 | Travis,Azure | Travis,Azure | +| | | CP2.7 | GitHub | GitHub | | | +-------+---------------+-----------------+ -| | | CP3.5 | Travis,Azure | Travis,Azure | +| | | CP3.5 | GitHub | GitHub | | | +-------+---------------+-----------------+ -| | | CP3.6 | Travis,Azure | Travis,Azure | +| | | CP3.6 | GitHub | GitHub | | | +-------+---------------+-----------------+ -| | x64 | CP3.7 | Travis,Azure | Travis,Azure | +| | x64 | CP3.7 | GitHub | GitHub | | | +-------+---------------+-----------------+ -| | | CP3.8 | Travis | Travis | +| | | CP3.8 | GitHub | GitHub | | | +-------+---------------+-----------------+ | | | PyPy | Travis | Travis | | | +-------+---------------+-----------------+