Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin aiida-core version #440

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions stack/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions tests/test-base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading