Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refractor: change attribute shell to backend #114

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ groups:
tasks:
tmp:
help: Clean unnecessary temporary files
shell: bash
backend: bash
run: |
rm -fr build/
rm -fr dist/
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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}"
Expand Down Expand Up @@ -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}"
Expand All @@ -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
16 changes: 8 additions & 8 deletions docs/tutorials/introduction/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"metadata": {},
"source": [
"```bash\n",
"pip install -q \"makim==1.15.0\"\n",
"pip install -q \"makim==1.16.0\"\n",
"```"
]
},
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -983,7 +983,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
"version": "3.12.5"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/makim-for-nox-users/.makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ groups:
tasks:
tests:
help: Run nox tests
shell: nox
backend: nox
run: |
import nox

Expand All @@ -16,7 +16,7 @@ groups:
session.run("pytest", "--version")
lint:
help: Run nox tests
shell: nox
backend: nox
run: |
import nox

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/makim-for-nox-users/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/makim/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke/.makim-bash-group-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke/.makim-bash-main-scope.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.0
env-file: .env
shell: bash
backend: bash
groups:
main-scope:
tasks:
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke/.makim-bash-task-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tests/smoke/.makim-interpreters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke/.makim-sugar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/smoke/.makim-unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading