From 483e37c382dbc7d5e67ce603b137efd48eacf617 Mon Sep 17 00:00:00 2001 From: Abhijeet Saroha Date: Mon, 23 Sep 2024 21:54:55 +0530 Subject: [PATCH] change shell to backend --- .github/workflows/docs.yaml | 2 +- .github/workflows/main.yaml | 4 +-- .github/workflows/release.yaml | 2 +- .makim.yaml | 28 +++++++++---------- .../tutorials/makim-for-nox-users/.makim.yaml | 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 +-- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e16d1d4..edf60cc 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -17,7 +17,7 @@ jobs: defaults: run: - shell: bash -l {0} + backend: bash -l {0} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index dd99752..a80da16 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -46,7 +46,7 @@ jobs: defaults: run: - shell: bash -l {0} + backend: bash -l {0} concurrency: group: ci-tests-${{ matrix.os }}-${{ matrix.python_version }}-${{ github.ref }} @@ -129,7 +129,7 @@ jobs: defaults: run: - shell: bash -l {0} + backend: bash -l {0} concurrency: group: ci-linter-docs-${{ matrix.os }}-${{ matrix.python_version }}-${{ github.ref }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3ca25b9..533bf84 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: defaults: run: - shell: bash -l {0} + backend: bash -l {0} steps: - uses: actions/checkout@v4 diff --git a/.makim.yaml b/.makim.yaml index 93de3c5..3c073e3 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/ @@ -103,7 +103,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 @@ -120,7 +120,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 @@ -165,7 +165,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 @@ -182,7 +182,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}" @@ -197,7 +197,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 @@ -220,7 +220,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 @@ -244,14 +244,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 @@ -274,7 +274,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 @@ -300,7 +300,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}" @@ -328,7 +328,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}" @@ -351,9 +351,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/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/src/makim/core.py b/src/makim/core.py index 97aa8da..9d59ad3 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