From d901a1f94b2bc86f57092543100af7b0185fc751 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:10:21 +0200 Subject: [PATCH] Add support for python 3.13 (#554) --- .circleci/config.yml | 9 ++++++++- .github/workflows/tests.yml | 2 +- CHANGELOG.rst | 6 +++++- jsonargparse_tests/test_formatters.py | 2 +- jsonargparse_tests/test_stubs_resolver.py | 2 +- pyproject.toml | 6 ++++-- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a80bb9c..04f21ef9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,10 @@ jobs: root: . paths: - ./coverage_*.xml + # test-py313: + # <<: *test-py38 + # docker: + # - image: cimg/python:3.13 test-py312: <<: *test-py38 docker: @@ -101,7 +105,7 @@ jobs: command: | curl -Os https://uploader.codecov.io/latest/linux/codecov chmod +x codecov - for py in 3.7 3.8 3.9 3.10 3.11 3.12; do + for py in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do for suffix in "" _all _types _pydantic1 _pydantic2; do if [ -f coverage_py${py}${suffix}.xml ]; then ./codecov \ @@ -152,6 +156,8 @@ workflows: only: /^v\d+\.\d+\.\d+.*$/ - test-py38: <<: *buildreq + # - test-py313: + # <<: *buildreq - test-py312: <<: *buildreq - test-py311: @@ -166,6 +172,7 @@ workflows: <<: *buildreq - codecov: requires: + # - test-py313 - test-py312 - test-py311 - test-py310 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db6793fe..ce6cff56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12] + python: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12, 3.13] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b9ab9ff3..1e947a28 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,9 +12,13 @@ The semantic versioning only considers the public API as described in paths are considered internals and can change in minor and patch releases. -v4.32.2 (2024-09-??) +v4.33.0 (2024-09-??) -------------------- +Added +^^^^^ +- Support for Python 3.13. + Fixed ^^^^^ - Callable type with subclass return not showing the ``--*.help`` option (`#567 diff --git a/jsonargparse_tests/test_formatters.py b/jsonargparse_tests/test_formatters.py index 5720062c..df729751 100644 --- a/jsonargparse_tests/test_formatters.py +++ b/jsonargparse_tests/test_formatters.py @@ -26,7 +26,7 @@ def test_help_action_config_file(parser): parser.add_argument("-c", "--cfg", help="Config in yaml/json.", action="config") help_str = get_parser_help(parser) assert "ARG: --print_config" in help_str - assert "ARG: -c CFG, --cfg CFG" in help_str + assert "ARG: -c CFG, --cfg CFG" in help_str or "ARG: -c, --cfg CFG" in help_str assert "ENV: APP_CFG" in help_str assert "Config in yaml/json." in help_str assert "APP_PRINT_CONFIG" not in help_str diff --git a/jsonargparse_tests/test_stubs_resolver.py b/jsonargparse_tests/test_stubs_resolver.py index d83c222f..e3269485 100644 --- a/jsonargparse_tests/test_stubs_resolver.py +++ b/jsonargparse_tests/test_stubs_resolver.py @@ -150,7 +150,7 @@ def test_get_params_classmethod(): expected = expected[:4] + ["compresslevel"] + expected[4:] assert expected == get_param_names(params)[: len(expected)] if sys.version_info >= (3, 10): - assert all(p.annotation is not inspect._empty for p in params if p.name != "compresslevel") + assert all(p.annotation is not inspect._empty for p in params if p.name not in {"compresslevel", "stream"}) with mock_typeshed_client_unavailable(): params = get_params(TarFile, "open") assert expected == get_param_names(params)[: len(expected)] diff --git a/pyproject.toml b/pyproject.toml index 1eb018ab..3a25638f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", @@ -56,7 +57,8 @@ jsonschema = [ ] jsonnet = [ "jsonnet>=0.13.0; os_name == 'posix'", - "jsonnet-binary>=0.17.0; os_name != 'posix'", + "jsonnet-binary>=0.17.0; os_name != 'posix' and python_version < '3.13'", + "jsonnet @ https://github.com/google/jsonnet/zipball/master ; os_name != 'posix' and python_version == '3.13'", ] urls = [ "requests>=2.18.4", @@ -190,7 +192,7 @@ Villegas = "Villegas" [tool.tox] legacy_tox_ini = """ [tox] -envlist = py{37,38,39,310,311,312}-{all,no}-extras,omegaconf +envlist = py{37,38,39,310,311,312,313}-{all,no}-extras,omegaconf skip_missing_interpreters = true [testenv]