Skip to content

Commit fe0d2d8

Browse files
committed
Removing Python 3.8 due to end-of-life
1 parent 69d2f0a commit fe0d2d8

File tree

9 files changed

+8
-22
lines changed

9 files changed

+8
-22
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest, macos-latest, windows-latest]
19-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
19+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2020

2121
steps:
2222
- uses: actions/checkout@main

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Jesse Michel and Kyle Swanson
1+
Copyright (c) 2024 Jesse Michel and Kyle Swanson
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Running `python square.py --num 2` will print `The square of your number is 4.0.
3939

4040
## Installation
4141

42-
Tap requires Python 3.8+
42+
Tap requires Python 3.9+
4343

4444
To install Tap from PyPI run:
4545

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ dependencies = [
2121
"packaging",
2222
"typing-inspect >= 0.7.1",
2323
]
24-
requires-python = ">=3.8"
24+
requires-python = ">=3.9"
2525
classifiers = [
2626
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.8",
2827
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",

src/tap/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def enforce_reproducibility(
558558
raise ValueError(f"{no_reproducibility_message}: Uncommitted changes " f"in current args.")
559559

560560

561-
# TODO: remove this once typing_inspect.get_origin is fixed for Python 3.8, 3.9, and 3.10
561+
# TODO: remove this once typing_inspect.get_origin is fixed for Python 3.9 and 3.10
562562
# https://github.com/ilevkivskyi/typing_inspect/issues/64
563563
# https://github.com/ilevkivskyi/typing_inspect/issues/65
564564
def get_origin(tp: Any) -> Any:

tests/test_actions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def configure(self):
171171
# tried redirecting stderr using unittest.mock.patch
172172
# VersionTap().parse_args(['--version'])
173173

174-
@unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8')
175174
def test_actions_extend(self):
176175
class ExtendTap(Tap):
177176
arg = [1, 2]
@@ -185,7 +184,6 @@ def configure(self):
185184
args = ExtendTap().parse_args("--arg a b --arg a --arg c d".split())
186185
self.assertEqual(args.arg, [1, 2] + "a b a c d".split())
187186

188-
@unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8')
189187
def test_actions_extend_list(self):
190188
class ExtendListTap(Tap):
191189
arg: List = ["hi"]
@@ -196,7 +194,6 @@ def configure(self):
196194
args = ExtendListTap().parse_args("--arg yo yo --arg yoyo --arg yo yo".split())
197195
self.assertEqual(args.arg, "hi yo yo yoyo yo yo".split())
198196

199-
@unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8')
200197
def test_actions_extend_list_int(self):
201198
class ExtendListIntTap(Tap):
202199
arg: List[int] = [0]

tests/test_integration.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def test_both_assigned_okay(self):
120120

121121

122122
class ParameterizedStandardCollectionTests(TestCase):
123-
@unittest.skipIf(
124-
sys.version_info < (3, 9), "Parameterized standard collections (e.g., list[int]) introduced in Python 3.9"
125-
)
126123
def test_parameterized_standard_collection(self):
127124
class ParameterizedStandardCollectionTap(Tap):
128125
arg_list_str: list[str]

tests/test_tapify.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,6 @@ def __eq__(self, other: str) -> bool:
321321

322322
self.assertEqual(output, "complex things require 1 0 Person(jesse)")
323323

324-
@unittest.skipIf(
325-
sys.version_info < (3, 9), "Parameterized standard collections (e.g., list[int]) introduced in Python 3.9"
326-
)
327324
def test_tapify_complex_types_parameterized_standard(self):
328325
def concat(complexity: list[int], requires: tuple[int, int], intelligence: Person) -> str:
329326
return f'{" ".join(map(str, complexity))} {requires[0]} {requires[1]} {intelligence}'

tests/test_to_tap_class.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
_IS_PYDANTIC_V1 = Version(pydantic.__version__) < Version("2.0.0")
2525

2626

27-
# To properly test the help message, we need to know how argparse formats it. It changed from 3.8 -> 3.9 -> 3.10 -> 3.13
27+
# To properly test the help message, we need to know how argparse formats it. It changed from 3.9 -> 3.10 -> 3.13
2828
_OPTIONS_TITLE = "options" if not sys.version_info < (3, 10) else "optional arguments"
29-
_ARG_LIST_DOTS = "..." if not sys.version_info < (3, 9) else "[ARG_LIST ...]"
29+
_ARG_LIST_DOTS = "..."
3030
_ARG_WITH_ALIAS = (
3131
"-arg, --argument_with_really_long_name ARGUMENT_WITH_REALLY_LONG_NAME"
3232
if not sys.version_info < (3, 13)
@@ -472,8 +472,6 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
472472
"--arg_int 1 --baz X --foo b",
473473
SystemExit(
474474
"error: argument {a,b}: invalid choice: 'X' (choose from 'a', 'b')"
475-
if sys.version_info >= (3, 9)
476-
else "error: invalid choice: 'X' (choose from 'a', 'b')"
477475
),
478476
),
479477
(
@@ -493,14 +491,12 @@ def test_subclasser_subparser(
493491
_test_subclasser(subclasser_subparser, class_or_function_, args_string_and_arg_to_expected_value, test_call=False)
494492

495493

496-
# @pytest.mark.skipif(sys.version_info < (3, 10), reason="argparse is different. Need to fix help_message_expected")
497494
@pytest.mark.parametrize(
498495
"args_string_and_description_and_expected_message",
499496
[
500497
(
501498
"-h",
502499
"Script description",
503-
# foo help likely missing b/c class nesting. In a demo in a Python 3.8 env, foo help appears in -h
504500
f"""
505501
usage: pytest [--foo] --arg_int ARG_INT [--arg_bool] [--arg_list [ARG_LIST {_ARG_LIST_DOTS}]] [-h]
506502
{{a,b}} ...
@@ -513,7 +509,7 @@ def test_subclasser_subparser(
513509
b b help
514510
515511
{_OPTIONS_TITLE}:
516-
--foo (bool, default=False) {'' if sys.version_info < (3, 9) else 'foo help'}
512+
--foo (bool, default=False) foo help
517513
--arg_int ARG_INT (int, required) some integer
518514
--arg_bool (bool, default=True)
519515
--arg_list [ARG_LIST {_ARG_LIST_DOTS}]

0 commit comments

Comments
 (0)