From 7d617ce54ad194fee59218d3c7478fb4219ff275 Mon Sep 17 00:00:00 2001 From: Abhijeet Saroha <108522472+abhijeetSaroha@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:08:43 +0530 Subject: [PATCH] fix: Rename attribute shell to backend (#114) --- .makim.yaml | 28 +++++++++---------- docs/tutorials/introduction/index.ipynb | 16 +++++------ .../tutorials/makim-for-nox-users/.makim.yaml | 4 +-- .../tutorials/makim-for-nox-users/index.ipynb | 4 +-- src/makim/core.py | 2 +- tests/smoke/.makim-bash-group-scope.yaml | 2 +- tests/smoke/.makim-bash-main-scope.yaml | 2 +- tests/smoke/.makim-bash-task-scope.yaml | 2 +- tests/smoke/.makim-interpreters.yaml | 14 +++++----- tests/smoke/.makim-sugar.yaml | 2 +- tests/smoke/.makim-unittest.yaml | 4 +-- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.makim.yaml b/.makim.yaml index eba39ba..ff8ee05 100644 --- a/.makim.yaml +++ b/.makim.yaml @@ -4,7 +4,7 @@ groups: tasks: tmp: help: Clean unnecessary temporary files - shell: bash + backend: bash run: | rm -fr build/ rm -fr dist/ @@ -104,7 +104,7 @@ groups: action: store_true env: MAKIM_FILE: ./tests/smoke/.makim-simple.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -121,7 +121,7 @@ groups: help: Run the all the tests in verbose mode type: bool action: store_true - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -166,7 +166,7 @@ groups: help: Run the all the tests in verbose mode type: bool action: store_true - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' cd ./tests/smoke @@ -183,7 +183,7 @@ groups: action: store_true env: MAKIM_FILE: tests/smoke/.makim-interpreters.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' export MAKIM_FILE="$(pwd)/${MAKIM_FILE}" @@ -198,7 +198,7 @@ groups: action: store_true env: MAKIM_FILE: ./tests/smoke/.makim-unittest.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -221,7 +221,7 @@ groups: action: store_true env: MAKIM_FILE: ./tests/smoke/.makim-env.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -245,14 +245,14 @@ groups: action: store_true env: MAKIM_FILE: ./tests/smoke/.makim-vars.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE vars-group.vars-task bash: help: Test makim shell attribute with bash - shell: bash + backend: bash args: verbose-mode: help: Run the all the tests in verbose mode @@ -275,7 +275,7 @@ groups: action: store_true env: MAKIM_FILE: tests/smoke/.makim-dir-absolute-path.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -301,7 +301,7 @@ groups: action: store_true env: MAKIM_FILE: tests/smoke/.makim-dir-no-path.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' export MAKIM_FILE="$(pwd)/${MAKIM_FILE}" @@ -329,7 +329,7 @@ groups: action: store_true env: MAKIM_FILE: tests/smoke/.makim-dir-relative-path.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' export MAKIM_FILE="$(pwd)/${MAKIM_FILE}" @@ -377,9 +377,9 @@ groups: tasks: python-assert: help: Raise an system error - shell: python + backend: python run: assert False, "Failed" code-3: help: Raise an system error - shell: bash + backend: bash run: exit 3 diff --git a/docs/tutorials/introduction/index.ipynb b/docs/tutorials/introduction/index.ipynb index 8e324a1..966aeee 100644 --- a/docs/tutorials/introduction/index.ipynb +++ b/docs/tutorials/introduction/index.ipynb @@ -40,7 +40,7 @@ "metadata": {}, "source": [ "```bash\n", - "pip install -q \"makim==1.15.0\"\n", + "pip install -q \"makim==1.16.0\"\n", "```" ] }, @@ -52,7 +52,7 @@ "- For those who prefer `conda`, execute:\n", "\n", " ```bash\n", - " conda install \"makim==1.15.0\"\n", + " conda install \"makim==1.16.0\"\n", " ```\n", "\n", "Given Makim's active development, pinning to a specific version is recommended to ensure consistency.\n", @@ -364,26 +364,26 @@ " tasks:\n", " node:\n", " help: Test using nodejs\n", - " shell: node\n", + " backend: node\n", " run: console.log(\"${{ env.MSG_PREFIX }} from NodeJS!\");\n", " perl:\n", " help: Test using perl\n", - " shell: perl\n", + " backend: perl\n", " run: print \"${{ env.MSG_PREFIX }} from Perl!\\n\";\n", "\n", " python:\n", " help: Test using php\n", - " shell: python\n", + " baackend: python\n", " run: print(\"${{ env.MSG_PREFIX }} from Python!\")\n", "\n", " r:\n", " help: Test using R\n", - " shell: Rscript\n", + " backend: Rscript\n", " run: print(\"${{ env.MSG_PREFIX }} from R!\")\n", "\n", " sh:\n", " help: Test using sh\n", - " shell: sh\n", + " backend: sh\n", " run: echo \"${{ env.MSG_PREFIX }} from sh!\"\n", "\n", " run-all:\n", @@ -983,7 +983,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.12.5" } }, "nbformat": 4, diff --git a/docs/tutorials/makim-for-nox-users/.makim.yaml b/docs/tutorials/makim-for-nox-users/.makim.yaml index 8a6d222..d7ca5e2 100644 --- a/docs/tutorials/makim-for-nox-users/.makim.yaml +++ b/docs/tutorials/makim-for-nox-users/.makim.yaml @@ -5,7 +5,7 @@ groups: tasks: tests: help: Run nox tests - shell: nox + backend: nox run: | import nox @@ -16,7 +16,7 @@ groups: session.run("pytest", "--version") lint: help: Run nox tests - shell: nox + backend: nox run: | import nox diff --git a/docs/tutorials/makim-for-nox-users/index.ipynb b/docs/tutorials/makim-for-nox-users/index.ipynb index 4b33c12..bd87832 100644 --- a/docs/tutorials/makim-for-nox-users/index.ipynb +++ b/docs/tutorials/makim-for-nox-users/index.ipynb @@ -584,7 +584,7 @@ " tasks:\n", " tests:\n", " help: Run nox tests\n", - " shell: nox\n", + " backend: nox\n", " run: |\n", " import nox\n", "\n", @@ -595,7 +595,7 @@ " session.run(\"pytest\", \"--version\")\n", " lint:\n", " help: Run nox tests\n", - " shell: nox\n", + " backend: nox\n", " run: |\n", " import nox\n", "\n", diff --git a/src/makim/core.py b/src/makim/core.py index c63555f..b17ab59 100644 --- a/src/makim/core.py +++ b/src/makim/core.py @@ -275,7 +275,7 @@ def _extract_shell_app_config( self, scoped_config: dict[str, Any] ) -> AppConfigType: """Extract the shell app configuration from the scoped config data.""" - shell_app_data: AppConfigType = scoped_config.get('shell', {}) + shell_app_data: AppConfigType = scoped_config.get('backend', {}) if not shell_app_data: return {} diff --git a/tests/smoke/.makim-bash-group-scope.yaml b/tests/smoke/.makim-bash-group-scope.yaml index f3c4717..d31bdf6 100644 --- a/tests/smoke/.makim-bash-group-scope.yaml +++ b/tests/smoke/.makim-bash-group-scope.yaml @@ -2,7 +2,7 @@ version: 1.0 env-file: .env groups: group-scope: - shell: bash + backend: bash tasks: test: help: Test bash defined in the group scope diff --git a/tests/smoke/.makim-bash-main-scope.yaml b/tests/smoke/.makim-bash-main-scope.yaml index 241270b..2651f79 100644 --- a/tests/smoke/.makim-bash-main-scope.yaml +++ b/tests/smoke/.makim-bash-main-scope.yaml @@ -1,6 +1,6 @@ version: 1.0 env-file: .env -shell: bash +backend: bash groups: main-scope: tasks: diff --git a/tests/smoke/.makim-bash-task-scope.yaml b/tests/smoke/.makim-bash-task-scope.yaml index 0c9f48d..9bca514 100644 --- a/tests/smoke/.makim-bash-task-scope.yaml +++ b/tests/smoke/.makim-bash-task-scope.yaml @@ -10,7 +10,7 @@ groups: print(os.getcwd()) test: - shell: bash + backend: bash help: Test bash defined in the task scope dependencies: - task: task-scope.dep diff --git a/tests/smoke/.makim-interpreters.yaml b/tests/smoke/.makim-interpreters.yaml index e1f4344..2aa9b14 100644 --- a/tests/smoke/.makim-interpreters.yaml +++ b/tests/smoke/.makim-interpreters.yaml @@ -5,12 +5,12 @@ groups: tasks: node: help: Test using nodejs - shell: node + backend: node run: console.log("Hello, World!"); nox: help: Test using nox - shell: + backend: app: nox args: ["--noxfile"] suffix: .nox.py @@ -24,27 +24,27 @@ groups: perl: help: Test using perl - shell: perl + backend: perl run: print "Hello, World!\n"; php: help: Test using php - shell: php + backend: php run: print "Hello, World!\n"; python: help: Test using php - shell: python + backend: python run: print("Hello, World!") r: help: Test using R - shell: Rscript + backend: Rscript run: print("Hello World!") sh: help: Test using sh - shell: sh + backend: sh run: echo "Hello, World!" all: diff --git a/tests/smoke/.makim-sugar.yaml b/tests/smoke/.makim-sugar.yaml index 09e1422..bfcc853 100644 --- a/tests/smoke/.makim-sugar.yaml +++ b/tests/smoke/.makim-sugar.yaml @@ -14,7 +14,7 @@ groups: help: test running a docker service using containers-sugar dependencies: - task: containers.setup - shell: bash + backend: bash run: | sugar exec --service service1 --options -T --cmd python -c "print(1)" sugar stop --all diff --git a/tests/smoke/.makim-unittest.yaml b/tests/smoke/.makim-unittest.yaml index 5eaec47..5eb376f 100644 --- a/tests/smoke/.makim-unittest.yaml +++ b/tests/smoke/.makim-unittest.yaml @@ -111,12 +111,12 @@ groups: test-8: help: failure test in 1 line - shell: bash + backend: bash run: "false" test-9: help: failure test in the first line of 2 lines - shell: bash + backend: bash run: | false true