diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f86b774c5..dd53214fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,8 @@ on: pull_request: env: - FORCE_COLOR: 1 + FORCE_COLOR: "1" + UV_VERSION: "0.2.17" # https://docs.github.com/en/actions/using-jobs/using-concurrency concurrency: @@ -43,7 +44,7 @@ jobs: python-version: '3.11' - name: Install uv - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.13/uv-installer.sh | sh + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-installer.sh | sh - name: Install package test dependencies # Notebook tests happen in the container, here we only need to install @@ -115,7 +116,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install uv - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.13/uv-installer.sh | sh + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-installer.sh | sh - name: Install package # NOTE: uv (unlike pip) does not compile python to bytecode after install. @@ -124,10 +125,10 @@ jobs: # Ideally, these would be fixed, but vapory is largely unmaintained, # so here we simply keep the pip behaviour with the --compile flag. # See https://github.com/astral-sh/uv/issues/1928#issuecomment-1968857514 - run: uv pip install --compile --system .[dev,smiles,optimade,eln] aiida-core==${{ matrix.aiida-core-version }} + run: uv pip install --compile --system -e .[dev,smiles,optimade,eln] aiida-core==${{ matrix.aiida-core-version }} - name: Run pytest - run: pytest -v tests --cov + run: pytest -v tests --cov=aiidalab_widgets_base - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fe7a6bae..cff2a0778 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-json - id: check-yaml @@ -13,7 +13,7 @@ repos: exclude: miscellaneous/structures - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.4 + rev: v0.5.0 hooks: - id: ruff-format exclude: ^docs/.* @@ -27,7 +27,7 @@ repos: args: [--preserve-quotes] - repo: https://github.com/sirosen/check-jsonschema - rev: 0.28.1 + rev: 0.28.6 hooks: - id: check-github-workflows diff --git a/aiidalab_widgets_base/computational_resources.py b/aiidalab_widgets_base/computational_resources.py index 937607f43..7adde22dd 100644 --- a/aiidalab_widgets_base/computational_resources.py +++ b/aiidalab_widgets_base/computational_resources.py @@ -1196,8 +1196,18 @@ def on_setup_code(self, _=None): "append_text", ] + containerized_code_additional_items = [ + "image_name", + "engine_command", + ] + kwargs = {key: getattr(self, key).value for key in items_to_configure} + # Check for additional keys needed for orm.ContainerizedCode + for container_key in containerized_code_additional_items: + if container_key in self.code_setup.keys(): + kwargs[container_key] = self.code_setup[container_key] + # set computer from its widget value the UUID of the computer. computer = orm.load_computer(self.computer.value) @@ -1205,7 +1215,7 @@ def on_setup_code(self, _=None): qb = orm.QueryBuilder() qb.append(orm.Computer, filters={"uuid": computer.uuid}, tag="computer") qb.append( - orm.InstalledCode, + orm.AbstractCode, with_computer="computer", filters={"label": kwargs["label"]}, ) @@ -1223,7 +1233,10 @@ def on_setup_code(self, _=None): return False try: - code = orm.InstalledCode(computer=computer, **kwargs) + if "image_name" in kwargs.keys(): + code = orm.ContainerizedCode(computer=computer, **kwargs) + else: + code = orm.InstalledCode(computer=computer, **kwargs) except (common.exceptions.InputValidationError, KeyError) as exception: self.message = wrap_message( f"Invalid input for code creation: {exception}",