diff --git a/cmake/version.cmake b/cmake/version.cmake index d5bcd54e55..b38d7cd859 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -11,5 +11,13 @@ endif() # get project root directory get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) -file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION) +file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION_RAW) + +# try to extract major.minor.patch +# (ignore any Python .dev, .post, etc. suffixes) +string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" PROJECT_VERSION "${PROJECT_VERSION_RAW}") +if(NOT PROJECT_VERSION) + message(FATAL_ERROR "Could not extract version number from version.txt") +endif() + message(DEBUG "Version number: ${PROJECT_VERSION}") diff --git a/doc/development.rst b/doc/development.rst index 52c043a85c..fa8b222aad 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -163,6 +163,14 @@ To create a new release, please follow these steps: create and deploy the new release on Zenodo and PyPI. Verify that this was successful. +7. Bump the version number in `version.txt` back to a development + version (e.g., after release "1.1.0", set the version to "1.2.0-dev") + and commit this change to ``main``. + This ensures that documentation at https://amici.readthedocs.io/en/latest/ + will show the correct development version and won't be confused with the + latest release, and that models imported with a development version + will be marked as such. + In rare cases, it might be necessary to create a hotfix release for a critical bug in an existing release. In this case, create a new branch from the respective tag, apply the fix (usually a backport from ``main``), diff --git a/models/model_calvetti_py/CMakeLists.txt b/models/model_calvetti_py/CMakeLists.txt index d4a097eeba..d7ad2f5ada 100644 --- a/models/model_calvetti_py/CMakeLists.txt +++ b/models/model_calvetti_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_calvetti_py/model_calvetti_py.h b/models/model_calvetti_py/model_calvetti_py.h index fcb5b0451c..a683b6010e 100644 --- a/models/model_calvetti_py/model_calvetti_py.h +++ b/models/model_calvetti_py/model_calvetti_py.h @@ -549,7 +549,7 @@ class Model_model_calvetti_py : public amici::Model_DAE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -557,7 +557,7 @@ class Model_model_calvetti_py : public amici::Model_DAE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_calvetti_py/setup.py b/models/model_calvetti_py/setup.py index 72facc640a..8b6e21f11e 100644 --- a/models/model_calvetti_py/setup.py +++ b/models/model_calvetti_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_dirac_py/CMakeLists.txt b/models/model_dirac_py/CMakeLists.txt index dadf82ddf1..e5b80c5342 100644 --- a/models/model_dirac_py/CMakeLists.txt +++ b/models/model_dirac_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_dirac_py/model_dirac_py.h b/models/model_dirac_py/model_dirac_py.h index 093d78c2f9..1d4e41430d 100644 --- a/models/model_dirac_py/model_dirac_py.h +++ b/models/model_dirac_py/model_dirac_py.h @@ -536,7 +536,7 @@ class Model_model_dirac_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -544,7 +544,7 @@ class Model_model_dirac_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_dirac_py/setup.py b/models/model_dirac_py/setup.py index 7f198f2a18..8048b0f3f2 100644 --- a/models/model_dirac_py/setup.py +++ b/models/model_dirac_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_events_py/CMakeLists.txt b/models/model_events_py/CMakeLists.txt index 3c56163a8f..5b4c57907c 100644 --- a/models/model_events_py/CMakeLists.txt +++ b/models/model_events_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_events_py/model_events_py.h b/models/model_events_py/model_events_py.h index abc18ac9e5..5c2d058a6a 100644 --- a/models/model_events_py/model_events_py.h +++ b/models/model_events_py/model_events_py.h @@ -571,7 +571,7 @@ class Model_model_events_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -579,7 +579,7 @@ class Model_model_events_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_events_py/setup.py b/models/model_events_py/setup.py index ce88c2530f..0324b20c66 100644 --- a/models/model_events_py/setup.py +++ b/models/model_events_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_jakstat_adjoint_py/CMakeLists.txt b/models/model_jakstat_adjoint_py/CMakeLists.txt index 2b8bfe45bf..d3a16024cb 100644 --- a/models/model_jakstat_adjoint_py/CMakeLists.txt +++ b/models/model_jakstat_adjoint_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h index 81571c4e9a..076cd143f0 100644 --- a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h +++ b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h @@ -544,7 +544,7 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -552,7 +552,7 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_jakstat_adjoint_py/setup.py b/models/model_jakstat_adjoint_py/setup.py index cbc905b5e8..229469310e 100644 --- a/models/model_jakstat_adjoint_py/setup.py +++ b/models/model_jakstat_adjoint_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_nested_events_py/CMakeLists.txt b/models/model_nested_events_py/CMakeLists.txt index 9db2b46bc6..faf49f9b21 100644 --- a/models/model_nested_events_py/CMakeLists.txt +++ b/models/model_nested_events_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_nested_events_py/model_nested_events_py.h b/models/model_nested_events_py/model_nested_events_py.h index cb8c654a72..18a8727846 100644 --- a/models/model_nested_events_py/model_nested_events_py.h +++ b/models/model_nested_events_py/model_nested_events_py.h @@ -544,7 +544,7 @@ class Model_model_nested_events_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -552,7 +552,7 @@ class Model_model_nested_events_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_nested_events_py/setup.py b/models/model_nested_events_py/setup.py index fbf07f6b34..05815f793d 100644 --- a/models/model_nested_events_py/setup.py +++ b/models/model_nested_events_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_neuron_py/CMakeLists.txt b/models/model_neuron_py/CMakeLists.txt index 12295b4bc7..440bc4fdd4 100644 --- a/models/model_neuron_py/CMakeLists.txt +++ b/models/model_neuron_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_neuron_py/model_neuron_py.h b/models/model_neuron_py/model_neuron_py.h index 6327f49d2c..c56016dc5e 100644 --- a/models/model_neuron_py/model_neuron_py.h +++ b/models/model_neuron_py/model_neuron_py.h @@ -566,7 +566,7 @@ class Model_model_neuron_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -574,7 +574,7 @@ class Model_model_neuron_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_neuron_py/setup.py b/models/model_neuron_py/setup.py index abeea7c58d..c4318e541b 100644 --- a/models/model_neuron_py/setup.py +++ b/models/model_neuron_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_robertson_py/CMakeLists.txt b/models/model_robertson_py/CMakeLists.txt index fbab6a9f6b..6442492172 100644 --- a/models/model_robertson_py/CMakeLists.txt +++ b/models/model_robertson_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_robertson_py/model_robertson_py.h b/models/model_robertson_py/model_robertson_py.h index 26640ca340..84cbfa524b 100644 --- a/models/model_robertson_py/model_robertson_py.h +++ b/models/model_robertson_py/model_robertson_py.h @@ -528,7 +528,7 @@ class Model_model_robertson_py : public amici::Model_DAE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -536,7 +536,7 @@ class Model_model_robertson_py : public amici::Model_DAE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_robertson_py/setup.py b/models/model_robertson_py/setup.py index d3787d169b..c5150bd0d6 100644 --- a/models/model_robertson_py/setup.py +++ b/models/model_robertson_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/models/model_steadystate_py/CMakeLists.txt b/models/model_steadystate_py/CMakeLists.txt index 2e7e7e7bcd..69cb4d4bf4 100644 --- a/models/model_steadystate_py/CMakeLists.txt +++ b/models/model_steadystate_py/CMakeLists.txt @@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS}) link_libraries("$ENV{AMICI_LDFLAGS}") endif() -find_package(Amici 0.34.2 REQUIRED HINTS +find_package(Amici 1.0.0 REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build) message(STATUS "Found AMICI ${Amici_DIR}") set_target_properties(Upstream::amici PROPERTIES diff --git a/models/model_steadystate_py/model_steadystate_py.h b/models/model_steadystate_py/model_steadystate_py.h index dcbbbec161..cbe88ddd70 100644 --- a/models/model_steadystate_py/model_steadystate_py.h +++ b/models/model_steadystate_py/model_steadystate_py.h @@ -528,7 +528,7 @@ class Model_model_steadystate_py : public amici::Model_ODE { * @return AMICI version string */ std::string get_amici_version() const override { - return "0.34.2"; + return "1.0.0.dev"; } /** @@ -536,7 +536,7 @@ class Model_model_steadystate_py : public amici::Model_ODE { * @return AMICI git commit hash */ std::string get_amici_commit() const override { - return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382"; + return "a8dfd6e0963f32c1ce4647a652e93a271b14a053"; } bool has_quadratic_llh() const override { diff --git a/models/model_steadystate_py/model_steadystate_py/__init__.py b/models/model_steadystate_py/model_steadystate_py/__init__.py index 4c6dc60e5b..618120f53e 100644 --- a/models/model_steadystate_py/model_steadystate_py/__init__.py +++ b/models/model_steadystate_py/model_steadystate_py/__init__.py @@ -7,13 +7,13 @@ import amici # Ensure we are binary-compatible, see #556 -if "0.34.2" != amici.__version__: +if "1.0.0.dev" != amici.__version__: raise amici.AmiciVersionError( f"Cannot use model `model_steadystate_py` in {Path(__file__).parent}, " - "generated with amici==0.34.2, " + "generated with amici==1.0.0.dev, " f"together with amici=={amici.__version__} " "which is currently installed. To use this model, install " - "amici==0.34.2 or re-import the model with the amici " + "amici==1.0.0.dev or re-import the model with the amici " "version currently installed." ) diff --git a/models/model_steadystate_py/setup.py b/models/model_steadystate_py/setup.py index d06c2932d3..6c7756b967 100644 --- a/models/model_steadystate_py/setup.py +++ b/models/model_steadystate_py/setup.py @@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension: author_email="model-author-todo", ext_modules=[MODEL_EXT], packages=find_namespace_packages(), - install_requires=["amici==0.34.2"], + install_requires=["amici==1.0.0.dev"], python_requires=">=3.11", package_data={}, zip_safe=False, diff --git a/python/sdist/amici/exporters/sundials/de_export.py b/python/sdist/amici/exporters/sundials/de_export.py index 0004ff1d26..d7a346805f 100644 --- a/python/sdist/amici/exporters/sundials/de_export.py +++ b/python/sdist/amici/exporters/sundials/de_export.py @@ -1235,7 +1235,9 @@ def _write_c_make_file(self): template_data = { "MODELNAME": self.model_name, "SOURCES": sources, - "AMICI_VERSION": __version__, + # Use major.minor.patch for find_package compatibility. + # CMake version only has number components, no ".dev", ".post", ... + "AMICI_VERSION": ".".join(__version__.split(".")[:3]), } apply_template( MODEL_CMAKE_TEMPLATE_FILE, diff --git a/version.txt b/version.txt index 3f8003cd4c..8adac1c17b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.34.2 +1.0.0.dev