Skip to content

Commit 742e8e7

Browse files
committed
Require 3.7 as minimal Python version
1 parent 7092137 commit 742e8e7

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

cli_test_helpers/commands.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
Useful commands for writing tests for your CLI tool.
33
"""
44

5-
from sys import version_info
5+
from subprocess import run
66
from types import SimpleNamespace as Namespace
77

8-
if version_info < (3, 7):
9-
from subprocess import PIPE, run
10-
else:
11-
from subprocess import run
12-
138
__all__ = []
149

1510

@@ -20,12 +15,7 @@ def shell(command, **kwargs):
2015
This is a better version of ``os.system()`` that captures output and
2116
returns a convenient namespace object.
2217
"""
23-
if version_info < (3, 7):
24-
completed = run(
25-
command, shell=True, stdout=PIPE, stderr=PIPE, check=False, **kwargs
26-
)
27-
else:
28-
completed = run(command, shell=True, capture_output=True, check=False, **kwargs)
18+
completed = run(command, shell=True, capture_output=True, check=False, **kwargs)
2919

3020
return Namespace(
3121
exit_code=completed.returncode,

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ classifiers = [
2020
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
2121
"Programming Language :: Python",
2222
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3 :: Only",
2324
"Programming Language :: Python :: 3.7",
2425
"Programming Language :: Python :: 3.8",
2526
"Programming Language :: Python :: 3.9",
@@ -38,6 +39,7 @@ keywords = [
3839
"testing",
3940
"helpers",
4041
]
42+
requires-python = ">=3.7"
4143

4244
[project.urls]
4345
homepage = "https://github.com/painless-software/python-cli-test-helpers"
@@ -65,12 +67,10 @@ extend-ignore = [
6567
"D205",
6668
"D212",
6769
"Q000",
68-
"UP022", # Python < 3.7 only (`stderr=PIPE`)
69-
"UP036", # Python < 3.7 only
7070
]
7171

7272
[tool.ruff.lint.per-file-ignores]
73-
"cli_test_helpers/commands.py" = ["COM812", "S602"]
73+
"cli_test_helpers/commands.py" = ["S602"]
7474
"tests/*.py" = ["D400", "INP001", "S101"]
7575

7676
[tool.setuptools.packages.find]

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ envlist =
1414
[testenv]
1515
description = Unit tests
1616
deps =
17-
py3{9,10,11,12}: setuptools>=50
1817
coverage[toml]
1918
pytest
2019
commands =

0 commit comments

Comments
 (0)