Skip to content

Commit 0866aa3

Browse files
committed
Bump linters
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
1 parent e05a4dc commit 0866aa3

File tree

5 files changed

+70
-64
lines changed

5 files changed

+70
-64
lines changed

.github/workflows/check.yml

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,49 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
pre-commit:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
18-
- uses: pre-commit/action@v2.0.0
19-
2013
test:
2114
name: test ${{ matrix.py }} - ${{ matrix.os }}
22-
runs-on: ${{ matrix.os }}-latest
15+
runs-on: ${{ matrix.os }}
2316
strategy:
2417
fail-fast: false
2518
matrix:
26-
os:
27-
- Ubuntu
28-
- Windows
29-
- MacOs
3019
py:
31-
- 3.10.0-beta.2
32-
- 3.9
33-
- 3.8
34-
- 3.7
35-
- 3.6
36-
- pypy3
20+
- "3.10"
21+
- "pypy-3.7-v7.3.7" # ahead to start it earlier because takes longer
22+
- "3.9"
23+
- "3.8"
24+
- "3.7"
25+
os:
26+
- ubuntu-20.04
27+
- windows-2022
28+
- macos-10.15
29+
3730
steps:
3831
- name: Setup python for tox
3932
uses: actions/setup-python@v2
4033
with:
41-
python-version: 3.9
34+
python-version: "3.10"
4235
- name: Install tox
4336
run: python -m pip install tox
4437
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
4540
- name: Setup python for test ${{ matrix.py }}
4641
uses: actions/setup-python@v2
4742
with:
4843
python-version: ${{ matrix.py }}
4944
- name: Pick environment to run
5045
run: |
51-
import subprocess; import json; import os
52-
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))
53-
with open(os.environ["GITHUB_ENV"], "a") as file_handler:
54-
file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}') + "\n")
46+
import codecs
47+
import os
48+
import platform
49+
import sys
50+
cpy = platform.python_implementation() == "CPython"
51+
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
52+
env = "TOXENV={}\n".format(base)
53+
print("Picked:\n{}for{}".format(env, sys.version))
54+
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
55+
file_handler.write(env)
5556
shell: python
5657
- name: Setup test suite
5758
run: tox -vv --notest
@@ -60,49 +61,53 @@ jobs:
6061
env:
6162
PYTEST_ADDOPTS: "-vv --durations=20"
6263
CI_RUN: "yes"
64+
DIFF_AGAINST: HEAD
6365

6466
check:
65-
name: check ${{ matrix.tox_env }} - ${{ matrix.os }}
66-
runs-on: ${{ matrix.os }}-latest
67+
name: tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
68+
runs-on: ${{ matrix.os }}
6769
strategy:
6870
fail-fast: false
6971
matrix:
7072
os:
71-
- Ubuntu
72-
- Windows
73+
- ubuntu-20.04
74+
- windows-2022
7375
tox_env:
74-
- type
7576
- dev
76-
- pkg_desc
77+
- type
78+
- readme
7779
exclude:
78-
- { os: Windows, tox_env: pkg_desc }
79-
80+
- { os: windows-latest, tox_env: readme }
8081
steps:
8182
- uses: actions/checkout@v2
82-
- name: Setup python
83+
with:
84+
fetch-depth: 0
85+
- name: Setup Python "3.10"
8386
uses: actions/setup-python@v2
8487
with:
85-
python-version: 3.9
88+
python-version: "3.10"
8689
- name: Install tox
8790
run: python -m pip install tox
88-
- name: Run check for ${{ matrix.tox_env }}
89-
run: python -m tox -e ${{ matrix.tox_env }}
90-
env:
91-
UPGRADE_ADVISORY: "yes"
91+
- name: Setup test suite
92+
run: tox -vv --notest -e ${{ matrix.tox_env }}
93+
- name: Run test suite
94+
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}
9295

9396
publish:
9497
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
95-
needs: [check, test, pre-commit]
96-
runs-on: ubuntu-latest
98+
needs: [ check, test ]
99+
runs-on: ubuntu-20.04
97100
steps:
98101
- name: Setup python to build package
99102
uses: actions/setup-python@v2
100103
with:
101-
python-version: 3.9
104+
python-version: "3.10"
102105
- name: Install build
103-
run: python -m pip install 'build>=0.4'
106+
run: python -m pip install build
104107
- uses: actions/checkout@v2
105-
- name: Build package
108+
with:
109+
fetch-depth: 0
110+
- name: Build sdist and wheel
106111
run: python -m build -s -w . -o dist
107112
- name: Publish to PyPi
108113
uses: pypa/gh-action-pypi-publish@master

