Skip to content

Commit 8f89cc2

Browse files
committed
Move to Github API
Signed-off-by: Bernat Gabor <[email protected]>
1 parent 301c76e commit 8f89cc2

File tree

12 files changed

+291
-173
lines changed

12 files changed

+291
-173
lines changed

.coveragerc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[coverage:report]
2+
show_missing = True
3+
exclude_lines =
4+
\#\s*pragma: no cover
5+
^\s*raise AssertionError\b
6+
^\s*raise NotImplementedError\b
7+
^\s*raise$
8+
^if __name__ == ['"]__main__['"]:$
9+
omit =
10+
11+
[coverage:paths]
12+
source =
13+
src
14+
.tox/*/lib/python*/site-packages
15+
.tox/pypy*/site-packages
16+
.tox\*\Lib\site-packages\
17+
*/src
18+
*\src
19+
20+
[coverage:run]
21+
branch = false
22+
parallel = true
23+
dynamic_context = test_function
24+
source =
25+
${_COVERAGE_SRC}
26+
27+
[coverage:html]
28+
show_contexts = true

.github/workflows/check.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: check
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: "0 8 * * *"
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-python@v1
14+
- uses: pre-commit/[email protected]
15+
16+
test:
17+
name: test ${{ matrix.py }} - ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
- Ubuntu
24+
- Windows
25+
- MacOs
26+
py:
27+
- 3.9-dev
28+
- 3.8
29+
- 3.7
30+
- 3.6
31+
- pypy3
32+
- 3.5
33+
- 2.7
34+
- pypy2
35+
steps:
36+
- name: setup python for tox
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: 3.8
40+
- name: install tox
41+
run: python -m pip install tox
42+
- uses: actions/checkout@v2
43+
- name: setup python for test ${{ matrix.py }}
44+
uses: actions/setup-python@v2
45+
with:
46+
python-version: ${{ matrix.py }}
47+
- name: pick environment to run
48+
run: |
49+
import subprocess; import json
50+
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
51+
print('::set-env name=TOXENV::' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else "")))
52+
shell: python
53+
- name: setup test suite
54+
run: tox -vv --notest
55+
- name: run test suite
56+
run: tox --skip-pkg-install
57+
env:
58+
PYTEST_ADDOPTS: "-vv --durations=20"
59+
CI_RUN: "yes"
60+
DIFF_AGAINST: HEAD
61+
- name: rename coverage report file
62+
run: |
63+
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
64+
shell: python
65+
- uses: codecov/codecov-action@v1
66+
with:
67+
file: ./.tox/coverage.xml
68+
flags: tests
69+
name: ${{ matrix.py }} - ${{ matrix.os }}
70+
71+
check:
72+
name: check ${{ matrix.tox_env }} - ${{ matrix.os }}
73+
runs-on: ${{ matrix.os }}-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os:
78+
- Ubuntu
79+
- Windows
80+
tox_env:
81+
- dev
82+
- docs
83+
- package_description
84+
exclude:
85+
- { os: Windows, tox_env: package_description }
86+
- { os: Windows, tox_env: docs }
87+
steps:
88+
- uses: actions/checkout@v2
89+
- name: setup Python 3.8
90+
uses: actions/setup-python@v2
91+
with:
92+
python-version: 3.8
93+
- name: install tox
94+
run: python -m pip install tox
95+
- name: run check for ${{ matrix.tox_env }}
96+
run: python -m tox -e ${{ matrix.tox_env }}
97+
env:
98+
UPGRADE_ADVISORY: "yes"
99+
100+
publish:
101+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
102+
needs: [check, test, pre-commit]
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: setup python to build package
106+
uses: actions/setup-python@v2
107+
with:
108+
python-version: 3.8
109+
- name: install pep517
110+
run: python -m pip install pep517
111+
- uses: actions/checkout@v2
112+
- name: build package
113+
run: python -m pep517.build -s -b . -o dist
114+
- name: publish to PyPi
115+
uses: pypa/gh-action-pypi-publish@master
116+
with:
117+
skip_existing: true
118+
user: __token__
119+
password: ${{ secrets.pypi_password }}

.pre-commit-config.yaml

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,57 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.3.0
3+
rev: v3.2.0
44
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
5+
- id: check-ast
6+
- id: check-builtin-literals
7+
- id: check-docstring-first
8+
- id: check-merge-conflict
79
- id: check-yaml
10+
- id: check-toml
811
- id: debug-statements
9-
- id: flake8
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- repo: https://github.com/asottile/add-trailing-comma
15+
rev: v2.0.1
16+
hooks:
17+
- id: add-trailing-comma
1018
- repo: https://github.com/asottile/pyupgrade
11-
rev: v1.25.1
19+
rev: v2.7.2
1220
hooks:
1321
- id: pyupgrade
14-
15-
- repo: https://github.com/ambv/black
16-
rev: 19.3b0
17-
hooks:
18-
- id: black
19-
args: [--safe]
20-
language_version: python3.7
2122
- repo: https://github.com/asottile/seed-isort-config
22-
rev: v1.9.3
23+
rev: v2.2.0
2324
hooks:
2425
- id: seed-isort-config
25-
args: [--application-directories, "src:."]
26+
args: [--application-directories, ".:src"]
2627
- repo: https://github.com/pre-commit/mirrors-isort
27-
rev: v4.3.21
28+
rev: v5.2.2
2829
hooks:
2930
- id: isort
31+
- repo: https://github.com/ambv/black
32+
rev: 19.10b0
33+
hooks:
34+
- id: black
35+
args: [--safe]
36+
language_version: python3.8
37+
- repo: https://github.com/asottile/blacken-docs
38+
rev: v1.7.0
39+
hooks:
40+
- id: blacken-docs
41+
additional_dependencies: [black==19.10b0]
42+
language_version: python3.8
43+
- repo: https://github.com/pre-commit/pygrep-hooks
44+
rev: v1.5.1
45+
hooks:
46+
- id: rst-backticks
47+
- repo: https://github.com/asottile/setup-cfg-fmt
48+
rev: v1.11.0
49+
hooks:
50+
- id: setup-cfg-fmt
51+
args: [--min-py3-version, "3.4"]
52+
- repo: https://gitlab.com/pycqa/flake8
53+
rev: "3.8.3"
54+
hooks:
55+
- id: flake8
56+
additional_dependencies: ["flake8-bugbear == 20.1.4"]
57+
language_version: python3.8

azure-pipelines.yml

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

doc/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
changelog
22
=========
33

4+
v0.2.0
5+
------
6+
* support for use at session level fixtures
7+
48
v0.1.2
59
------
610
* add ``--print`` flag to force on state even when verbosity is zero

pyproject.toml

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

99
[tool.black]
1010
line-length = 120
11+
12+
[tool.setuptools_scm]
13+
write_to = "src/pytest_print/version.py"
14+
write_to_template = """
15+
\"\"\" Version information \"\"\"
16+
from __future__ import unicode_literals
17+
18+
__version__ = "{version}"
19+
"""

readthedocs.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
formats:
2-
- none
2+
- none
33

44
build:
5-
image: latest
5+
image: latest
66
python:
7-
version: 3.7
8-
pip_install: true
9-
extra_requirements:
10-
- doc
7+
version: 3.8
8+
pip_install: true
9+
extra_requirements:
10+
- doc

0 commit comments

Comments
 (0)