-
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
11 changed files
with
135 additions
and
71 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
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,14 +1,6 @@ | ||
#! /usr/bin/env bash | ||
|
||
function abcli_pypi_install() { | ||
local options=$1 | ||
|
||
if [ $(abcli_option_int "$options" help 0) == 1 ]; then | ||
abcli_show_usage "@pypi install" \ | ||
"install pypi." | ||
return | ||
fi | ||
|
||
pip3 install --upgrade setuptools wheel twine | ||
python3 -m pip install --upgrade 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
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
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,85 @@ | ||
from typing import List, Dict, Callable, Union | ||
|
||
from blue_options.terminal import show_usage, xtra | ||
|
||
build_options = "browse,install,~rm_dist,~upload" | ||
|
||
|
||
def help_browse( | ||
tokens: List[str], | ||
mono: bool, | ||
plugin_name: str = "abcli", | ||
) -> str: | ||
options = "token" | ||
|
||
callable = f"{plugin_name} pypi" | ||
|
||
if plugin_name == "abcli": | ||
options = f"plugin=<plugin-name>,{options}" | ||
callable = "@pypi" | ||
|
||
return show_usage( | ||
callable.split(" ") | ||
+ [ | ||
"browse", | ||
f"[{options}]", | ||
], | ||
f"browse pypi/{plugin_name}.", | ||
mono=mono, | ||
) | ||
|
||
|
||
def help_build( | ||
tokens: List[str], | ||
mono: bool, | ||
plugin_name: str = "abcli", | ||
) -> str: | ||
options = xtra(build_options, mono=mono) | ||
|
||
callable = f"{plugin_name} pypi" | ||
|
||
if plugin_name == "abcli": | ||
options = f"{options},plugin=<plugin-name>" | ||
callable = "@pypi" | ||
|
||
return show_usage( | ||
callable.split(" ") | ||
+ [ | ||
"build", | ||
f"[{options}]", | ||
], | ||
f"build pypi/{plugin_name}.", | ||
mono=mono, | ||
) | ||
|
||
|
||
def help_install( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
return show_usage( | ||
[ | ||
"@pypi", | ||
"install", | ||
], | ||
"install pypi.", | ||
mono=mono, | ||
) | ||
|
||
|
||
def help_functions( | ||
plugin_name: str = "abcli", | ||
) -> Union[Callable, Dict[str, Union[Callable, Dict]]]: | ||
return { | ||
"browse": lambda tokens, mono: help_browse( | ||
tokens, | ||
mono=mono, | ||
plugin_name=plugin_name, | ||
), | ||
"build": lambda tokens, mono: help_build( | ||
tokens, | ||
mono=mono, | ||
plugin_name=plugin_name, | ||
), | ||
"install": help_install, | ||
} |