Skip to content

Commit 1c96e98

Browse files
committed
move to coveralls from codecov
1 parent 701dab6 commit 1c96e98

File tree

9 files changed

+195
-163
lines changed

9 files changed

+195
-163
lines changed

.codecov.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ py27/
3232
_draft.rst
3333

3434
credentials.json
35+
.coveralls.yml

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
.. image:: https://dev.azure.com/toxdev/tox/_apis/build/status/tox%20ci?branchName=master
88
:target: https://dev.azure.com/toxdev/tox/_build/latest?definitionId=9&branchName=master
99
:alt: Azure Pipelines build status
10-
.. image:: https://travis-ci.org/tox-dev/tox.svg?branch=master
11-
:target: https://travis-ci.org/tox-dev/tox
12-
:alt: Travis-CI build status
13-
.. image:: https://codecov.io/gh/tox-dev/tox/branch/master/graph/badge.svg
14-
:target: https://codecov.io/gh/tox-dev/tox
10+
.. image:: https://coveralls.io/repos/github/tox-dev/tox/badge.svg?branch=master
11+
:target: https://coveralls.io/github/tox-dev/tox?branch=master
1512
:alt: Code coverage Status
16-
.. image:: https://readthedocs.org/projects/tox/badge/?version=latest
13+
.. image:: https://readthedocs.org/projects/tox/badge/?version=latest&style=flat-square
1714
:target: https://tox.readthedocs.io/en/latest/?badge=latest
1815
:alt: Documentation status
1916
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg

azure-pipelines.yml

Lines changed: 107 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,62 +24,136 @@ trigger:
2424

2525
jobs:
2626
- template: azure-run-tox-env.yml
27-
parameters: {name: check_code_style, tox: "fix-lint", python: '3.7', image: 'Ubuntu 16.04'}
27+
parameters: {tox: "fix_lint", python: "3.7"}
2828
- template: azure-run-tox-env.yml
29-
parameters: {name: generate_docs, tox: docs, python: '3.7', image: 'Ubuntu 16.04'}
29+
parameters: {tox: "docs", python: "3.7"}
3030
- template: azure-run-tox-env.yml
31-
parameters: {name: check_package_long_description, tox: "package-description", python: '3.7', image: 'Ubuntu 16.04'}
31+
parameters: {tox: "package_description", python: "3.7"}
3232

3333
- template: azure-run-tox-env.yml
34-
parameters: {name: windows_37, python: '3.7', image: 'vs2017-win2016'}
34+
parameters: {tox: "py37", python: "3.7", os: "windows"}
3535
- template: azure-run-tox-env.yml
36-
parameters: {name: windows_36, python: '3.6', image: 'vs2017-win2016'}
36+
parameters: {tox: "py36", python: "3.6", os: "windows"}
3737
- template: azure-run-tox-env.yml
38-
parameters: {name: windows_35, python: '3.5', image: 'vs2017-win2016'}
38+
parameters: {tox: "py35", python: "3.5", os: "windows"}
3939
- template: azure-run-tox-env.yml
40-
parameters: {name: windows_34, python: '3.4', image: 'vs2017-win2016'}
40+
parameters: {tox: "py34", python: "3.4", os: "windows"}
4141
- template: azure-run-tox-env.yml
42-
parameters: {name: windows_27, python: '2.7', image: 'vs2017-win2016'}
42+
parameters: {tox: "py27", python: "2.7", os: "windows"}
4343

4444
- template: azure-run-tox-env.yml
45-
parameters: {name: linux_37, python: '3.7', image: 'Ubuntu 16.04'}
45+
parameters: {tox: "py37", python: "3.7", os: "linux"}
4646
- template: azure-run-tox-env.yml
47-
parameters: {name: linux_36, python: '3.6', image: 'Ubuntu 16.04'}
47+
parameters: {tox: "py36", python: "3.6", os: "linux"}
4848
- template: azure-run-tox-env.yml
49-
parameters: {name: linux_35, python: '3.5', image: 'Ubuntu 16.04'}
49+
parameters: {tox: "py35", python: "3.5", os: "linux"}
5050
- template: azure-run-tox-env.yml
51-
parameters: {name: linux_34, python: '3.4', image: 'Ubuntu 16.04'}
51+
parameters: {tox: "py34", python: "3.4", os: "linux"}
5252
- template: azure-run-tox-env.yml
53-
parameters: {name: linux_27, python: '2.7', image: 'Ubuntu 16.04'}
53+
parameters: {tox: "py27", python: "2.7", os: "linux"}
5454

