Skip to content

Commit

Permalink
Declare support for Python 3.13
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 704381933
  • Loading branch information
oprypin authored and copybara-github committed Dec 11, 2024
1 parent ae0a316 commit ec76f4a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
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"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
Expand Down
5 changes: 4 additions & 1 deletion absl/flags/tests/argparse_flags_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ def test_help_main_module_flags(self):
# Only the short name is shown in the usage string.
self.assertIn('[-s ABSL_STRING]', help_message)
# Both names are included in the options section.
self.assertIn('-s ABSL_STRING, --absl_string ABSL_STRING', help_message)
if sys.version_info >= (3, 13):
self.assertIn(' -s, --absl_string ABSL_STRING', help_message)
else:
self.assertIn(' -s ABSL_STRING, --absl_string ABSL_STRING', help_message)
# Verify help messages.
self.assertIn('help for --absl_string=%.', help_message)
self.assertIn('<apple|orange>: help for --absl_enum.', help_message)
Expand Down
3 changes: 3 additions & 0 deletions absl/testing/tests/parameterized_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,9 @@ def test_successful_execution(self):
self.assertEqual(2, res.testsRun)
self.assertTrue(res.wasSuccessful())

@unittest.skipIf(
sys.version_info >= (3, 13), 'makeSuite was removed in Python 3.13'
)
def test_metaclass_side_effects(self):
ts = unittest.makeSuite(self.MyParams, suiteClass=self.MySuite)

Expand Down
6 changes: 4 additions & 2 deletions absl/testing/tests/xml_reporter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ def xml_escaped_exception_type(exception_type):
FAILURE_MESSAGE = r"""
<failure message="e" type="{}"><!\[CDATA\[Traceback \(most recent call last\):
File ".*xml_reporter_test\.py", line \d+, in get_sample_failure
self.fail\(\'e\'\)
self.fail\(\'e\'\)(
~~~~~~~~~\^\^\^\^\^)?
AssertionError: e
\]\]></failure>""".format(xml_escaped_exception_type(AssertionError))

ERROR_MESSAGE = r"""
<error message="invalid&#x20;literal&#x20;for&#x20;int\(\)&#x20;with&#x20;base&#x20;10:&#x20;(&apos;)?a(&apos;)?" type="{}"><!\[CDATA\[Traceback \(most recent call last\):
File ".*xml_reporter_test\.py", line \d+, in get_sample_error
int\('a'\)
int\('a'\)(
~~~\^\^\^\^\^)?
ValueError: invalid literal for int\(\) with base 10: '?a'?
\]\]></error>""".format(xml_escaped_exception_type(ValueError))

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: Apache Software License',
Expand Down

0 comments on commit ec76f4a

Please sign in to comment.