Skip to content

Commit 190ac09

Browse files
authored
Mark developement version as such (#3087)
Append `.dev` suffix to development versions. To show the right version on RTD/latest and to mark models imported with a development version as such.
1 parent a8dfd6e commit 190ac09

File tree

29 files changed

+56
-38
lines changed

29 files changed

+56
-38
lines changed

cmake/version.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@ endif()
1111
# get project root directory
1212
get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}
1313
DIRECTORY)
14-
file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION)
14+
file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION_RAW)
15+
16+
# try to extract major.minor.patch
17+
# (ignore any Python .dev, .post, etc. suffixes)
18+
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" PROJECT_VERSION "${PROJECT_VERSION_RAW}")
19+
if(NOT PROJECT_VERSION)
20+
message(FATAL_ERROR "Could not extract version number from version.txt")
21+
endif()
22+
1523
message(DEBUG "Version number: ${PROJECT_VERSION}")

doc/development.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ To create a new release, please follow these steps:
163163
create and deploy the new release on Zenodo and PyPI.
164164
Verify that this was successful.
165165

166+
7. Bump the version number in `version.txt` back to a development
167+
version (e.g., after release "1.1.0", set the version to "1.2.0-dev")
168+
and commit this change to ``main``.
169+
This ensures that documentation at https://amici.readthedocs.io/en/latest/
170+
will show the correct development version and won't be confused with the
171+
latest release, and that models imported with a development version
172+
will be marked as such.
173+
166174
In rare cases, it might be necessary to create a hotfix release for a
167175
critical bug in an existing release. In this case, create a new branch
168176
from the respective tag, apply the fix (usually a backport from ``main``),

models/model_calvetti_py/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
3636
link_libraries("$ENV{AMICI_LDFLAGS}")
3737
endif()
3838

39-
find_package(Amici 0.34.2 REQUIRED HINTS
39+
find_package(Amici 1.0.0 REQUIRED HINTS
4040
${CMAKE_CURRENT_LIST_DIR}/../../build)
4141
message(STATUS "Found AMICI ${Amici_DIR}")
4242
set_target_properties(Upstream::amici PROPERTIES

models/model_calvetti_py/model_calvetti_py.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,15 +549,15 @@ class Model_model_calvetti_py : public amici::Model_DAE {
549549
* @return AMICI version string
550550
*/
551551
std::string get_amici_version() const override {
552-
return "0.34.2";
552+
return "1.0.0.dev";
553553
}
554554

555555
/**
556556
* @brief returns the amici version that was used to generate the model
557557
* @return AMICI git commit hash
558558
*/
559559
std::string get_amici_commit() const override {
560-
return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
560+
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
561561
}
562562

563563
bool has_quadratic_llh() const override {

models/model_calvetti_py/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
8989
author_email="model-author-todo",
9090
ext_modules=[MODEL_EXT],
9191
packages=find_namespace_packages(),
92-
install_requires=["amici==0.34.2"],
92+
install_requires=["amici==1.0.0.dev"],
9393
python_requires=">=3.11",
9494
package_data={},
9595
zip_safe=False,

models/model_dirac_py/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
3636
link_libraries("$ENV{AMICI_LDFLAGS}")
3737
endif()
3838

39-
find_package(Amici 0.34.2 REQUIRED HINTS
39+
find_package(Amici 1.0.0 REQUIRED HINTS
4040
${CMAKE_CURRENT_LIST_DIR}/../../build)
4141
message(STATUS "Found AMICI ${Amici_DIR}")
4242
set_target_properties(Upstream::amici PROPERTIES

models/model_dirac_py/model_dirac_py.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,15 @@ class Model_model_dirac_py : public amici::Model_ODE {
536536
* @return AMICI version string
537537
*/
538538
std::string get_amici_version() const override {
539-
return "0.34.2";
539+
return "1.0.0.dev";
540540
}
541541

542542
/**
543543
* @brief returns the amici version that was used to generate the model
544544
* @return AMICI git commit hash
545545
*/
546546
std::string get_amici_commit() const override {
547-
return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
547+
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
548548
}
549549

550550
bool has_quadratic_llh() const override {

models/model_dirac_py/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_extension() -> CMakeExtension:
8989
author_email="model-author-todo",
9090
ext_modules=[MODEL_EXT],
9191
packages=find_namespace_packages(),
92-
install_requires=["amici==0.34.2"],
92+
install_requires=["amici==1.0.0.dev"],
9393
python_requires=">=3.11",
9494
package_data={},
9595
zip_safe=False,

models/model_events_py/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if(DEFINED ENV{AMICI_LDFLAGS})
3636
link_libraries("$ENV{AMICI_LDFLAGS}")
3737
endif()
3838

39-
find_package(Amici 0.34.2 REQUIRED HINTS
39+
find_package(Amici 1.0.0 REQUIRED HINTS
4040
${CMAKE_CURRENT_LIST_DIR}/../../build)
4141
message(STATUS "Found AMICI ${Amici_DIR}")
4242
set_target_properties(Upstream::amici PROPERTIES

models/model_events_py/model_events_py.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,15 +571,15 @@ class Model_model_events_py : public amici::Model_ODE {
571571
* @return AMICI version string
572572
*/
573573
std::string get_amici_version() const override {
574-
return "0.34.2";
574+
return "1.0.0.dev";
575575
}
576576

577577
/**
578578
* @brief returns the amici version that was used to generate the model
579579
* @return AMICI git commit hash
580580
*/
581581
std::string get_amici_commit() const override {
582-
return "c4a395b6462dc1f26ad1472e6b2fa71fe0d54382";
582+
return "a8dfd6e0963f32c1ce4647a652e93a271b14a053";
583583
}
584584

585585
bool has_quadratic_llh() const override {

0 commit comments

Comments
 (0)