.pre-commit-config.yaml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.0.1
3+
rev: v4.1.0
44
hooks:
55
- id: check-ast
66
- id: check-builtin-literals
@@ -15,6 +15,7 @@ repos:
1515
rev: v2.29.1
1616
hooks:
1717
- id: pyupgrade
18+
args: [ "--py36-plus" ]
1819
- repo: https://github.com/PyCQA/isort
1920
rev: 5.10.1
2021
hooks:
@@ -23,33 +24,35 @@ repos:
2324
rev: 21.12b0
2425
hooks:
2526
- id: black
27+
args: [ --safe ]
2628
- repo: https://github.com/asottile/blacken-docs
2729
rev: v1.12.0
2830
hooks:
2931
- id: blacken-docs
30-
additional_dependencies: [ black==21.6b0 ]
32+
additional_dependencies: [ black==21.12b0 ]
3133
- repo: https://github.com/pre-commit/pygrep-hooks
3234
rev: v1.9.0
3335
hooks:
3436
- id: rst-backticks
35-
- repo: https://github.com/asottile/setup-cfg-fmt
36-
rev: v1.20.0
37-
hooks:
38-
- id: setup-cfg-fmt
39-
args: [--min-py3-version, "3.6", "--max-py-version", "3.10"]
4037
- repo: https://github.com/tox-dev/tox-ini-fmt
4138
rev: "0.5.1"
4239
hooks:
4340
- id: tox-ini-fmt
44-
args: ["-p", "fix"]
41+
args: [ "-p", "fix" ]
42+
- repo: https://github.com/asottile/setup-cfg-fmt
43+
rev: v1.20.0
44+
hooks:
45+
- id: setup-cfg-fmt
46+
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ]
4547
- repo: https://github.com/PyCQA/flake8
46-
rev: "4.0.1"
48+
rev: 4.0.1
4749
hooks:
4850
- id: flake8
49-
additional_dependencies: [
50-
"flake8-bugbear == 21.9.2",
51-
"flake8-unused-arguments == 0.0.6",
52-
"flake8-comprehensions == 3.7.0",
53-
"flake8-spellcheck == 0.24.0",
54-
"flake8-pytest-style == 1.4.2",
55-
]
51+
additional_dependencies:
52+
- flake8-bugbear==21.11.29
53+
- flake8-comprehensions==3.7
54+
- flake8-pytest-style==1.6
55+
- flake8-spellcheck==0.24
56+
- flake8-unused-arguments==0.0.9
57+
- flake8-noqa==1.2.1
58+
- pep8-naming==0.12.1

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pytest-print?style=flat-square)](https://pypistats.org/packages/pytest-print)
77
[![PyPI - License](https://img.shields.io/pypi/l/pytest-print?style=flat-square)](https://opensource.org/licenses/MIT)
88
[![check](https://github.com/pytest-dev/pytest-print/workflows/check/badge.svg)](https://github.com/pytest-dev/pytest-print/actions?query=workflow%3Acheck)
9-
[![codecov](https://codecov.io/gh/pytest-dev/pytest-print/branch/master/graph/badge.svg)](https://codecov.io/gh/pytest-dev/pytest-print)
109
[![Code style:
1110
black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
1211

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ classifiers =
2020
Operating System :: POSIX
2121
Programming Language :: Python :: 3
2222
Programming Language :: Python :: 3 :: Only
23-
Programming Language :: Python :: 3.6
2423
Programming Language :: Python :: 3.7
2524
Programming Language :: Python :: 3.8
2625
Programming Language :: Python :: 3.9
@@ -37,7 +36,7 @@ project_urls =
3736
packages = find:
3837
install_requires =
3938
pytest>=6
40-
python_requires = >=3.6
39+
python_requires = >=3.7
4140
include_package_data = True
4241
package_dir =
4342
=src

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ envlist =
88
py36
99
pypy3
1010
type
11-
pkg_desc
11+
readme
1212
isolated_build = true
1313
skip_missing_interpreters = true
1414
minversion = 3.21
@@ -51,12 +51,12 @@ description = run type check on code base
5151
setenv =
5252
{tty:MYPY_FORCE_COLOR = 1}
5353
deps =
54-
mypy==0.902
54+
mypy==0.930
5555
commands =
5656
mypy src/pytest_print
5757
mypy tests
5858

59-
[testenv:pkg_desc]
59+
[testenv:readme]
6060
description = check that the long description is valid
6161
skip_install = true
6262
deps =

0 commit comments

Comments
 (0)