From 42c806c98813b107fd897d8082ba779f8f429813 Mon Sep 17 00:00:00 2001 From: wout4 Date: Mon, 25 Mar 2024 01:15:03 +0100 Subject: [PATCH] requirements for minizinc 2.8.0 added requirements for ortools updated to v9.9 --- cpmpy/__init__.py | 2 +- cpmpy/solvers/minizinc.py | 10 +++++++++- docs/conf.py | 2 +- requirements.txt | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cpmpy/__init__.py b/cpmpy/__init__.py index d8c94b101..3182ce5d0 100644 --- a/cpmpy/__init__.py +++ b/cpmpy/__init__.py @@ -14,7 +14,7 @@ """ # Tias Guns, 2019-2024 -__version__ = "0.9.19" +__version__ = "0.9.20" from .expressions import * diff --git a/cpmpy/solvers/minizinc.py b/cpmpy/solvers/minizinc.py index 825deae93..617d972f5 100644 --- a/cpmpy/solvers/minizinc.py +++ b/cpmpy/solvers/minizinc.py @@ -76,7 +76,15 @@ def supported(): # try to import the package try: import minizinc - return True + from minizinc import default_driver + version_tuple = (2, 8, 0) # minimum required version + if default_driver.parsed_version >= (2, 8, 3): + return True + else: + version = str(version_tuple[0]) + for x in version_tuple[1:]: + version = version + "." + str(x) + raise NotSupportedError("Your Minizinc compiler is outdated, please upgrade to a version >= " + version) except ImportError as e: return False diff --git a/docs/conf.py b/docs/conf.py index d8e519631..512de2326 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ author = 'Tias Guns' # The full version, including alpha/beta/rc tags -release = '0.9.19' +release = '0.9.20' # variables to be accessed from html html_context = { diff --git a/requirements.txt b/requirements.txt index 08b218f15..b8e491892 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ numpy < 2.0 -ortools >= 9.6 +ortools >= 9.9