Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure Pipelines configuration #5785

Merged
merged 23 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
60ff4a6
Add Azure Pipelines configuration
brcrista Aug 24, 2018
be3fb93
Use --yes flag to generate NEWS.rst during CI
brcrista Sep 15, 2018
ef94c93
Add .trivial file for change
brcrista Sep 15, 2018
fd490b5
Revert "Add .trivial file for change"
brcrista Sep 15, 2018
7dfb765
rename YAMLs for pool name
brcrista Oct 1, 2018
ee9d3ea
add pipeline for linux preview
brcrista Oct 1, 2018
7a612ee
add macos preview and macos internal
brcrista Oct 1, 2018
fe76e4f
Get rid of branching logic based on image name
brcrista Oct 1, 2018
55f15be
Merged PR 24: Configure pipelines for canary builds
brcrista Oct 1, 2018
69c74f9
delete install-dependencies.yml and fix build
brcrista Oct 1, 2018
d6b2991
Merge branch 'master' of https://buildcanary.visualstudio.com/CanaryB…
brcrista Oct 1, 2018
3f6f28d
Fix job reference
brcrista Oct 1, 2018
3f7af32
switch vs2017.yml to use the run-tests-windows.yml
brcrista Oct 1, 2018
012d76b
switch vs2017.yml to use test-windows.yml
brcrista Oct 1, 2018
767eafc
Pass pool instead of vmImage
brcrista Oct 5, 2018
35b1ea3
fix wrong vmImage name
brcrista Oct 5, 2018
a4d1569
react to name change for vs2017-win2016 image
brcrista Oct 5, 2018
5cbcb72
Remove conditional branching based on vmImage
brcrista Oct 5, 2018
1b67afe
just install tox explicitly
brcrista Oct 5, 2018
a85f421
need to run test-windows job from windows.yml
brcrista Oct 5, 2018
f454f60
fix dependsOn
brcrista Oct 5, 2018
962cbf8
Merge branch 'master' of https://github.com/pypa/pip
brcrista Oct 15, 2018
543a461
Merge branch 'master' into topic/remove-conditionals
brcrista Oct 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .azure-pipelines/jobs/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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: pip install setuptools tox wheel invoke towncrier
displayName: Install dependencies

- bash: invoke generate.authors
displayName: Generate AUTHORS.txt

- bash: invoke generate.news --yes
displayName: Generate NEWS.rst

- bash: tox -e packaging
displayName: Run Tox packaging

- bash: python setup.py sdist bdist_wheel
displayName: Create sdist and wheel

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
pathtoPublish: dist
artifactName: dist
73 changes: 73 additions & 0 deletions .azure-pipelines/jobs/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
parameters:
vmImage:

jobs:
- job: Test_Primary
displayName: Test Primary

pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
Python36:
python.version: '3.6'
python.architecture: x64
maxParallel: 2

steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2017') }}:
- template: ../steps/run-tests-windows.yml
parameters:
runIntegrationTests: true

- ${{ if ne(parameters.vmImage, 'vs2017-win2017') }}:
- template: ../steps/run-tests.yml

- job: Test_Secondary
displayName: Test Secondary
# Run after Test_Primary so we don't devour time and jobs if tests are going to fail
dependsOn: Test_Primary

pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python34:
python.version: '3.4'
python.architecture: x64
Python35:
python.version: '3.5'
python.architecture: x64
Python37:
python.version: '3.7'
python.architecture: x64
# On Windows, test x86 builds
${{ if eq(parameters.vmImage, 'vs2017-win2017') }}:
Python27-x86:
python.version: '2.7'
python.architecture: x86
Python34-x86:
python.version: '3.4'
python.architecture: x86
Python35-x86:
python.version: '3.5'
python.architecture: x86
Python36-x86:
python.version: '3.6'
python.architecture: x86
Python37-x86:
python.version: '3.7'
python.architecture: x86
maxParallel: 5

steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2017') }}:
- template: ../steps/run-tests-windows.yml
parameters:
runIntegrationTests: false

