diff --git a/stack/base/Dockerfile b/stack/base/Dockerfile index e26421c2..d0ee2b27 100644 --- a/stack/base/Dockerfile +++ b/stack/base/Dockerfile @@ -16,11 +16,12 @@ WORKDIR /opt/ ARG AIIDA_VERSION -# Pin shared requirements in the base environemnt. -# The lower bound of aiida-core is set to the version of aiida-core to prevent -# lower aiida-core DB version installed and trigger database downgrade. +# Pin shared requirements in the base environment. +# We pin aiida-core to the exact installed version, +# to prevent accidental upgrade or downgrade, that might +# induce DB migration or break shared dependencies of AiiDAlab Apps. RUN echo "pip==23.3.1" > /opt/requirements.txt && \ - echo "aiida-core>=${AIIDA_VERSION},<3" >> /opt/requirements.txt + echo "aiida-core==${AIIDA_VERSION}" >> /opt/requirements.txt # Install the shared requirements. RUN mamba install --yes \ diff --git a/tests/test-base.py b/tests/test-base.py index 0c4a8506..3a7a4b56 100644 --- a/tests/test-base.py +++ b/tests/test-base.py @@ -5,13 +5,13 @@ from packaging.version import parse -@pytest.mark.parametrize("incompatible_version", ["1.6.3"]) +@pytest.mark.parametrize("incompatible_version", ["2.3.0"]) def test_prevent_pip_install_of_incompatible_aiida_version( aiidalab_exec, nb_user, aiida_version, incompatible_version ): package_manager = "pip" assert parse(aiida_version) != parse(incompatible_version) - # Expected to succeed: + # Expected to succeed, although should be a no-op. aiidalab_exec( f"{package_manager} install aiida-core=={aiida_version}", user=nb_user )