Skip to content

Commit

Permalink
Merge branch 'main' into pip-user
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Apr 4, 2024
2 parents ba80d76 + c1aeaec commit 71e1482
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ repos:
args: [--preserve-quotes]

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.3.0
hooks:
- id: black
6 changes: 0 additions & 6 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
},
"AIIDALAB_HOME_VERSION": {
"default": "23.03.1"
},
"AIIDALAB_QE_VERSION": {
"default": "23.04.6"
},
"QE_VERSION": {
"default": "7.2"
}
}
}
25 changes: 1 addition & 24 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ variable "AIIDALAB_VERSION" {
variable "AIIDALAB_HOME_VERSION" {
}

variable "AIIDALAB_QE_VERSION" {
}

variable "QE_VERSION" {
}

variable "JUPYTER_BASE_IMAGE" {
default = "jupyter/minimal-notebook:python-${PYTHON_VERSION}"
}
Expand All @@ -40,7 +34,7 @@ variable "PLATFORMS" {
}

variable "TARGETS" {
default = ["base", "base-with-services", "lab", "full-stack", "qe"]
default = ["base", "base-with-services", "lab", "full-stack"]
}

function "tags" {
Expand All @@ -54,10 +48,6 @@ group "default" {
targets = "${TARGETS}"
}

target "qe-meta" {
tags = tags("qe")
}

target "base-meta" {
tags = tags("base")
}
Expand Down Expand Up @@ -114,16 +104,3 @@ target "full-stack" {
}
platforms = "${PLATFORMS}"
}

target "qe" {
inherits = ["qe-meta"]
context = "stack/qe"
contexts = {
full-stack = "target:full-stack"
}
args = {
"AIIDALAB_QE_VERSION" = "${AIIDALAB_QE_VERSION}"
"QE_VERSION" = "${QE_VERSION}"
}
platforms = "${PLATFORMS}"
}
7 changes: 4 additions & 3 deletions stack/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ WORKDIR /opt/
ARG AIIDA_VERSION

# Pin shared requirements in the base environment.
# 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.
RUN echo "aiida-core>=${AIIDA_VERSION},<3" > /opt/requirements.txt
# 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 "aiida-core==${AIIDA_VERSION}" > /opt/requirements.txt

# Install the shared requirements.
RUN mamba install --yes \
Expand Down
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,3 @@ def aiidalab_version(_build_config):
@pytest.fixture(scope="session")
def aiidalab_home_version(_build_config):
return _build_config["AIIDALAB_HOME_VERSION"]["default"]


@pytest.fixture(scope="session")
def qe_version(_build_config):
return _build_config["QE_VERSION"]["default"]
1 change: 1 addition & 0 deletions tests/test-base-with-services.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Services related tests."""

import json
from packaging.version import parse

Expand Down
5 changes: 3 additions & 2 deletions tests/test-base.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"""This module contains tests for the base image, which are AiiDA and package management related tests."""

import pytest
import json
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
1 change: 1 addition & 0 deletions tests/test-common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for all images, which are docker/docker-compose related tests."""

import requests


Expand Down

0 comments on commit 71e1482

Please sign in to comment.