From 641b82344844924a361d286fdbd080618ed71539 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:13:56 +0200 Subject: [PATCH 1/7] Add support for python 3.13. --- .circleci/config.yml | 9 ++++++++- .github/workflows/tests.yml | 2 +- jsonargparse_tests/test_formatters.py | 2 +- jsonargparse_tests/test_stubs_resolver.py | 2 +- pyproject.toml | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a80bb9c..7c6ac37b 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/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..694ad160 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", @@ -190,7 +191,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] From bf16cf22da32d3e3db6d75ce8d9de757e9d34064 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:43:11 +0200 Subject: [PATCH 2/7] Try normal jsonnet --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 694ad160..ef450cea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,8 +56,7 @@ jsonschema = [ "jsonschema>=3.2.0", ] jsonnet = [ - "jsonnet>=0.13.0; os_name == 'posix'", - "jsonnet-binary>=0.17.0; os_name != 'posix'", + "jsonnet>=0.20.0", ] urls = [ "requests>=2.18.4", From 84584c8df38aa0e8cc86c9a082e4703447c27ffc Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:36:00 +0200 Subject: [PATCH 3/7] Update pyproject.toml Go back to jsonnet-binary --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ef450cea..c39a7a92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,8 @@ jsonschema = [ "jsonschema>=3.2.0", ] jsonnet = [ - "jsonnet>=0.20.0", + "jsonnet>=0.20.0; os_name == 'posix'", + "jsonnet-binary>=0.17.0; os_name != 'posix'", ] urls = [ "requests>=2.18.4", From e4f18492fe48723e0b13be79946ddb01ae4ad363 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:17:01 +0200 Subject: [PATCH 4/7] Install jsonnet directly from github for windows --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c39a7a92..6fa4b9e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ jsonschema = [ ] jsonnet = [ "jsonnet>=0.20.0; os_name == 'posix'", - "jsonnet-binary>=0.17.0; os_name != 'posix'", + "jsonnet @ https://github.com/google/jsonnet/zipball/master; os_name != 'posix'", ] urls = [ "requests>=2.18.4", From 913a1e52556976176fd86dee3fbf8ae6ee18de17 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Tue, 10 Sep 2024 08:24:43 +0200 Subject: [PATCH 5/7] Update pyproject.toml --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6fa4b9e6..4eed3eca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,8 +56,7 @@ jsonschema = [ "jsonschema>=3.2.0", ] jsonnet = [ - "jsonnet>=0.20.0; os_name == 'posix'", - "jsonnet @ https://github.com/google/jsonnet/zipball/master; os_name != 'posix'", + "jsonnet @ https://github.com/google/jsonnet/zipball/master", ] urls = [ "requests>=2.18.4", From dc9571398ad9874cb54f4d33912d143e3d88cbfb Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:00:01 +0200 Subject: [PATCH 6/7] Update pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4eed3eca..7db750b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,8 @@ jsonschema = [ "jsonschema>=3.2.0", ] jsonnet = [ - "jsonnet @ https://github.com/google/jsonnet/zipball/master", + "jsonnet>=0.20.0; os_name == 'posix'", + "jsonnet @ https://github.com/google/jsonnet/zipball/master ; os_name != 'posix'", ] urls = [ "requests>=2.18.4", From a849a59381e07c2bd431c796025c00a4e769a029 Mon Sep 17 00:00:00 2001 From: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com> Date: Wed, 11 Sep 2024 07:47:11 +0200 Subject: [PATCH 7/7] Fixes --- .circleci/config.yml | 14 +++++++------- CHANGELOG.rst | 6 +++++- pyproject.toml | 5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c6ac37b..04f21ef9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,10 +44,10 @@ jobs: root: . paths: - ./coverage_*.xml - test-py313: - <<: *test-py38 - docker: - - image: cimg/python:3.13 + # test-py313: + # <<: *test-py38 + # docker: + # - image: cimg/python:3.13 test-py312: <<: *test-py38 docker: @@ -156,8 +156,8 @@ workflows: only: /^v\d+\.\d+\.\d+.*$/ - test-py38: <<: *buildreq - - test-py313: - <<: *buildreq + # - test-py313: + # <<: *buildreq - test-py312: <<: *buildreq - test-py311: @@ -172,7 +172,7 @@ workflows: <<: *buildreq - codecov: requires: - - test-py313 + # - test-py313 - test-py312 - test-py311 - test-py310 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/pyproject.toml b/pyproject.toml index 7db750b2..3a25638f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,8 +56,9 @@ jsonschema = [ "jsonschema>=3.2.0", ] jsonnet = [ - "jsonnet>=0.20.0; os_name == 'posix'", - "jsonnet @ https://github.com/google/jsonnet/zipball/master ; os_name != 'posix'", + "jsonnet>=0.13.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",