diff --git a/pyproject.toml b/pyproject.toml index 04cf930..08c367e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,8 @@ classifiers = ["Development Status :: 1 - Planning", "Intended Audience :: Science/Research", "Intended Audience :: Developers"] dependencies = [ - "mopti==0.10.10", - "bofire>=0.0.4", + "mopti>=0.10.10", + "bofire>=0.0.12", ] [project.urls] diff --git a/requirements.txt b/requirements.txt index cee693d..2b3b824 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -mopti==0.10.10 +mopti>=0.10.10 bofire>=0.0.12 \ No newline at end of file diff --git a/test/test_pyprojecttoml.py b/test/test_pyprojecttoml.py new file mode 100644 index 0000000..e92c70a --- /dev/null +++ b/test/test_pyprojecttoml.py @@ -0,0 +1,28 @@ +def find_min_bofire_version(pkg: str, filepath: str): + with open(filepath) as f: + for line in f: + if f"{pkg}==" in line: + raise Exception( + "bofire version is pinned to a specific version. please specify the minimal version with >=" + ) + if f"{pkg}>=" in line: + return line.split("=")[1].split('"')[0].strip() + + +def find_all_deps_inreqstxt(filepath: str): + with open(filepath) as f: + for line in f: + if line.strip() != "" and line.strip()[0] != "#": + if ">=" in line: + yield line.split(">=")[0].strip() + else: + raise ValueError( + f"Please specify the minimal version with >= in {filepath}" + ) + + +def test(): + for dep in find_all_deps_inreqstxt("requirements.txt"): + min_v_req = find_min_bofire_version(dep, "requirements.txt") + min_v_pyprtoml = find_min_bofire_version(dep, "pyproject.toml") + assert min_v_req == min_v_pyprtoml