Skip to content

Commit eb77610

Browse files
authored
Drop python 2 support (#17)
1 parent 1a941ed commit eb77610

File tree

14 files changed

+209
-183
lines changed

14 files changed

+209
-183
lines changed

.coveragerc

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

.github/workflows/check.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,50 +24,38 @@ jobs:
2424
- Windows
2525
- MacOs
2626
py:
27+
- 3.10.0-beta.2
2728
- 3.9
2829
- 3.8
2930
- 3.7
3031
- 3.6
3132
- pypy3
32-
- 3.5
33-
- 2.7
34-
- pypy2
3533
steps:
36-
- name: setup python for tox
34+
- name: Setup python for tox
3735
uses: actions/setup-python@v2
3836
with:
3937
python-version: 3.9
40-
- name: install tox
38+
- name: Install tox
4139
run: python -m pip install tox
4240
- uses: actions/checkout@v2
43-
- name: setup python for test ${{ matrix.py }}
41+
- name: Setup python for test ${{ matrix.py }}
4442
uses: actions/setup-python@v2
4543
with:
4644
python-version: ${{ matrix.py }}
47-
- name: pick environment to run
45+
- name: Pick environment to run
4846
run: |
4947
import subprocess; import json; import os
5048
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-
with open(os.environ['GITHUB_ENV'], 'a') as file_handler:
52-
file_handler.write('TOXENV=' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else "")) + "\n")
49+
with open(os.environ["GITHUB_ENV"], "a") as file_handler:
50+
file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}') + "\n")
5351
shell: python
54-
- name: setup test suite
52+
- name: Setup test suite
5553
run: tox -vv --notest
56-
- name: run test suite
54+
- name: Run test suite
5755
run: tox --skip-pkg-install
5856
env:
5957
PYTEST_ADDOPTS: "-vv --durations=20"
6058
CI_RUN: "yes"
61-
DIFF_AGAINST: HEAD
62-
- name: rename coverage report file
63-
run: |
64-
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
65-
shell: python
66-
- uses: codecov/codecov-action@v1
67-
with:
68-
file: ./.tox/coverage.xml
69-
flags: tests
70-
name: ${{ matrix.py }} - ${{ matrix.os }}
7159

7260
check:
7361
name: check ${{ matrix.tox_env }} - ${{ matrix.os }}
@@ -79,20 +67,21 @@ jobs:
7967
- Ubuntu
8068
- Windows
8169
tox_env:
70+
- type
8271
- dev
8372
- pkg_desc
8473
exclude:
8574
- { os: Windows, tox_env: pkg_desc }
8675

8776
steps:
8877
- uses: actions/checkout@v2
89-
- name: setup python
78+
- name: Setup python
9079
uses: actions/setup-python@v2
9180
with:
9281
python-version: 3.9
93-
- name: install tox
82+
- name: Install tox
9483
run: python -m pip install tox
95-
- name: run check for ${{ matrix.tox_env }}
84+
- name: Run check for ${{ matrix.tox_env }}
9685
run: python -m tox -e ${{ matrix.tox_env }}
9786
env:
9887
UPGRADE_ADVISORY: "yes"
@@ -102,16 +91,16 @@ jobs:
10291
needs: [check, test, pre-commit]
10392
runs-on: ubuntu-latest
10493
steps:
105-
- name: setup python to build package
94+
- name: Setup python to build package
10695
uses: actions/setup-python@v2
10796
with:
10897
python-version: 3.9
109-
- name: install pep517
110-
run: python -m pip install pep517
98+
- name: Install build
99+
run: python -m pip install 'build>=0.4'
111100
- uses: actions/checkout@v2
112-
- name: build package
113-
run: python -m pep517.build -s -b . -o dist
114-
- name: publish to PyPi
101+
- name: Build package
102+
run: python -m build -s -w . -o dist
103+
- name: Publish to PyPi
115104
uses: pypa/gh-action-pypi-publish@master
116105
with:
117106
skip_existing: true

.pre-commit-config.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
1414
- repo: https://github.com/asottile/pyupgrade
15-
rev: v2.18.2
15+
rev: v2.19.4
1616
hooks:
1717
- id: pyupgrade
1818
- repo: https://github.com/PyCQA/isort
1919
rev: 5.8.0
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/psf/black
23-
rev: 21.5b1
23+
rev: 21.6b0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/asottile/blacken-docs
2727
rev: v1.10.0
2828
hooks:
2929
- id: blacken-docs
30-
additional_dependencies: [black==20.8b1]
30+
additional_dependencies: [ black==21.6b0 ]
3131
- repo: https://github.com/pre-commit/pygrep-hooks
32-
rev: v1.8.0
32+
rev: v1.9.0
3333
hooks:
3434
- id: rst-backticks
3535
- repo: https://github.com/asottile/setup-cfg-fmt
3636
rev: v1.17.0
3737
hooks:
3838
- id: setup-cfg-fmt
39-
args: [--min-py3-version, "3.4"]
39+
args: [--min-py3-version, "3.6", "--max-py-version", "3.10"]
4040
- repo: https://github.com/tox-dev/tox-ini-fmt
4141
rev: "0.5.0"
4242
hooks:
@@ -46,4 +46,10 @@ repos:
4646
rev: "3.9.2"
4747
hooks:
4848
- id: flake8
49-
additional_dependencies: ["flake8-bugbear == 20.1.4"]
49+
additional_dependencies: [
50+
"flake8-bugbear == 21.4.3",
51+
"flake8-unused-arguments == 0.0.6",
52+
"flake8-comprehensions == 3.5.0",
53+
"flake8-spellcheck == 0.24.0",
54+
"flake8-pytest-style == 1.4.2",
55+
]

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22

