diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 5accb48..f8f3706 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -23,16 +23,21 @@ jobs: - name: "checkout repository" uses: actions/checkout@v3 - - name: "setup python 3.7" + - name: "setup python 3.9" uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: "setup python 3.11" uses: actions/setup-python@v4 with: python-version: 3.11 - + + - name: "setup python 3.12" + uses: actions/setup-python@v4 + with: + python-version: 3.12 + - name: install nox run: python -m pip install nox diff --git a/noxfile.py b/noxfile.py index e7dc802..c085be7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -7,7 +7,7 @@ EDITABLE_TESTS = True PYTHON_VERSIONS = None if "GITHUB_ACTIONS" in os.environ: - PYTHON_VERSIONS = ["3.11"] + PYTHON_VERSIONS = ["3.12", "3.11", "3.9"] EDITABLE_TESTS = False diff --git a/pyproject.toml b/pyproject.toml index c72ca97..81e74e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,12 +11,12 @@ authors = [ { name = "Hannes Weichelt", email = "hweichelt@uni-potsdam.de" } ] description = "A template project." -requires-python = ">=3.11" +requires-python = ">=3.9" license = {file = "LICENSE"} dynamic = [ "version" ] readme = "README.md" dependencies = [ - "clingo>=5.6.0", + "clingo>=5.7.1", "autoflake", ] @@ -79,7 +79,7 @@ source = ["clingexplaid", "tests"] omit = [ "*/clingexplaid/__main__.py", "*/clingexplaid/cli/*", - "*/clingexplaid/propagators/__init__.py", + "*/clingexplaid/propagators/*", "*/clingexplaid/transformers/__init__.py", "*/clingexplaid/muc/__init__.py", "*/clingexplaid/unsat_constraints/__init__.py", diff --git a/src/clingexplaid/utils/__init__.py b/src/clingexplaid/utils/__init__.py index c153b21..7c661b5 100644 --- a/src/clingexplaid/utils/__init__.py +++ b/src/clingexplaid/utils/__init__.py @@ -82,7 +82,7 @@ def get_constants_from_arguments(argument_vector: List[str]) -> Dict[str, str]: for element in argument_vector: if next_constant: result = re.search(r"(.*)=(.*)", element) - if result is None or len(result.groups()) == 0: + if result is None: continue constants[result.group(1)] = result.group(2) next_constant = False diff --git a/tests/clingexplaid/test_propagators.py b/tests/clingexplaid/test_propagators.py deleted file mode 100644 index a08a4c3..0000000 --- a/tests/clingexplaid/test_propagators.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -Tests for the propagators package -""" - -from unittest import TestCase - -import clingo -from clingexplaid.propagators import DecisionOrderPropagator - -from .test_main import TEST_DIR - - -class TestPropagators(TestCase): - """ - Test cases for propagators. - """ - - # DECISION ORDER PROPAGATOR - - def test_decision_order_propagator(self) -> None: - """ - Testing the functionality of the DecisionOrderPropagator without signatures - """ - program_path = TEST_DIR.joinpath("res/test_program_decision_order.lp") - control = clingo.Control() - dop = DecisionOrderPropagator() - control.register_propagator(dop) # type: ignore - control.load(str(program_path)) - control.ground() - control.solve(assumptions=[]) - - # No asserts since the propagator currently doesn't support any outputs but only prints. - - def test_decision_order_propagator_with_signatures(self) -> None: - """ - Testing the functionality of the DecisionOrderPropagator with signatures - """ - program_path = TEST_DIR.joinpath("res/test_program_decision_order.lp") - control = clingo.Control() - dop = DecisionOrderPropagator(signatures={("a", 0), ("b", 0), ("x", 1)}) - control.register_propagator(dop) # type: ignore - control.load(str(program_path)) - control.ground() - control.solve(assumptions=[]) - - # No asserts since the propagator currently doesn't support any outputs but only prints.