Skip to content

Commit

Permalink
Merge pull request #151 from kddubey/to-tap-class-fix-py313
Browse files Browse the repository at this point in the history
Fix #150
  • Loading branch information
swansonk14 authored Oct 21, 2024
2 parents 1a3af2a + 00dcff8 commit 69d2f0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@main
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Typing :: Typed",
Expand Down
9 changes: 7 additions & 2 deletions tests/test_to_tap_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
_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
# 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
_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_WITH_ALIAS = (
"-arg, --argument_with_really_long_name ARGUMENT_WITH_REALLY_LONG_NAME"
if not sys.version_info < (3, 13)
else "-arg ARGUMENT_WITH_REALLY_LONG_NAME, --argument_with_really_long_name ARGUMENT_WITH_REALLY_LONG_NAME"
)


@dataclasses.dataclass
Expand Down Expand Up @@ -416,7 +421,7 @@ def test_subclasser_complex_help_message(class_or_function_: Any):
{description}
{_OPTIONS_TITLE}:
-arg ARGUMENT_WITH_REALLY_LONG_NAME, --argument_with_really_long_name ARGUMENT_WITH_REALLY_LONG_NAME
{_ARG_WITH_ALIAS}
(Union[float, int], default=3) This argument has a long name and will be aliased with a short
one
--arg_int ARG_INT (int, required) some integer
Expand Down

0 comments on commit 69d2f0a

Please sign in to comment.