33
## [Unreleased](https://github.com/pytest-dev/pytest-print/tree/HEAD)
44

5-
[Full Changelog](https://github.com/pytest-dev/pytest-print/compare/0.2.0...HEAD)
5+
## [0.3.0](https://github.com/pytest-dev/pytest-print/tree/0.3.0) (2021-06-17)
66

7-
**Closed issues:**
7+
[Full Changelog](https://github.com/pytest-dev/pytest-print/compare/0.2.1...0.3.0)
8+
9+
**Merged pull requests:**
10+
11+
- Drop Python 2 support [\#6](https://github.com/pytest-dev/pytest-print/issues/7)
12+
13+
## [0.2.1](https://github.com/pytest-dev/pytest-print/tree/0.2.1) (2020-10-23)
14+
15+
[Full Changelog](https://github.com/pytest-dev/pytest-print/compare/0.2.0...0.2.1)
16+
17+
**Implemented enhancements:**
818

919
- add session level support [\#6](https://github.com/pytest-dev/pytest-print/issues/6)
1020

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ known_first_party = ["pytest_print"]
1313
write_to = "src/pytest_print/version.py"
1414
write_to_template = """
1515
\"\"\" Version information \"\"\"
16-
from __future__ import unicode_literals
1716
1817
__version__ = "{version}"
1918
"""

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.8
7+
version: 3.9
88
pip_install: true
99
extra_requirements:
1010
- doc

setup.cfg

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description = pytest-print adds the printer fixture you can use to print message
44
long_description = file: README.md
55
long_description_content_type = text/markdown
66
url = https://github.com/pytest-dev/pytest-print#pytest-print
7-
author = Bernat Gabor
87
maintainer = Bernat Gabor
98
maintainer_email = gaborjbernat@gmail.com
109
license = MIT
@@ -19,14 +18,13 @@ classifiers =
1918
Operating System :: MacOS :: MacOS X
2019
Operating System :: Microsoft :: Windows
2120
Operating System :: POSIX
22-
Programming Language :: Python :: 2
23-
Programming Language :: Python :: 2.7
2421
Programming Language :: Python :: 3
25-
Programming Language :: Python :: 3.5
22+
Programming Language :: Python :: 3 :: Only
2623
Programming Language :: Python :: 3.6
2724
Programming Language :: Python :: 3.7
2825
Programming Language :: Python :: 3.8
2926
Programming Language :: Python :: 3.9
27+
Programming Language :: Python :: 3.10
3028
Topic :: Software Development :: Libraries
3129
Topic :: Software Development :: Testing
3230
Topic :: Utilities
@@ -38,8 +36,8 @@ project_urls =
3836
[options]
3937
packages = find:
4038
install_requires =
41-
pytest>=3.0.0
42-
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
39+
pytest>=6
40+
python_requires = >=3.6
4341
include_package_data = True
4442
package_dir =
4543
=src
@@ -54,7 +52,9 @@ pytest11 = pytest_print = pytest_print
5452
[options.extras_require]
5553
test =
5654
coverage>=5
57-
pytest>=4
55+
56+
[options.package_data]
57+
pytest_print = py.typed
5858

5959
[sdist]
6060
formats = gztar
@@ -65,3 +65,57 @@ universal = true
6565
[flake8]
6666
max-line-length = 120
6767
ignore = F401, H301, E203
68+
69+
[coverage:run]
70+
source =
71+
${_COVERAGE_SRC}
72+
${_COVERAGE_TEST}
73+
parallel = True
74+
branch = True
75+
dynamic_context = test_function
76+
77+
[coverage:report]
78+
fail_under = 100
79+
skip_covered = true
80+
show_missing = true
81+
omit =
82+
tests/example.py
83+
84+
[coverage:html]
85+
show_contexts = True
86+
skip_covered = False
87+
skip_empty = False
88+
89+
[coverage:paths]
90+
source =
91+
src
92+
.tox*/*/lib/python*/site-packages
93+
.tox*/pypy*/site-packages
94+
.tox*\*\Lib\site-packages\
95+
*/src
96+
*\src
97+
98+
[tool:pytest]
99+
addopts = -ra --showlocals -vv
100+
testpaths = tests
101+
xfail_strict = True
102+
junit_family = xunit2
103+
104+
[mypy]
105+
python_version = 3.6
106+
disallow_any_generics = True
107+
disallow_subclassing_any = True
108+
disallow_untyped_calls = True
109+
disallow_untyped_defs = True
110+
disallow_incomplete_defs = True
111+
disallow_untyped_decorators = True
112+
show_error_codes = True
113+
no_implicit_optional = True
114+
warn_redundant_casts = True
115+
warn_unused_ignores = False
116+
warn_no_return = True
117+
warn_return_any = True
118+
implicit_reexport = False
119+
strict_equality = True
120+
warn_unused_configs = True
121+
pretty = True

0 commit comments

Comments
 (0)