Skip to content

Commit

Permalink
Added nox testing
Browse files Browse the repository at this point in the history
* Reduced min version to py 3.10
  • Loading branch information
sveinse committed Apr 7, 2024
1 parent a60bad4 commit a2e286e
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ htmlcov/
.coverage
tmp*/
dist/
.nox

*.pyc
*.bak
Expand Down
8 changes: 8 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import nox

@nox.session(
python=["3.12", "3.11", "3.10"]
)
def test(session):
session.install(".[dev]")
session.run("pytest")
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/objdictgen/gen_cfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/objdictgen/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
"""
Expand Down
45 changes: 45 additions & 0 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a2e286e

Please sign in to comment.