5555
- template: azure-run-tox-env.yml
56-
parameters: {name: macOS_36, python: '3.6', image: 'macOS 10.13'}
56+
parameters: {tox: "pypy", python: "pypy", os: "linux"}
57+
- template: azure-run-tox-env.yml
58+
parameters: {tox: "pypy3", python: "pypy3", os: "linux"}
59+
60+
- template: azure-run-tox-env.yml
61+
parameters: {tox: "py36", python: "3.6", os: "macOs"}
5762

58-
- job: tests_done
63+
- job: report_coverage
5964
pool: {vmImage: 'Ubuntu 16.04'}
60-
condition: always()
65+
condition: and( always(), eq(variables['system.pullrequest.isfork'], false) )
6166
dependsOn:
62-
- windows_37
63-
- windows_36
64-
- windows_35
65-
- windows_34
66-
- windows_27
67-
- linux_37
68-
- linux_36
69-
- linux_35
70-
- linux_34
71-
- linux_27
72-
- macOS_36
67+
- windows_py37
68+
- windows_py36
69+
- windows_py35
70+
- windows_py34
71+
- windows_py27
72+
- linux_py37
73+
- linux_py36
74+
- linux_py35
75+
- linux_py34
76+
- linux_py27
77+
- linux_pypy3
78+
- linux_pypy
79+
- macOS_py36
7380
steps:
74-
- script: echo "done"
75-
displayName: running tests done
81+
- task: DownloadBuildArtifacts@0
82+
displayName: download coverage files for run
83+
inputs:
84+
buildType: 'current'
85+
downloadType: 'specific'
86+
itemPattern: 'coverage-*/*'
87+
downloadPath: '$(Build.StagingDirectory)'
88+
89+
- task: UsePythonVersion@0
90+
displayName: setup python
91+
inputs:
92+
versionSpec: '3.7'
93+
94+
- script: |
95+
python -c '
96+
from pathlib import Path
97+
import shutil
98+
99+
from_folder = Path("$(Build.StagingDirectory)")
100+
destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox"
101+
destination_folder.mkdir()
102+
for coverage_file in from_folder.glob("*/.coverage"):
103+
destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}"
104+
print(f"{coverage_file} copy to {destination}")
105+
shutil.copy(str(coverage_file), str(destination))
106+
'
107+
displayName: move coverage files into .tox
108+
109+
- script: 'python -m pip install -U tox --pre'
110+
displayName: install tox
111+
112+
- script: 'python -m tox -e py --sdistonly'
113+
displayName: generate version.py
114+
115+
- script: 'python -m tox -e coverage'
116+
displayName: create coverag report via tox
117+
118+
- task: PublishCodeCoverageResults@1
119+
displayName: publish overall coverage report to Azure
120+
inputs:
121+
codeCoverageTool: 'cobertura'
122+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
123+
reportDirectory: '$(System.DefaultWorkingDirectory)/.tox/htmlcov'
124+
failIfCoverageEmpty: true
125+
126+
- script: |
127+
python -c '
128+
import textwrap
129+
130+
content = textwrap.dedent(
131+
"""
132+
service_name: Azure Pipelines
133+
service_pull_request: $(System.PullRequest.PullRequestNumber)
134+
"""
135+
)
136+
print(content)
137+
with open(".coveralls.yml", "w") as file_handler:
138+
file_handler.write(content)
139+
'
140+
displayName: create coveralls config
141+
142+
- script: 'python -m tox -e coveralls'
143+
displayName: publish overall coverage report to coveralls
144+
env:
145+
CI_BRANCH: $(Build.SourceBranch)
146+
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
147+
COVERALLS_PARALLEL: false
148+
COVERALLS_FLAG_NAME: ${{ parameters.name }}
149+
76150

77151
- job: publish
78152
dependsOn:
79-
- tests_done
80-
- check_code_style
81-
- generate_docs
82-
- check_package_long_description
153+
- report_coverage
154+
- linux_fix_lint
155+
- linux_docs
156+
- linux_package_description
83157
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
84158
pool: {vmImage: 'Ubuntu 16.04'}
85159
steps:

