diff --git a/.gitignore b/.gitignore index a9d6d13..64729a3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ htmlcov/ .coverage tmp*/ dist/ +.nox *.pyc *.bak diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..6170fb9 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,8 @@ +import nox + +@nox.session( + python=["3.12", "3.11", "3.10"] +) +def test(session): + session.install(".[dev]") + session.run("pytest") diff --git a/setup.cfg b/setup.cfg index 55da6f4..2519372 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,10 +17,6 @@ classifiers = Topic :: Software Development :: Libraries :: Application Frameworks License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - 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 Programming Language :: Python :: 3.12 @@ -31,7 +27,7 @@ package_dir = = src packages = find_namespace: include_package_data = True -python_requires = >=3.6, <4 +python_requires = >=3.10, <4 install_requires = jsonschema colorama diff --git a/src/objdictgen/gen_cfile.py b/src/objdictgen/gen_cfile.py index 1f23e0f..dec13fe 100644 --- a/src/objdictgen/gen_cfile.py +++ b/src/objdictgen/gen_cfile.py @@ -22,7 +22,7 @@ from collections import UserDict from dataclasses import dataclass from pathlib import Path -from typing import Any, Self +from typing import Any from objdictgen.maps import OD from objdictgen.typing import NodeProtocol, TODValue, TPath @@ -71,7 +71,7 @@ def __init__(self, context: "CFileContext", text: str): self.text: str = text self.context: "CFileContext" = context - def __iadd__(self, other: "str|Text") -> Self: + def __iadd__(self, other: "str|Text") -> "Text": """Add a string to the text without formatting.""" self.text += str(other) return self @@ -80,7 +80,7 @@ def __add__(self, other: "str|Text") -> "Text": """Add a string to the text without formatting.""" return Text(self.context, self.text + str(other)) - def __imod__(self, other: str) -> Self: + def __imod__(self, other: str) -> "Text": """Add a string to the text with formatting.""" self.text += other.format(**self.context) return self diff --git a/src/objdictgen/node.py b/src/objdictgen/node.py index 68d6453..a9a70c1 100644 --- a/src/objdictgen/node.py +++ b/src/objdictgen/node.py @@ -20,7 +20,7 @@ import copy import logging -from typing import Any, Generator, Iterable, Iterator, Self +from typing import Any, Generator, Iterable, Iterator import colorama @@ -236,7 +236,7 @@ def asdict(self) -> dict[str, Any]: """ Return the class data as a dict """ return copy.deepcopy(self.__dict__) - def copy(self) -> Self: + def copy(self) -> "Node": """ Return a copy of the node """ diff --git a/tests/test_imports.py b/tests/test_imports.py new file mode 100644 index 0000000..d4a0623 --- /dev/null +++ b/tests/test_imports.py @@ -0,0 +1,45 @@ + +def test_import_eds_utils(): + import objdictgen.eds_utils + +def test_import_gen_cfile(): + import objdictgen.gen_cfile + +def test_import_jsonod(): + import objdictgen.jsonod + +def test_import_maps(): + import objdictgen.maps + +def test_import_node(): + import objdictgen.node + +def test_import_nodelist(): + import objdictgen.nodelist + +def test_import_nodemanager(): + import objdictgen.nodemanager + +def test_import_nosis(): + import objdictgen.nosis + +def test_import_typing(): + import objdictgen.typing + +def test_import_ui_commondialogs(): + import objdictgen.ui.commondialogs + +def test_import_ui_exception(): + import objdictgen.ui.exception + +def test_import_ui_networkedit(): + import objdictgen.ui.networkedit + +def test_import_ui_networkeditortemplate(): + import objdictgen.ui.networkeditortemplate + +def test_import_ui_objdictedit(): + import objdictgen.ui.objdictedit + +def test_import_ui_subindextable(): + import objdictgen.ui.subindextable