Skip to content

Commit 288a650

Browse files
committed
provide session level printer
Signed-off-by: Bernat Gabor <[email protected]>
1 parent 8feee83 commit 288a650

File tree

11 files changed

+223
-353
lines changed

11 files changed

+223
-353
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.0.0
3+
rev: v2.3.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
77
- id: check-yaml
88
- id: debug-statements
99
- id: flake8
10-
- repo: https://github.com/asottile/reorder_python_imports
11-
rev: v1.3.4
12-
hooks:
13-
- id: reorder-python-imports
14-
language_version: python3.6
1510
- repo: https://github.com/asottile/pyupgrade
16-
rev: v1.10.1
11+
rev: v1.25.1
1712
hooks:
1813
- id: pyupgrade
1914

2015
- repo: https://github.com/ambv/black
21-
rev: 18.9b0
16+
rev: 19.3b0
2217
hooks:
2318
- id: black
2419
args: [--safe]
2520
language_version: python3.7
2621
- repo: https://github.com/asottile/seed-isort-config
27-
rev: v1.3.0
22+
rev: v1.9.3
2823
hooks:
2924
- id: seed-isort-config
3025
args: [--application-directories, "src:."]
3126
- repo: https://github.com/pre-commit/mirrors-isort
32-
rev: v4.3.4
27+
rev: v4.3.21
3328
hooks:
3429
- id: isort

azure-pipelines.yml

Lines changed: 48 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,56 @@
11
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
2-
3-
variables:
4-
"System.PreferGit": true
5-
PYTEST_ADDOPTS: "-vv -ra --showlocals"
2+
resources:
3+
repositories:
4+
- repository: tox
5+
type: github
6+
endpoint: github
7+
name: tox-dev/azure-pipelines-template
8+
ref: master
69