azure-run-tox-env.yml

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,68 @@
11
parameters:
2-
name: ''
3-
tox: 'py'
4-
python: ''
5-
image: ''
2+
tox: ""
3+
python: ""
4+
os: "linux"
65

76
jobs:
8-
- job: ${{ parameters.name }}
7+
- job: ${{ format('{0}_{1}', parameters.os, parameters.tox) }}
98
pool:
10-
vmImage: ${{ parameters.image }}
9+
${{ if eq(parameters.os, 'windows') }}:
10+
vmImage: "vs2017-win2016"
11+
${{ if eq(parameters.os, 'macOs') }}:
12+
vmImage: "macOS 10.13"
13+
${{ if eq(parameters.os, 'linux') }}:
14+
vmImage: "Ubuntu 16.04"
15+
1116
steps:
12-
- task: UsePythonVersion@0
13-
displayName: setup python
14-
inputs:
15-
versionSpec: ${{ parameters.python }}
1617

17-
- script: 'python -m pip install -U tox --pre'
18-
displayName: install tox
18+
# ensure the required Python versions are available
19+
- ${{ if notIn(parameters.python, 'pypy', 'pypy3') }}:
20+
- task: UsePythonVersion@0
21+
displayName: setup python
22+
inputs:
23+
versionSpec: ${{ parameters.python }}
24+
- script: echo "##vso[task.setvariable variable=python]python"
25+
displayName: set python
1926

20-
- script: 'python -m tox --notest'
21-
displayName: acquire tox env dependencies
22-
env:
23-
TOXENV: ${{ parameters.tox }}
27+
- ${{ if in(parameters.python, 'pypy', 'pypy3') }}:
28+
- script: $${{ format( 'echo "##vso[task.setvariable variable=python]{0}"', parameters.python }}
29+
displayName: set python
2430

25-
- script: 'python -m tox'
31+
- script: "$(python) -c 'import sys; print(sys.version); print(sys.executable)'"
32+
displayName: show python information
33+
34+
# setup tox
35+
- script: "$(python) -m pip install -U tox --pre"
36+
displayName: install tox
37+
38+
# run test
39+
- script: "$(python) -m tox"
2640
displayName: perform tox env run
2741
env:
2842
TOXENV: ${{ parameters.tox }}
2943

30-
- ${{ if eq(parameters.tox, 'py') }}:
44+
# run test
45+
- ${{ if startsWith(parameters.tox, 'py') }}:
46+
- script: "$(python) -m tox -e coverage"
47+
displayName: create coverag report
48+
49+
- ${{ if and( startsWith(parameters.tox, 'py'), eq(variables['system.pullrequest.isfork'], false) ) }}:
50+
- task: PublishTestResults@2
51+
displayName: publish test results via junit
52+
inputs:
53+
testResultsFormat: "JUnit"
54+
testResultsFiles: "$(System.DefaultWorkingDirectory)/.tox/.test.py.xml"
55+
testRunTitle: ${{ format('{0}_{1}', parameters.os, parameters.tox) }}
3156

32-
- script: 'python -m tox -e coverage'
33-
displayName: generate coverage report
57+
- task: CopyFiles@2
58+
displayName: move coverage files into staging area
59+
inputs:
60+
sourceFolder: $(System.DefaultWorkingDirectory)/.tox
61+
contents: ".coverage"
62+
targetFolder: $(Build.StagingDirectory)
3463

35-
- script: 'python -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-$(python.version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) pyt+hon=$(python.version)'
36-
displayName: upload codecov
64+
- task: PublishBuildArtifacts@1
65+
displayName: publish coverage file
66+
inputs:
67+
pathtoPublish: $(Build.ArtifactStagingDirectory)
68+
ArtifactName: ${{ format('coverage-{0}-{1}', parameters.os, parameters.tox) }}

readthedocs.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
build:
2-
image: latest
2+
image: latest
33
python:
4-
version: 3.6
5-
pip_install: true
6-
extra_requirements:
7-
- docs
4+
version: 3.6
5+
pip_install: true
6+
extra_requirements:
7+
- docs
8+
formats: []

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def main():
9191
"pytest-randomly >= 1.2.3, <2",
9292
],
9393
"docs": [
94-
"sphinx >= 1.7.5, < 2",
94+
"sphinx >= 1.8.0, < 2",
9595
"towncrier >= 18.5.0",
9696
"pygments-github-lexers >= 0.0.5",
9797
],

0 commit comments

Comments
 (0)