From 921a9f5c1220dd5ec716478bc256d892bf0bffd4 Mon Sep 17 00:00:00 2001 From: Markus Binsteiner Date: Fri, 10 Nov 2023 12:04:07 +0100 Subject: [PATCH] build: fix old multiformats-config pkg dependency --- .github/workflows/build-linux.yaml | 2 +- .../typing-validation/conda-pkg-patch.yaml | 1 - pyproject.toml | 2 ++ src/kiara/interfaces/cli/context/commands.py | 6 ++--- tests/test_cli/test_context_subcommands.py | 27 +++++++++++++++++++ 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 tests/test_cli/test_context_subcommands.py diff --git a/.github/workflows/build-linux.yaml b/.github/workflows/build-linux.yaml index c98eff3de..cc722ef9e 100644 --- a/.github/workflows/build-linux.yaml +++ b/.github/workflows/build-linux.yaml @@ -191,7 +191,7 @@ jobs: permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - name: Retrieve release distributions + - name: Retrieve build distributions uses: actions/download-artifact@v3 with: name: build-dists diff --git a/ci/conda/typing-validation/conda-pkg-patch.yaml b/ci/conda/typing-validation/conda-pkg-patch.yaml index d20369b9f..e69de29bb 100644 --- a/ci/conda/typing-validation/conda-pkg-patch.yaml +++ b/ci/conda/typing-validation/conda-pkg-patch.yaml @@ -1 +0,0 @@ -pkg_url: "xx" diff --git a/pyproject.toml b/pyproject.toml index 4727c2240..cccfffd85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -227,6 +227,7 @@ dev_testing = [ "flake8>=3.8.4", "jsonschema>=4.0.0", "mypy>=0.800", + "pandas-stubs", "pytest>=6.2.2", "pytest-cov>=2.11.1", "pytest-html>=3.1.0", @@ -255,6 +256,7 @@ dev_utils = [ "flake8>=3.8.4", "ipython", "mypy>=0.800", + "pandas-stubs", "pip-licenses>=3.3.0", "pre-commit>=2.9.3", "pytest>=6.2.2", diff --git a/src/kiara/interfaces/cli/context/commands.py b/src/kiara/interfaces/cli/context/commands.py index 975261c23..aa54d3497 100644 --- a/src/kiara/interfaces/cli/context/commands.py +++ b/src/kiara/interfaces/cli/context/commands.py @@ -93,18 +93,18 @@ def delete_context( ctx, context_name: Union[str, None] = None, force: bool = False, - all_contexts: bool = False, + all: bool = False, ): """Delete a context and all its stored values.""" kiara_config: KiaraConfig = ctx.obj.kiara_config if not context_name: - if all_contexts: + if all: _context_name = "ALL_CONTEXTS" else: _context_name = ctx.obj.kiara_context_name else: - if all_contexts: + if all: if context_name != "ALL_CONTEXTS": terminal_print() terminal_print( diff --git a/tests/test_cli/test_context_subcommands.py b/tests/test_cli/test_context_subcommands.py new file mode 100644 index 000000000..0fc1877fe --- /dev/null +++ b/tests/test_cli/test_context_subcommands.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, University of Luxembourg / DHARPA project +# Copyright (c) 2021, Markus Binsteiner +# +# Mozilla Public License, version 2.0 (see LICENSE or https://www.mozilla.org/en-US/MPL/2.0/) +from click.testing import CliRunner + +from kiara.interfaces.cli import cli + + +def test_context_subcommand(): + + runner = CliRunner() + result = runner.invoke(cli, "context") + assert result.exit_code == 0 + assert "context related sub-commands" in result.stdout + + +# def test_delete_context_subcommand(): +# +# runner = CliRunner() +# result = runner.invoke(cli, "module list") +# +# assert result.exit_code == 0 +# assert "logic.or" in result.stdout +# assert "logic.xor" not in result.stdout