diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6585066..8a00450 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@main diff --git a/LICENSE.txt b/LICENSE.txt index cbeb803..5e8cd4d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2022 Jesse Michel and Kyle Swanson +Copyright (c) 2024 Jesse Michel and Kyle Swanson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a8cfefd..b4d80c4 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Running `python square.py --num 2` will print `The square of your number is 4.0. ## Installation -Tap requires Python 3.8+ +Tap requires Python 3.9+ To install Tap from PyPI run: diff --git a/pyproject.toml b/pyproject.toml index d802aec..0506d0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,10 +21,9 @@ dependencies = [ "packaging", "typing-inspect >= 0.7.1", ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/src/tap/utils.py b/src/tap/utils.py index 2bf788c..8a69467 100644 --- a/src/tap/utils.py +++ b/src/tap/utils.py @@ -558,7 +558,7 @@ def enforce_reproducibility( raise ValueError(f"{no_reproducibility_message}: Uncommitted changes " f"in current args.") -# TODO: remove this once typing_inspect.get_origin is fixed for Python 3.8, 3.9, and 3.10 +# TODO: remove this once typing_inspect.get_origin is fixed for Python 3.9 and 3.10 # https://github.com/ilevkivskyi/typing_inspect/issues/64 # https://github.com/ilevkivskyi/typing_inspect/issues/65 def get_origin(tp: Any) -> Any: diff --git a/tests/test_actions.py b/tests/test_actions.py index 8eb6003..cb60dd8 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -171,7 +171,6 @@ def configure(self): # tried redirecting stderr using unittest.mock.patch # VersionTap().parse_args(['--version']) - @unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8') def test_actions_extend(self): class ExtendTap(Tap): arg = [1, 2] @@ -185,7 +184,6 @@ def configure(self): args = ExtendTap().parse_args("--arg a b --arg a --arg c d".split()) self.assertEqual(args.arg, [1, 2] + "a b a c d".split()) - @unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8') def test_actions_extend_list(self): class ExtendListTap(Tap): arg: List = ["hi"] @@ -196,7 +194,6 @@ def configure(self): args = ExtendListTap().parse_args("--arg yo yo --arg yoyo --arg yo yo".split()) self.assertEqual(args.arg, "hi yo yo yoyo yo yo".split()) - @unittest.skipIf(sys.version_info < (3, 8), 'action="extend" introduced in argparse in Python 3.8') def test_actions_extend_list_int(self): class ExtendListIntTap(Tap): arg: List[int] = [0] diff --git a/tests/test_integration.py b/tests/test_integration.py index 97d82b4..e97a44e 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -120,9 +120,6 @@ def test_both_assigned_okay(self): class ParameterizedStandardCollectionTests(TestCase): - @unittest.skipIf( - sys.version_info < (3, 9), "Parameterized standard collections (e.g., list[int]) introduced in Python 3.9" - ) def test_parameterized_standard_collection(self): class ParameterizedStandardCollectionTap(Tap): arg_list_str: list[str] diff --git a/tests/test_tapify.py b/tests/test_tapify.py index 7e2c2da..9a575f2 100644 --- a/tests/test_tapify.py +++ b/tests/test_tapify.py @@ -321,9 +321,6 @@ def __eq__(self, other: str) -> bool: self.assertEqual(output, "complex things require 1 0 Person(jesse)") - @unittest.skipIf( - sys.version_info < (3, 9), "Parameterized standard collections (e.g., list[int]) introduced in Python 3.9" - ) def test_tapify_complex_types_parameterized_standard(self): def concat(complexity: list[int], requires: tuple[int, int], intelligence: Person) -> str: return f'{" ".join(map(str, complexity))} {requires[0]} {requires[1]} {intelligence}' diff --git a/tests/test_to_tap_class.py b/tests/test_to_tap_class.py index 2bc10f7..c26ba1a 100644 --- a/tests/test_to_tap_class.py +++ b/tests/test_to_tap_class.py @@ -24,9 +24,9 @@ _IS_PYDANTIC_V1 = Version(pydantic.__version__) < Version("2.0.0") -# 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 +# To properly test the help message, we need to know how argparse formats it. It changed from 3.9 -> 3.10 -> 3.13 _OPTIONS_TITLE = "options" if not sys.version_info < (3, 10) else "optional arguments" -_ARG_LIST_DOTS = "..." if not sys.version_info < (3, 9) else "[ARG_LIST ...]" +_ARG_LIST_DOTS = "..." _ARG_WITH_ALIAS = ( "-arg, --argument_with_really_long_name ARGUMENT_WITH_REALLY_LONG_NAME" if not sys.version_info < (3, 13) @@ -472,8 +472,6 @@ def test_subclasser_complex_help_message(class_or_function_: Any): "--arg_int 1 --baz X --foo b", SystemExit( "error: argument {a,b}: invalid choice: 'X' (choose from 'a', 'b')" - if sys.version_info >= (3, 9) - else "error: invalid choice: 'X' (choose from 'a', 'b')" ), ), ( @@ -493,14 +491,12 @@ def test_subclasser_subparser( _test_subclasser(subclasser_subparser, class_or_function_, args_string_and_arg_to_expected_value, test_call=False) -# @pytest.mark.skipif(sys.version_info < (3, 10), reason="argparse is different. Need to fix help_message_expected") @pytest.mark.parametrize( "args_string_and_description_and_expected_message", [ ( "-h", "Script description", - # foo help likely missing b/c class nesting. In a demo in a Python 3.8 env, foo help appears in -h f""" usage: pytest [--foo] --arg_int ARG_INT [--arg_bool] [--arg_list [ARG_LIST {_ARG_LIST_DOTS}]] [-h] {{a,b}} ... @@ -513,7 +509,7 @@ def test_subclasser_subparser( b b help {_OPTIONS_TITLE}: - --foo (bool, default=False) {'' if sys.version_info < (3, 9) else 'foo help'} + --foo (bool, default=False) foo help --arg_int ARG_INT (int, required) some integer --arg_bool (bool, default=True) --arg_list [ARG_LIST {_ARG_LIST_DOTS}]