generated from kamangir/blue-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
128 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ function bashtest() { | |
} | ||
|
||
bashtest "$@" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1 @@ | ||
# 🌀 blue-plugin | ||
|
||
🌀 `blue-plugin` is a git template for an 🚀 [`awesome-bash-cli`](https://github.com/kamangir/awesome-bash-cli) (`abcli`) plugin, to build [things like these](https://github.com/kamangir?tab=repositories), that out-of-the-box support, | ||
|
||
- a git repo with actions. | ||
- [pytest](https://docs.pytest.org/). | ||
- [pylint](https://pypi.org/project/pylint/). | ||
- a python package. | ||
- [pypi](https://pypi.org/). | ||
- a bash interface. | ||
- bash testing. | ||
|
||
## installation | ||
|
||
```bash | ||
pip install blue-plugin | ||
``` | ||
|
||
## creating a blue-plugin | ||
|
||
1️⃣ create a new repository from [this template](https://github.com/kamangir/blue-plugin), | ||
|
||
2️⃣ complete `<repo-name>` and `<plugin-name>` and run, | ||
|
||
```bash | ||
@git clone <repo-name> cd | ||
|
||
@plugins transform <repo-name> | ||
|
||
@init | ||
<plugin-name> help | ||
``` | ||
|
||
--- | ||
|
||
[![PyPI version](https://img.shields.io/pypi/v/blue-plugin.svg)](https://pypi.org/project/blue-plugin/) | ||
|
||
To use on [AWS SageMaker](https://aws.amazon.com/sagemaker/) replace `<plugin-name>` with the name of the plugin and follow [these instructions](https://github.com/kamangir/notebooks-and-scripts/blob/main/SageMaker.md). | ||
# blue_geo |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /usr/bin/env bash | ||
|
||
function blue_geo_action_git_before_push() { | ||
[[ "$(abcli_git get_branch)" == "main" ]] && | ||
blue_geo pypi build | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#! /usr/bin/env bash | ||
|
||
function bp() { | ||
blue_plugin "$@" | ||
blue_geo "$@" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /usr/bin/env bash | ||
|
||
function abcli_install_blue_geo() { | ||
: | ||
} | ||
|
||
abcli_install_module blue_geo 1.1.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
#! /usr/bin/env bash | ||
|
||
function blue_plugin_leaf() { | ||
function blue_geo_leaf() { | ||
local options=$1 | ||
|
||
if [ $(abcli_option_int "$options" help 0) == 1 ]; then | ||
local options="dryrun,upload" | ||
local args="[--<keyword> <value>]$ABCUL[--<keyword> <value>]" | ||
abcli_show_usage "blue_plugin leaf$ABCUL[$options]$ABCUL<object-name>$ABCUL$args" \ | ||
"blue-plugin leaf <object-name>." | ||
abcli_show_usage "blue_geo leaf$ABCUL[$options]$ABCUL<object-name>$ABCUL$args" \ | ||
"blue-geo leaf <object-name>." | ||
return | ||
fi | ||
|
||
echo "blue-plugin: leaf: 🪄" | ||
echo "blue-geo: leaf: 🪄" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
#! /usr/bin/env bash | ||
|
||
function blue_plugin_node() { | ||
function blue_geo_node() { | ||
local task=$(abcli_unpack_keyword $1 help) | ||
|
||
if [ "$task" == "help" ]; then | ||
blue_plugin_node_leaf "$@" | ||
blue_geo_node_leaf "$@" | ||
return | ||
fi | ||
|
||
local function_name=blue_plugin_node_$task | ||
local function_name=blue_geo_node_$task | ||
if [[ $(type -t $function_name) == "function" ]]; then | ||
$function_name "${@:2}" | ||
return | ||
fi | ||
|
||
abcli_log_error "-blue_plugin: node: $task: command not found." | ||
abcli_log_error "-blue_geo: node: $task: command not found." | ||
return 1 | ||
} | ||
|
||
abcli_source_path - caller,suffix=/node | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env bash | ||
|
||
function test_blue_geo_thing() { | ||
local options=$1 | ||
|
||
local test_options=$2 | ||
|
||
abcli_eval ,$options \ | ||
"echo 📜 blue-geo: test: thing: $test_options: ${@:3}." | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
blue_plugin/.abcli/tests/version.sh → blue_geo/.abcli/tests/version.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#! /usr/bin/env bash | ||
|
||
function test_blue_plugin_version() { | ||
function test_blue_geo_version() { | ||
local options=$1 | ||
|
||
abcli_eval ,$options \ | ||
"blue_plugin version ${@:2}" | ||
"blue_geo version ${@:2}" | ||
|
||
return 0 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
NAME = "blue_geo" | ||
|
||
ICON = "🌐" | ||
|
||
DESCRIPTION = f"{ICON} AI for precise geospatial data analysis and visualization." | ||
|
||
VERSION = "4.2.1" | ||
|
||
REPO_NAME = "blue-geo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from blue_plugin import NAME, VERSION, DESCRIPTION, ICON | ||
from blue_plugin.logger import logger | ||
from blue_geo import NAME, VERSION, DESCRIPTION, ICON | ||
from blue_geo.logger import logger | ||
from blueness.argparse.generic import main | ||
|
||
success, message = main(__file__, NAME, VERSION, DESCRIPTION, ICON) | ||
if not success: | ||
logger.error(message) | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
"BLUE_PLUGIN_CONFIG", | ||
"", | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from abcli.logger import get_logger | ||
from blue_plugin import ICON | ||
from blue_geo import ICON | ||
|
||
logger = get_logger(ICON) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from blue_geo import NAME | ||
|
||
NAME = f"{NAME}.node" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from blue_plugin.logger import logger | ||
from blue_geo.logger import logger | ||
|
||
|
||
def func(arg: str) -> bool: | ||
logger.info(f"arg:{arg}") | ||
return True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from abcli.tests import test_env | ||
from blue_plugin import env | ||
from blue_geo import env | ||
|
||
|
||
def test_abcli_env(): | ||
test_env.test_abcli_env() | ||
|
||
|
||
def test_blue_plugin_env(): | ||
def test_blue_geo_env(): | ||
assert env.BLUE_PLUGIN_SECRET | ||
assert env.BLUE_PLUGIN_CONFIG | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ def test_thing( | |
object_name = unique_object() | ||
|
||
assert object_name | ||
|
||
|
4 changes: 3 additions & 1 deletion
4
blue_plugin/tests/test_version.py → blue_geo/tests/test_version.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from blue_plugin import VERSION | ||
from blue_geo import VERSION | ||
|
||
|
||
def test_version(): | ||
assert VERSION | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
urlpatterns = [] | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.