news seg and lint

This commit is contained in:
jerempy
2022-10-10 10:56:12 -04:00
parent ad589bdbe1
commit e36c62a7d7
3 changed files with 8 additions and 5 deletions
+4 -4
View File
@@ -581,8 +581,8 @@ For example:
$ pipenv run echospam "indeed"
I am really a very silly example indeed
You can also specify pacakge functions as callables such as: ``<pathed.module>:<func>``. These can also take arguments.
For exaple:
You can also specify pacakge functions as callables such as: ``<pathed.module>:<func>``. These can also take arguments.
For exaple:
.. code-block:: toml
@@ -592,8 +592,8 @@ For exaple:
::
$ pipenv run my_func_with_args
$ pipenv run my_func_no_args
$ pipenv run my_func_no_args
You can display the names and commands of your shortcuts by running ``pipenv scripts`` in your terminal.
::
+1
View File
@@ -0,0 +1 @@
Update pipenv docs for with example for callabale package functions in Pipfile scripts
+3 -1
View File
@@ -32,7 +32,9 @@ def _parse_toml_inline_table(value: tomlkit.items.InlineTable) -> str:
if cmd_key == "call":
module, _, func = str(value["call"]).partition(":")
if not module or not func:
raise ScriptParseError("Callable must be like: name = {call = \"package.module:func('arg')\"}")
raise ScriptParseError(
"Callable must be like: name = {call = \"package.module:func('arg')\"}"
)
if re.search(r"\(.*?\)", func) is None:
func += "()"
return f'python -c "import {module} as _m; _m.{func}"'