Skip to content

Commit a2e286e

Browse files
committed
Added nox testing
* Reduced min version to py 3.10
1 parent a60bad4 commit a2e286e

File tree

6 files changed

+60
-10
lines changed

6 files changed

+60
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ htmlcov/
88
.coverage
99
tmp*/
1010
dist/
11+
.nox
1112

1213
*.pyc
1314
*.bak

noxfile.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import nox
2+
3+
@nox.session(
4+
python=["3.12", "3.11", "3.10"]
5+
)
6+
def test(session):
7+
session.install(".[dev]")
8+
session.run("pytest")

setup.cfg

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ classifiers =
1717
Topic :: Software Development :: Libraries :: Application Frameworks
1818
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
1919
Programming Language :: Python :: 3
20-
Programming Language :: Python :: 3.6
21-
Programming Language :: Python :: 3.7
22-
Programming Language :: Python :: 3.8
23-
Programming Language :: Python :: 3.9
2420
Programming Language :: Python :: 3.10
2521
Programming Language :: Python :: 3.11
2622
Programming Language :: Python :: 3.12
@@ -31,7 +27,7 @@ package_dir =
3127
= src
3228
packages = find_namespace:
3329
include_package_data = True
34-
python_requires = >=3.6, <4
30+
python_requires = >=3.10, <4
3531
install_requires =
3632
jsonschema
3733
colorama

src/objdictgen/gen_cfile.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from collections import UserDict
2323
from dataclasses import dataclass
2424
from pathlib import Path
25-
from typing import Any, Self
25+
from typing import Any
2626

2727
from objdictgen.maps import OD
2828
from objdictgen.typing import NodeProtocol, TODValue, TPath
@@ -71,7 +71,7 @@ def __init__(self, context: "CFileContext", text: str):
7171
self.text: str = text
7272
self.context: "CFileContext" = context
7373

74-
def __iadd__(self, other: "str|Text") -> Self:
74+
def __iadd__(self, other: "str|Text") -> "Text":
7575
"""Add a string to the text without formatting."""
7676
self.text += str(other)
7777
return self
@@ -80,7 +80,7 @@ def __add__(self, other: "str|Text") -> "Text":
8080
"""Add a string to the text without formatting."""
8181
return Text(self.context, self.text + str(other))
8282

83-
def __imod__(self, other: str) -> Self:
83+
def __imod__(self, other: str) -> "Text":
8484
"""Add a string to the text with formatting."""
8585
self.text += other.format(**self.context)
8686
return self

src/objdictgen/node.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import copy
2222
import logging
23-
from typing import Any, Generator, Iterable, Iterator, Self
23+
from typing import Any, Generator, Iterable, Iterator
2424

2525
import colorama
2626

@@ -236,7 +236,7 @@ def asdict(self) -> dict[str, Any]:
236236
""" Return the class data as a dict """
237237
return copy.deepcopy(self.__dict__)
238238

239-
def copy(self) -> Self:
239+
def copy(self) -> "Node":
240240
"""
241241
Return a copy of the node
242242
"""

tests/test_imports.py

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
def test_import_eds_utils():
3+
import objdictgen.eds_utils
4+
5+
def test_import_gen_cfile():
6+
import objdictgen.gen_cfile
7+
8+
def test_import_jsonod():
9+
import objdictgen.jsonod
10+
11+
def test_import_maps():
12+
import objdictgen.maps
13+
14+
def test_import_node():
15+
import objdictgen.node
16+
17+
def test_import_nodelist():
18+
import objdictgen.nodelist
19+
20+
def test_import_nodemanager():
21+
import objdictgen.nodemanager
22+
23+
def test_import_nosis():
24+
import objdictgen.nosis
25+
26+
def test_import_typing():
27+
import objdictgen.typing
28+
29+
def test_import_ui_commondialogs():
30+
import objdictgen.ui.commondialogs
31+
32+
def test_import_ui_exception():
33+
import objdictgen.ui.exception
34+
35+
def test_import_ui_networkedit():
36+
import objdictgen.ui.networkedit
37+
38+
def test_import_ui_networkeditortemplate():
39+
import objdictgen.ui.networkeditortemplate
40+
41+
def test_import_ui_objdictedit():
42+
import objdictgen.ui.objdictedit
43+
44+
def test_import_ui_subindextable():
45+
import objdictgen.ui.subindextable

0 commit comments

Comments
 (0)