diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1b34506..2183360 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8.18", "3.9.25", "3.10.18", "3.11.14", "3.12.12", "3.13.11", "3.14.2"] + python-version: ["3.9.25", "3.10.18", "3.11.14", "3.12.12", "3.13.11", "3.14.2"] steps: - uses: actions/checkout@v3 diff --git a/README.rst b/README.rst index e33584b..0885efe 100644 --- a/README.rst +++ b/README.rst @@ -4,8 +4,8 @@ :alt: Unittest Completion Status .. |badge2| image:: https://raw.githubusercontent.com/robabram/python-easy-json/coverage-badge/coverage.svg?raw=true :alt: Code Coverage Status -.. |badge3| image:: https://img.shields.io/badge/python-v3.8%20|%20v3.9%20|%20v3.10%20|%20v3.11%20|%20v3.12%20|%20v3.13%20|%20v3.14-blue - :alt: Python v3.8, v3.9, v3.10, v3.11, v3.12, v3.13, v3.14 +.. |badge3| image:: https://img.shields.io/badge/python-v3.9%20|%20v3.10%20|%20v3.11%20|%20v3.12%20|%20v3.13%20|%20v3.14-blue + :alt: Python v3.9, v3.10, v3.11, v3.12, v3.13, v3.14 **************************************************************************************** diff --git a/setup.py b/setup.py index 18c1f0d..9768705 100644 --- a/setup.py +++ b/setup.py @@ -55,8 +55,6 @@ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/tests/test_json_with_lists.py b/tests/test_json_with_lists.py index 88dae8a..0fd1168 100644 --- a/tests/test_json_with_lists.py +++ b/tests/test_json_with_lists.py @@ -2,7 +2,8 @@ # This file is subject to the terms and conditions defined in the # file 'LICENSE', which is part of this source code package. # -from typing import List +import json +from typing import List, Optional from tests.base_test import BaseTestCase from python_easy_json import JSONObject @@ -34,3 +35,30 @@ def test_data_with_lists(self): for i in obj.integer_list: self.assertIsInstance(i, int) self.assertIn(i, [1, 2, 3]) + + def test_nested_lists(self): + """ User supplied unittest for issue #25 """ + class RR(JSONObject): + values: Optional[list[int]] # here list is okay + + class P(JSONObject): + R: List[RR] # here list cannot be used + + class Q(JSONObject): + W: List[P] # and here too + + class P2(JSONObject): + R: List[RR] # here list cannot be used + + class Q2(JSONObject): + W: List[P] # and here too + + data = json.loads('{"W": [{"R": [{"values": [1, 2, 3]}]}]}') + # OK + x = Q(data) + self.assertIsInstance(x, Q) + + # list() takes no keyword arguments + data = json.loads('{"W": [{"R": [{"values": [1, 2, 3]}]}]}') + x2 = Q2(data) + self.assertIsInstance(x2, Q2)