710
trigger:
811
batch: true
912
branches:
1013
include:
11-
- master
12-
- refs/tags/*
13-
paths:
14-
exclude:
15-
- readthedocs.yml
16-
- LICENSE.txt
17-
- CODE_OF_CONDUCT.md
18-
- .gitignore
19-
- .github/*
20-
21-
jobs:
22-
- template: azure-run-tox-env.yml
23-
parameters: {tox: fix_lint, python: '3.7'}
24-
- template: azure-run-tox-env.yml
25-
parameters: {tox: docs, python: '3.7'}
26-
- template: azure-run-tox-env.yml
27-
parameters: {tox: package_description, python: '3.7'}
28-
29-
- template: azure-run-tox-env.yml
30-
parameters: {tox: pypy, python: pypy2, os: linux}
31-
- template: azure-run-tox-env.yml
32-
parameters: {tox: pypy3, python: pypy3, os: linux}
33-
34-
- template: azure-run-tox-env.yml
35-
parameters: {tox: py37, python: '3.7', os: windows}
36-
- template: azure-run-tox-env.yml
37-
parameters: {tox: py36, python: '3.6', os: windows}
38-
- template: azure-run-tox-env.yml
39-
parameters: {tox: py35, python: '3.5', os: windows}
40-
- template: azure-run-tox-env.yml
41-
parameters: {tox: py34, python: '3.4', os: windows}
42-
- template: azure-run-tox-env.yml
43-
parameters: {tox: py27, python: '2.7', os: windows}
44-
45-
- template: azure-run-tox-env.yml
46-
parameters: {tox: py37, python: '3.7', os: linux}
47-
- template: azure-run-tox-env.yml
48-
parameters: {tox: py36, python: '3.6', os: linux}
49-
- template: azure-run-tox-env.yml
50-
parameters: {tox: py35, python: '3.5', os: linux}
51-
- template: azure-run-tox-env.yml
52-
parameters: {tox: py34, python: '3.4', os: linux}
53-
- template: azure-run-tox-env.yml
54-
parameters: {tox: py27, python: '2.7', os: linux}
55-
56-
- template: azure-run-tox-env.yml
57-
parameters: {tox: py36, python: '3.6', os: macOs}
58-
59-
- job: report_coverage
60-
pool: {vmImage: 'Ubuntu 16.04'}
61-
dependsOn:
62-
- windows_py37
63-
- windows_py36
64-
- windows_py35
65-
- windows_py34
66-
- windows_py27
67-
- linux_py37
68-
- linux_py36
69-
- linux_py35
70-
- linux_py34
71-
- linux_py27
72-
- linux_pypy3
73-
- linux_pypy
74-
- macOS_py36
75-
steps:
76-
- task: DownloadBuildArtifacts@0
77-
displayName: download coverage files for run
78-
inputs:
79-
buildType: current
80-
downloadType: specific
81-
itemPattern: coverage-*/*
82-
downloadPath: $(Build.StagingDirectory)
83-
84-
- task: UsePythonVersion@0
85-
displayName: setup python
86-
inputs:
87-
versionSpec: 3.7
88-
89-
- script: |
90-
python -c '
91-
from pathlib import Path
92-
import shutil
93-
94-
from_folder = Path("$(Build.StagingDirectory)")
95-
destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox"
96-
destination_folder.mkdir()
97-
for coverage_file in from_folder.glob("*/.coverage"):
98-
destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}"
99-
print(f"{coverage_file} copy to {destination}")
100-
shutil.copy(str(coverage_file), str(destination))'
101-
displayName: move coverage files into .tox
102-
103-
- script: 'python -m pip install -U tox --pre'
104-
displayName: install tox
105-
106-
- script: 'python -m tox -e py --sdistonly'
107-
displayName: generate version.py
108-
109-
- script: 'python -m tox -e coverage'
110-
displayName: create coverag report via tox
14+
- master
15+
- refs/tags/*
16+
pr:
17+
branches:
18+
include:
19+
- master
11120

112-
- task: PublishCodeCoverageResults@1
113-
displayName: publish overall coverage report to Azure
114-
inputs:
115-
codeCoverageTool: 'cobertura'
116-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
117-
reportDirectory: '$(System.DefaultWorkingDirectory)/.tox/htmlcov'
118-
failIfCoverageEmpty: true
21+
variables:
22+
PYTEST_ADDOPTS: "-v -v -ra --showlocals"
23+
PYTEST_XDIST_PROC_NR: 'auto'
11924

120-
- job: publish
121-
dependsOn:
122-
- report_coverage
123-
- linux_fix_lint
124-
- linux_docs
125-
- linux_package_description
126-
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
127-
pool: {vmImage: 'Ubuntu 16.04'}
128-
steps:
129-
- task: UsePythonVersion@0
130-
displayName: setup python3.7
131-
inputs: {versionSpec: '3.7'}
132-
- script: 'python -m pip install -U pip twine'
133-
displayName: upgrade pip
134-
- script: 'python -m pip wheel -w $(Build.ArtifactStagingDirectory)/build --no-deps .'
135-
displayName: build wheel
136-
- task: PublishBuildArtifacts@1
137-
displayName: wheel to Azure Artifact
138-
inputs:
139-
pathtoPublish: "$(Build.ArtifactStagingDirectory)/build"
140-
ArtifactName: wheel
141-
- task: TwineAuthenticate@0
142-
inputs:
143-
artifactFeeds: ''
144-
externalFeeds: pypi-conn
145-
- script: 'python -m twine upload -r pypi --verbose --config-file $PYPIRC_PATH $(Build.ArtifactStagingDirectory)/build/*.whl'
146-
displayName: perform publish
25+
jobs:
26+
- template: run-tox-env.yml@tox
27+
parameters:
28+
jobs:
29+
fix_lint: null
30+
docs: null
31+
py38:
32+
image: [linux]
33+
py37:
34+
image: [linux, windows, macOs]
35+
py36:
36+
image: [linux, windows, macOs]
37+
py35:
38+
image: [linux, windows, macOs]
39+
py27:
40+
image: [linux, windows, macOs]
41+
pypy3:
42+
image: [linux]
43+
pypy:
44+
image: [linux]
45+
dev: null
46+
package_description: null
47+
coverage:
48+
with_toxenv: 'coverage' # generate .tox/.coverage, .tox/coverage.xml after test run
49+
for_envs: [py38, py37, py36, py35]
50+
51+
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
52+
- template: publish-pypi.yml@tox
53+
parameters:
54+
external_feed: 'toxdev'
55+
pypi_remote: 'pypi-toxdev'
56+
dependsOn: [fix_lint, docs, package_description, dev, report_coverage]

azure-run-tox-env.yml

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

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 40.6.2",
3+
"setuptools >= 40.0.4",
44
"setuptools_scm >= 2.0.0, <4",
5-
"wheel >= 0.30.0",
5+
"wheel >= 0.29.0",
66
]
77
build-backend = 'setuptools.build_meta'
88

readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ formats:
44
build:
55
image: latest
66
python:
7-
version: 3.6
7+
version: 3.7
88
pip_install: true
99
extra_requirements:
1010
- doc

0 commit comments

Comments
 (0)