- ${{ if ne(parameters.vmImage, 'vs2017-win2017') }}:
- template: ../steps/run-tests.yml
8 changes: 8 additions & 0 deletions .azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jobs:
- template: jobs/test.yml
parameters:
vmImage: ubuntu-16.04

- template: jobs/package.yml
parameters:
vmImage: ubuntu-16.04
8 changes: 8 additions & 0 deletions .azure-pipelines/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jobs:
- template: jobs/test.yml
parameters:
vmImage: xcode9-macos10.13

- template: jobs/package.yml
parameters:
vmImage: xcode9-macos10.13
3 changes: 3 additions & 0 deletions .azure-pipelines/steps/install-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
steps:
- bash: pip install --upgrade setuptools tox
displayName: Install dependencies
37 changes: 37 additions & 0 deletions .azure-pipelines/steps/run-tests-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
runIntegrationTests:

steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: install-dependencies.yml

- script: tox -e py -- -m unit -n 3 --junit-xml=junit/unit-test.xml
displayName: Tox run unit tests

- ${{ if eq(parameters.runIntegrationTests, 'true') }}:
- powershell: |
# Fix Git SSL errors
pip install certifi tox
python -m certifi > cacert.txt
$env:GIT_SSL_CAINFO = $(Get-Content cacert.txt)

# Shorten paths to get under MAX_PATH or else integration tests will fail
# https://bugs.python.org/issue18199
subst T: $env:TEMP
$env:TEMP = "T:\"
$env:TMP = "T:\"

tox -e py -- -m integration -n 3 --duration=5 --junit-xml=junit/integration-test.xml
displayName: Tox run integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: junit/*.xml
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
24 changes: 24 additions & 0 deletions .azure-pipelines/steps/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'

- template: install-dependencies.yml

- script: tox -e py -- -m unit --junit-xml=junit/unit-test.xml
displayName: Tox run unit tests

# Run integration tests in two groups so we will fail faster if there is a failure in the first group
pradyunsg marked this conversation as resolved.
Show resolved Hide resolved
- script: tox -e py -- -m integration -n 4 --duration=5 -k "not test_install" --junit-xml=junit/integration-test-group0.xml
displayName: Tox run Group 0 integration tests

- script: tox -e py -- -m integration -n 4 --duration=5 -k "test_install" --junit-xml=junit/integration-test-group1.xml
displayName: Tox run Group 1 integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: junit/*.xml
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
8 changes: 8 additions & 0 deletions .azure-pipelines/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jobs:
- template: jobs/test.yml
parameters:
vmImage: vs2017-win2017

- template: jobs/package.yml
parameters:
vmImage: vs2017-win2017
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exclude src/pip/_vendor/six/moves
recursive-exclude src/pip/_vendor *.pyi

prune .github
prune .azure-pipelines
prune docs/build
prune news
prune tasks
Expand Down
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ The `PyPA recommended`_ tool for installing Python packages.
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
:target: https://pip.pypa.io/en/latest

.. image:: https://pypa.visualstudio.com/pip/_apis/build/status/Pip%20CI%20(Windows)
:target: https://pypa.visualstudio.com/pip/_build/latest?definitionId=6
pradyunsg marked this conversation as resolved.
Show resolved Hide resolved

.. image:: https://pypa.visualstudio.com/pip/_apis/build/status/Pip%20CI%20(macOS)
:target: https://pypa.visualstudio.com/pip/_build/latest?definitionId=7

.. image:: https://pypa.visualstudio.com/pip/_apis/build/status/Pip%20CI%20(Linux)
:target: https://pypa.visualstudio.com/pip/_build/latest?definitionId=4

* `Installation`_
* `Documentation`_
* `Changelog`_
Expand Down
4 changes: 3 additions & 1 deletion tasks/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ def authors(ctx):


@invoke.task
def news(ctx, draft=False):
def news(ctx, draft=False, yes=False):
pradyunsg marked this conversation as resolved.
Show resolved Hide resolved
print("[generate.news] Generating NEWS")

args = []
if draft:
args.append("--draft")
if yes:
args.append("--yes")

ctx.run("towncrier {}".format(" ".join(args)))