invoke-toolkit 0.0.73__tar.gz → 0.0.74__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/PKG-INFO +16 -1
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/README.md +15 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/config/config.py +1 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/create.py +13 -10
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/program/program.py +31 -13
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_create.py +16 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_cofig_class.py +6 -0
- invoke_toolkit-0.0.74/tests/test_program_with_collection.py +299 -0
- invoke_toolkit-0.0.73/tests/test_program_with_collection.py +0 -84
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/.gitignore +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/LICENSE.txt +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/pyproject.toml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/__main__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/collections.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/completion.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/config/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/config/registry.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/config/schema.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/config/status_helper.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/context/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/context/async_tools.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/context/context.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/context/types.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/executor.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/config.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/dist.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/plugin.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/shell.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/uv_tools.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/field_resolvers.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/loader/entrypoint.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/log/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/log/logger.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/output/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/output/console.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/output/utils.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/parser.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/program/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/program/main.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/py.typed +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/runners/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/runners/rich.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/scripts/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/scripts/loader.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/autocomplete.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/cache.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/fields.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/fields.pyi +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/tasks/types.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/testing.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/utils/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/utils/fzf.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/utils/inspection.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/utils/singleton.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/utils/text.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/.gitignore.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/README.md.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/copier.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/pyproject.toml.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/src/{{package_slug}}/__init__.py.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/src/{{package_slug}}/tasks.py.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/.gitignore.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/README.md.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/copier.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/pyproject.toml.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/src/{{package_slug}}/__init__.py.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/tests/test_resolver.py.jinja +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/conftest.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/cached_completion/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/completion_with_config/.gitignore +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/completion_with_config/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/config_schema/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/enum_select_size/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/fzf_selector/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/literal_set_level/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/local_field_resolver/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/local_tasks/local_tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/local_tasks/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/conftest.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_config_tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_package_template_entrypoint.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_shell_tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_uv_plugins.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/fixtures/future_fields.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/integration/pty_plugin_completion.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/integration/uv_tool_plugins.sh +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/all-four/invoke.json +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/all-four/invoke.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/all-four/invoke.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/collection.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/echo.yaml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/json/invoke.json +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/json-and-python/invoke.json +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/json-and-python/invoke.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/no-dedupe.yaml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/no-echo.yaml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/package/invoke.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/package/tasks/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/python/invoke.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/runtime.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/three-of-em/invoke.json +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/three-of-em/invoke.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/three-of-em/invoke.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/underscores/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yaml/explicit.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yaml/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yml/explicit.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yml/invoke.yml +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yml/tasks.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/has_modules.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/conftest.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/test_config.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/program/main.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/program/tasks/__init__.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/program/tasks/coll1.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/script/test_script.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/tasks/test_cache.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/tasks/test_extensions_config.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_alias_self_reference.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_annotated_help.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_async_edge_cases.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_async_support.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_collection.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_collection_configure.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_completion_with_choices.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_config_helper.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_config_registry.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_config_schema.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_console.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_context_class.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_disable_status_cli.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_enum_arguments.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_executor.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_field_typing.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_fields.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_file_completion.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_global_context.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_help_flags.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_invoke_3_compat.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_invoke_compatibility.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_list_filter_flags.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_loader.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_parsing.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_proctitle.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_pty_stdin.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_release_guard.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_task_suggestions.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/test_toplevel.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/typecheck/fields.py +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/typecheck/fields_negative.py.fixture +0 -0
- {invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/utils/test_fzf.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: invoke-toolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.74
|
|
4
4
|
Summary: Extended APIs for PyInvoke: composable task plugins, typed CLI args, Rich output, shell completion, and PEP 723 script support
|
|
5
5
|
Project-URL: Documentation, https://github.com/D3f0/invoke-toolkit#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/D3f0/invoke-toolkit/issues
|
|
@@ -262,6 +262,21 @@ do not update invoke-toolkit itself.
|
|
|
262
262
|
Shell completion suggests directly installed plugin names for `plugin.remove`
|
|
263
263
|
and named `plugin.update` operations.
|
|
264
264
|
|
|
265
|
+
To reduce shell-completion latency in environments with expensive collection
|
|
266
|
+
plugins, set `completion.disable_plugins: true` in `invoke.yaml`:
|
|
267
|
+
|
|
268
|
+
```yaml
|
|
269
|
+
completion:
|
|
270
|
+
disable_plugins: true
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
`INVOKE_COMPLETION_DISABLE_PLUGINS=1` enables the same behavior without changing
|
|
274
|
+
the configuration file. Completion then skips installed
|
|
275
|
+
`invoke_toolkit.collection` entry points while retaining project, local, and
|
|
276
|
+
built-in `-x` task suggestions. These settings affect completion only; normal
|
|
277
|
+
task execution and listing still load plugins.
|
|
278
|
+
|
|
279
|
+
|
|
265
280
|
|
|
266
281
|
These commands reject `uvx`, `uv run`, project environments, and installations
|
|
267
282
|
managed by another tool. pipx offers a similar manual workflow:
|
|
@@ -201,6 +201,21 @@ do not update invoke-toolkit itself.
|
|
|
201
201
|
Shell completion suggests directly installed plugin names for `plugin.remove`
|
|
202
202
|
and named `plugin.update` operations.
|
|
203
203
|
|
|
204
|
+
To reduce shell-completion latency in environments with expensive collection
|
|
205
|
+
plugins, set `completion.disable_plugins: true` in `invoke.yaml`:
|
|
206
|
+
|
|
207
|
+
```yaml
|
|
208
|
+
completion:
|
|
209
|
+
disable_plugins: true
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
`INVOKE_COMPLETION_DISABLE_PLUGINS=1` enables the same behavior without changing
|
|
213
|
+
the configuration file. Completion then skips installed
|
|
214
|
+
`invoke_toolkit.collection` entry points while retaining project, local, and
|
|
215
|
+
built-in `-x` task suggestions. These settings affect completion only; normal
|
|
216
|
+
task execution and listing still load plugins.
|
|
217
|
+
|
|
218
|
+
|
|
204
219
|
|
|
205
220
|
These commands reject `uvx`, `uv run`, project environments, and installations
|
|
206
221
|
managed by another tool. pipx offers a similar manual workflow:
|
|
@@ -101,6 +101,7 @@ class ToolkitConfig(Config):
|
|
|
101
101
|
ret["init_shell"] = False
|
|
102
102
|
ret["completion"] = {
|
|
103
103
|
"callback_timeout": 10.0, # Timeout in seconds for completion callbacks
|
|
104
|
+
"disable_plugins": False, # Skip entry-point plugins during completion
|
|
104
105
|
}
|
|
105
106
|
ret["fuzzy_finder"] = {
|
|
106
107
|
"show_warnings": True, # Show warning when fzf is not available
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/create.py
RENAMED
|
@@ -19,16 +19,23 @@ import invoke_toolkit
|
|
|
19
19
|
from invoke_toolkit import Context, __version__, task
|
|
20
20
|
from invoke_toolkit.loader.entrypoint import COLLECTION_ENTRY_POINT, PLUGIN_PREFIX
|
|
21
21
|
|
|
22
|
-
try:
|
|
23
|
-
from copier import run_copy
|
|
24
|
-
except ImportError:
|
|
25
|
-
run_copy = None # type: ignore[assignment]
|
|
26
|
-
|
|
27
22
|
|
|
28
23
|
# Git config key for custom template repository/path
|
|
29
24
|
GIT_CONFIG_TEMPLATE_KEY = "invoke-toolkit.package-template"
|
|
30
25
|
|
|
31
26
|
|
|
27
|
+
def _load_copier(ctx: Context):
|
|
28
|
+
"""Load Copier only when package generation needs it."""
|
|
29
|
+
try:
|
|
30
|
+
from copier import run_copy # pylint: disable=import-outside-toplevel
|
|
31
|
+
except ImportError:
|
|
32
|
+
ctx.rich_exit(
|
|
33
|
+
"copier is required to create packages. "
|
|
34
|
+
"Install it with: uv pip install invoke-toolkit[copier]"
|
|
35
|
+
)
|
|
36
|
+
return run_copy
|
|
37
|
+
|
|
38
|
+
|
|
32
39
|
def _get_git_config_value(key: str) -> str | None:
|
|
33
40
|
"""
|
|
34
41
|
Get a value from git config.
|
|
@@ -272,11 +279,7 @@ def package(
|
|
|
272
279
|
Provider packages contain only a field-resolver entry point and never expose
|
|
273
280
|
invoke-toolkit task collections.
|
|
274
281
|
"""
|
|
275
|
-
|
|
276
|
-
ctx.rich_exit(
|
|
277
|
-
"copier is required to create packages. "
|
|
278
|
-
"Install it with: uv pip install invoke-toolkit[copier]"
|
|
279
|
-
)
|
|
282
|
+
run_copy = _load_copier(ctx)
|
|
280
283
|
|
|
281
284
|
if provider and (name or ext_name or template):
|
|
282
285
|
ctx.rich_exit(
|
|
@@ -605,17 +605,29 @@ class ToolkitProgram(Program):
|
|
|
605
605
|
)
|
|
606
606
|
# Load local tasks if they exist
|
|
607
607
|
self.collection.load_local_tasks(search_path=parent)
|
|
608
|
-
# Also try to load entry points (merge with tasks.py)
|
|
609
|
-
|
|
610
|
-
if
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
608
|
+
# Also try to load entry points (merge with tasks.py), unless the
|
|
609
|
+
# user opted out of plugin discovery for latency-sensitive completion.
|
|
610
|
+
if not self._completion_plugins_disabled():
|
|
611
|
+
ep_collection = self._load_entry_points_collection(parent)
|
|
612
|
+
if ep_collection is not None:
|
|
613
|
+
debug("Merging entry point collections with tasks.py")
|
|
614
|
+
for name, collection in ep_collection.collections.items():
|
|
615
|
+
self.collection.add_collection(collection, name=name)
|
|
616
|
+
self._plugin_collection_names.add(name)
|
|
615
617
|
except CollectionNotFound as e:
|
|
616
|
-
start =
|
|
617
|
-
#
|
|
618
|
-
|
|
618
|
+
start = start or "."
|
|
619
|
+
# A missing tasks.py cannot provide the project location, so load
|
|
620
|
+
# configuration from the resolved search root before deciding
|
|
621
|
+
# whether completion should discover entry-point plugins.
|
|
622
|
+
self.config.set_project_location(start)
|
|
623
|
+
self.config.load_project()
|
|
624
|
+
# First try entry points for packages without tasks.py. Completion
|
|
625
|
+
# may explicitly skip this potentially expensive plugin discovery.
|
|
626
|
+
ep_collection = (
|
|
627
|
+
None
|
|
628
|
+
if self._completion_plugins_disabled()
|
|
629
|
+
else self._load_entry_points_collection(start)
|
|
630
|
+
)
|
|
619
631
|
if ep_collection is not None:
|
|
620
632
|
debug("Loading collections from entry points")
|
|
621
633
|
self.collection = ep_collection
|
|
@@ -643,9 +655,6 @@ class ToolkitProgram(Program):
|
|
|
643
655
|
debug("No collection found, will checking for internal")
|
|
644
656
|
else:
|
|
645
657
|
debug("No tasks.py found, but local_tasks.py exists, continuing...")
|
|
646
|
-
start = self.args["search-root"].value
|
|
647
|
-
self.config.set_project_location(start)
|
|
648
|
-
self.config.load_project()
|
|
649
658
|
self.collection = ToolkitCollection(EMPTY_COLLECTION_NAME)
|
|
650
659
|
# Try to load local tasks if they exist
|
|
651
660
|
self.collection.load_local_tasks(search_path=start)
|
|
@@ -668,6 +677,15 @@ class ToolkitProgram(Program):
|
|
|
668
677
|
"""Flat arguments"""
|
|
669
678
|
return {name: arg.value for name, arg in self.args.items()}
|
|
670
679
|
|
|
680
|
+
def _completion_plugins_disabled(self) -> bool:
|
|
681
|
+
"""Return whether this completion request excludes entry-point plugins."""
|
|
682
|
+
if not self.args.complete.value:
|
|
683
|
+
return False
|
|
684
|
+
return bool(
|
|
685
|
+
self.config.completion.disable_plugins
|
|
686
|
+
or env_enabled(os.getenv("INVOKE_COMPLETION_DISABLE_PLUGINS", "0"))
|
|
687
|
+
)
|
|
688
|
+
|
|
671
689
|
def _has_internal_col_flag_in_completion(self) -> bool:
|
|
672
690
|
"""
|
|
673
691
|
Check if -x or --internal-col flag is present in the completion context.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import re
|
|
2
|
+
import builtins
|
|
2
3
|
import subprocess
|
|
3
4
|
import typing
|
|
4
5
|
from pathlib import Path
|
|
@@ -11,6 +12,7 @@ from invoke_toolkit.context.context import ToolkitContext
|
|
|
11
12
|
from invoke_toolkit.extensions.tasks.create import (
|
|
12
13
|
GIT_CONFIG_TEMPLATE_KEY,
|
|
13
14
|
_get_git_config_value,
|
|
15
|
+
_load_copier,
|
|
14
16
|
)
|
|
15
17
|
from invoke_toolkit.testing import TestingToolkitProgram
|
|
16
18
|
|
|
@@ -18,6 +20,20 @@ if typing.TYPE_CHECKING:
|
|
|
18
20
|
from tests.conftest import ShellRunTmp, TempVenv
|
|
19
21
|
|
|
20
22
|
|
|
23
|
+
def test_load_copier_exits_when_optional_dependency_is_missing(monkeypatch, ctx):
|
|
24
|
+
real_import = builtins.__import__
|
|
25
|
+
|
|
26
|
+
def import_without_copier(name, *args, **kwargs):
|
|
27
|
+
if name == "copier":
|
|
28
|
+
raise ImportError("copier unavailable")
|
|
29
|
+
return real_import(name, *args, **kwargs)
|
|
30
|
+
|
|
31
|
+
monkeypatch.setattr(builtins, "__import__", import_without_copier)
|
|
32
|
+
|
|
33
|
+
with pytest.raises(SystemExit):
|
|
34
|
+
_load_copier(ctx)
|
|
35
|
+
|
|
36
|
+
|
|
21
37
|
def test_new_script_has_hello_world_task(
|
|
22
38
|
tmp_path: Path,
|
|
23
39
|
monkeypatch: pytest.MonkeyPatch,
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import pkgutil
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from invoke_toolkit import Context, task
|
|
10
|
+
from invoke_toolkit.collections import ToolkitCollection
|
|
11
|
+
from invoke_toolkit.extensions import tasks as extensions_tasks
|
|
12
|
+
from invoke_toolkit.testing import TestingToolkitProgram
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_extension_collection_names() -> set[str]:
|
|
16
|
+
"""Dynamically discover all extension collection names."""
|
|
17
|
+
return {module.name for module in pkgutil.iter_modules(extensions_tasks.__path__)}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _install_completion_plugin(path: Path) -> Path:
|
|
21
|
+
"""Create importable plugin metadata and return its import sentinel path."""
|
|
22
|
+
sentinel = path / "plugin-imported"
|
|
23
|
+
(path / "fixture_plugin.py").write_text(
|
|
24
|
+
"from pathlib import Path\n"
|
|
25
|
+
"from invoke_toolkit import Collection, task\n"
|
|
26
|
+
f"Path({str(sentinel)!r}).touch()\n"
|
|
27
|
+
"@task\n"
|
|
28
|
+
"def marker(ctx):\n"
|
|
29
|
+
" pass\n"
|
|
30
|
+
"collection = Collection(marker)\n",
|
|
31
|
+
encoding="utf-8",
|
|
32
|
+
)
|
|
33
|
+
metadata = path / "fixture_plugin-1.0.dist-info"
|
|
34
|
+
metadata.mkdir()
|
|
35
|
+
(metadata / "METADATA").write_text(
|
|
36
|
+
"Metadata-Version: 2.1\nName: fixture-plugin\nVersion: 1.0\n",
|
|
37
|
+
encoding="utf-8",
|
|
38
|
+
)
|
|
39
|
+
(metadata / "entry_points.txt").write_text(
|
|
40
|
+
"[invoke_toolkit.collection]\nfixture-plugin = fixture_plugin:collection\n",
|
|
41
|
+
encoding="utf-8",
|
|
42
|
+
)
|
|
43
|
+
return sentinel
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _complete_from(
|
|
47
|
+
path: Path,
|
|
48
|
+
*,
|
|
49
|
+
disable_plugins: bool,
|
|
50
|
+
completion_args: list[str] | None = None,
|
|
51
|
+
) -> subprocess.CompletedProcess:
|
|
52
|
+
env = os.environ.copy()
|
|
53
|
+
env["PYTHONPATH"] = os.pathsep.join(
|
|
54
|
+
part for part in (str(path), env.get("PYTHONPATH", "")) if part
|
|
55
|
+
)
|
|
56
|
+
if disable_plugins:
|
|
57
|
+
env["INVOKE_COMPLETION_DISABLE_PLUGINS"] = "1"
|
|
58
|
+
else:
|
|
59
|
+
env.pop("INVOKE_COMPLETION_DISABLE_PLUGINS", None)
|
|
60
|
+
return subprocess.run(
|
|
61
|
+
[
|
|
62
|
+
sys.executable,
|
|
63
|
+
"-m",
|
|
64
|
+
"invoke_toolkit",
|
|
65
|
+
"--complete",
|
|
66
|
+
"--",
|
|
67
|
+
"intk",
|
|
68
|
+
*(completion_args or []),
|
|
69
|
+
],
|
|
70
|
+
cwd=path,
|
|
71
|
+
env=env,
|
|
72
|
+
capture_output=True,
|
|
73
|
+
text=True,
|
|
74
|
+
check=False,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@task()
|
|
79
|
+
def example_task_1(ctx: Context):
|
|
80
|
+
ctx.run("echo example_task_1")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@task()
|
|
84
|
+
def example_task_2(ctx: Context):
|
|
85
|
+
ctx.run("echo example_task_2")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_program_with_collection(capsys, suppress_stderr_logging):
|
|
89
|
+
# verify that when the flag -x is passed, the extra collections are also listed
|
|
90
|
+
coll = ToolkitCollection()
|
|
91
|
+
coll.add_task(example_task_1)
|
|
92
|
+
coll.add_task(example_task_2)
|
|
93
|
+
|
|
94
|
+
p = TestingToolkitProgram(namespace=coll)
|
|
95
|
+
p.run(["", "-xl", "--list-format", "json"])
|
|
96
|
+
out, err = capsys.readouterr()
|
|
97
|
+
assert not err, f"There should be no err output: {err}"
|
|
98
|
+
task_list: dict[str, Any] = json.loads(out)
|
|
99
|
+
collections = task_list.get("collections")
|
|
100
|
+
assert collections, "collections not found in -x"
|
|
101
|
+
expected_collections = get_extension_collection_names()
|
|
102
|
+
actual_collections = set(c["name"] for c in collections)
|
|
103
|
+
assert actual_collections.issubset(expected_collections), (
|
|
104
|
+
f"Unexpected collections: {actual_collections - expected_collections}"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_completion_with_x_flag(suppress_stderr_logging):
|
|
109
|
+
"""Test that completion includes internal collections when -x is passed"""
|
|
110
|
+
result = subprocess.run(
|
|
111
|
+
[sys.executable, "-m", "invoke_toolkit", "--complete", "--", "intk", "-x"],
|
|
112
|
+
capture_output=True,
|
|
113
|
+
text=True,
|
|
114
|
+
check=False,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
output = result.stdout + result.stderr
|
|
118
|
+
|
|
119
|
+
# Check that internal collections are in the completion output
|
|
120
|
+
assert "config" in output, "config collection should be in completion with -x"
|
|
121
|
+
assert "create" in output, "create collection should be in completion with -x"
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def test_completion_loads_entry_point_plugins_by_default(tmp_path):
|
|
125
|
+
sentinel = _install_completion_plugin(tmp_path)
|
|
126
|
+
|
|
127
|
+
result = _complete_from(tmp_path, disable_plugins=False)
|
|
128
|
+
|
|
129
|
+
assert result.returncode == 0, result.stderr
|
|
130
|
+
assert "fixture-plugin.marker" in result.stdout
|
|
131
|
+
assert sentinel.exists()
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def test_completion_can_skip_entry_point_plugins(tmp_path):
|
|
135
|
+
sentinel = _install_completion_plugin(tmp_path)
|
|
136
|
+
(tmp_path / "tasks.py").write_text(
|
|
137
|
+
"from invoke_toolkit import Collection, task\n"
|
|
138
|
+
"@task\n"
|
|
139
|
+
"def project_marker(ctx):\n"
|
|
140
|
+
" pass\n"
|
|
141
|
+
"ns = Collection(project_marker)\n",
|
|
142
|
+
encoding="utf-8",
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
result = _complete_from(tmp_path, disable_plugins=True)
|
|
146
|
+
|
|
147
|
+
assert result.returncode == 0, result.stderr
|
|
148
|
+
assert "fixture-plugin.marker" not in result.stdout
|
|
149
|
+
assert "project-marker" in result.stdout
|
|
150
|
+
assert not sentinel.exists()
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_completion_can_skip_entry_point_plugins_from_project_config(tmp_path):
|
|
154
|
+
sentinel = _install_completion_plugin(tmp_path)
|
|
155
|
+
(tmp_path / "tasks.py").write_text(
|
|
156
|
+
"from invoke_toolkit import Collection, task\n"
|
|
157
|
+
"@task\n"
|
|
158
|
+
"def project_marker(ctx):\n"
|
|
159
|
+
" pass\n"
|
|
160
|
+
"ns = Collection(project_marker)\n",
|
|
161
|
+
encoding="utf-8",
|
|
162
|
+
)
|
|
163
|
+
(tmp_path / "invoke.yaml").write_text(
|
|
164
|
+
"completion:\n disable_plugins: true\n",
|
|
165
|
+
encoding="utf-8",
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
result = _complete_from(tmp_path, disable_plugins=False)
|
|
169
|
+
|
|
170
|
+
assert result.returncode == 0, result.stderr
|
|
171
|
+
assert "fixture-plugin.marker" not in result.stdout
|
|
172
|
+
assert "project-marker" in result.stdout
|
|
173
|
+
assert not sentinel.exists()
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def test_completion_can_skip_plugins_from_config_without_tasks_file(tmp_path):
|
|
177
|
+
sentinel = _install_completion_plugin(tmp_path)
|
|
178
|
+
(tmp_path / "invoke.yaml").write_text(
|
|
179
|
+
"completion:\n disable_plugins: true\n",
|
|
180
|
+
encoding="utf-8",
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
result = _complete_from(tmp_path, disable_plugins=False)
|
|
184
|
+
|
|
185
|
+
assert result.returncode == 0, result.stderr
|
|
186
|
+
assert "fixture-plugin.marker" not in result.stdout
|
|
187
|
+
assert not sentinel.exists()
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def test_completion_search_root_keeps_local_tasks_when_plugins_disabled(tmp_path):
|
|
191
|
+
project_path = tmp_path / "project"
|
|
192
|
+
project_path.mkdir()
|
|
193
|
+
(project_path / "local_tasks.py").write_text(
|
|
194
|
+
"from invoke_toolkit import task\n@task\ndef local_marker(ctx):\n pass\n",
|
|
195
|
+
encoding="utf-8",
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
result = _complete_from(
|
|
199
|
+
tmp_path,
|
|
200
|
+
disable_plugins=True,
|
|
201
|
+
completion_args=["--search-root", str(project_path), "local."],
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
assert result.returncode == 0, result.stderr
|
|
205
|
+
assert "local.local-marker" in result.stdout
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def test_plugin_completion_opt_out_does_not_affect_execution(tmp_path):
|
|
209
|
+
sentinel = _install_completion_plugin(tmp_path)
|
|
210
|
+
env = os.environ.copy()
|
|
211
|
+
env["PYTHONPATH"] = os.pathsep.join(
|
|
212
|
+
part for part in (str(tmp_path), env.get("PYTHONPATH", "")) if part
|
|
213
|
+
)
|
|
214
|
+
env["INVOKE_COMPLETION_DISABLE_PLUGINS"] = "1"
|
|
215
|
+
|
|
216
|
+
result = subprocess.run(
|
|
217
|
+
[sys.executable, "-m", "invoke_toolkit", "--list"],
|
|
218
|
+
cwd=tmp_path,
|
|
219
|
+
env=env,
|
|
220
|
+
capture_output=True,
|
|
221
|
+
text=True,
|
|
222
|
+
check=False,
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
assert result.returncode == 0, result.stderr
|
|
226
|
+
assert "fixture-plugin.marker" in result.stdout
|
|
227
|
+
assert sentinel.exists()
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def test_plugin_completion_opt_out_keeps_internal_collections(tmp_path):
|
|
231
|
+
env = os.environ.copy()
|
|
232
|
+
env["INVOKE_COMPLETION_DISABLE_PLUGINS"] = "1"
|
|
233
|
+
|
|
234
|
+
result = subprocess.run(
|
|
235
|
+
[
|
|
236
|
+
sys.executable,
|
|
237
|
+
"-m",
|
|
238
|
+
"invoke_toolkit",
|
|
239
|
+
"--complete",
|
|
240
|
+
"--",
|
|
241
|
+
"intk",
|
|
242
|
+
"-x",
|
|
243
|
+
],
|
|
244
|
+
cwd=tmp_path,
|
|
245
|
+
env=env,
|
|
246
|
+
capture_output=True,
|
|
247
|
+
text=True,
|
|
248
|
+
check=False,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
assert result.returncode == 0, result.stderr
|
|
252
|
+
assert "config" in result.stdout
|
|
253
|
+
assert "create" in result.stdout
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def test_internal_completion_does_not_import_copier():
|
|
257
|
+
"""Completing built-in task names must not load the optional Copier stack."""
|
|
258
|
+
result = subprocess.run(
|
|
259
|
+
[
|
|
260
|
+
sys.executable,
|
|
261
|
+
"-c",
|
|
262
|
+
(
|
|
263
|
+
"import sys; "
|
|
264
|
+
"from invoke_toolkit.testing import TestingToolkitProgram; "
|
|
265
|
+
"TestingToolkitProgram().run("
|
|
266
|
+
"['intk', '--complete', '--', 'intk', '-x'], exit=False); "
|
|
267
|
+
"assert 'copier' not in sys.modules, "
|
|
268
|
+
"'copier imported during completion'"
|
|
269
|
+
),
|
|
270
|
+
],
|
|
271
|
+
capture_output=True,
|
|
272
|
+
text=True,
|
|
273
|
+
check=False,
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
assert result.returncode == 0, result.stderr
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def test_completion_without_x_flag(suppress_stderr_logging):
|
|
280
|
+
"""Test that completion does not include internal collections without -x"""
|
|
281
|
+
result = subprocess.run(
|
|
282
|
+
[sys.executable, "-m", "invoke_toolkit", "--complete", "--", "intk"],
|
|
283
|
+
capture_output=True,
|
|
284
|
+
text=True,
|
|
285
|
+
check=False,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
output = result.stdout + result.stderr
|
|
289
|
+
lines = output.strip().split("\n")
|
|
290
|
+
|
|
291
|
+
# Count how many internal collection items appear
|
|
292
|
+
internal_items = sum(
|
|
293
|
+
1 for line in lines if "config." in line or "create." in line or "dist." in line
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
# There should be no internal collection items without -x
|
|
297
|
+
assert internal_items == 0, (
|
|
298
|
+
f"Found {internal_items} internal collection items without -x flag"
|
|
299
|
+
)
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import pkgutil
|
|
3
|
-
import subprocess
|
|
4
|
-
import sys
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
from invoke_toolkit import Context, task
|
|
8
|
-
from invoke_toolkit.collections import ToolkitCollection
|
|
9
|
-
from invoke_toolkit.extensions import tasks as extensions_tasks
|
|
10
|
-
from invoke_toolkit.testing import TestingToolkitProgram
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def get_extension_collection_names() -> set[str]:
|
|
14
|
-
"""Dynamically discover all extension collection names."""
|
|
15
|
-
return {module.name for module in pkgutil.iter_modules(extensions_tasks.__path__)}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@task()
|
|
19
|
-
def example_task_1(ctx: Context):
|
|
20
|
-
ctx.run("echo example_task_1")
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@task()
|
|
24
|
-
def example_task_2(ctx: Context):
|
|
25
|
-
ctx.run("echo example_task_2")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def test_program_with_collection(capsys, suppress_stderr_logging):
|
|
29
|
-
# verify that when the flag -x is passed, the extra collections are also listed
|
|
30
|
-
coll = ToolkitCollection()
|
|
31
|
-
coll.add_task(example_task_1)
|
|
32
|
-
coll.add_task(example_task_2)
|
|
33
|
-
|
|
34
|
-
p = TestingToolkitProgram(namespace=coll)
|
|
35
|
-
p.run(["", "-xl", "--list-format", "json"])
|
|
36
|
-
out, err = capsys.readouterr()
|
|
37
|
-
assert not err, f"There should be no err output: {err}"
|
|
38
|
-
task_list: dict[str, Any] = json.loads(out)
|
|
39
|
-
collections = task_list.get("collections")
|
|
40
|
-
assert collections, "collections not found in -x"
|
|
41
|
-
expected_collections = get_extension_collection_names()
|
|
42
|
-
actual_collections = set(c["name"] for c in collections)
|
|
43
|
-
assert actual_collections.issubset(expected_collections), (
|
|
44
|
-
f"Unexpected collections: {actual_collections - expected_collections}"
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def test_completion_with_x_flag(suppress_stderr_logging):
|
|
49
|
-
"""Test that completion includes internal collections when -x is passed"""
|
|
50
|
-
result = subprocess.run(
|
|
51
|
-
[sys.executable, "-m", "invoke_toolkit", "--complete", "--", "intk", "-x"],
|
|
52
|
-
capture_output=True,
|
|
53
|
-
text=True,
|
|
54
|
-
check=False,
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
output = result.stdout + result.stderr
|
|
58
|
-
|
|
59
|
-
# Check that internal collections are in the completion output
|
|
60
|
-
assert "config" in output, "config collection should be in completion with -x"
|
|
61
|
-
assert "create" in output, "create collection should be in completion with -x"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def test_completion_without_x_flag(suppress_stderr_logging):
|
|
65
|
-
"""Test that completion does not include internal collections without -x"""
|
|
66
|
-
result = subprocess.run(
|
|
67
|
-
[sys.executable, "-m", "invoke_toolkit", "--complete", "--", "intk"],
|
|
68
|
-
capture_output=True,
|
|
69
|
-
text=True,
|
|
70
|
-
check=False,
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
output = result.stdout + result.stderr
|
|
74
|
-
lines = output.strip().split("\n")
|
|
75
|
-
|
|
76
|
-
# Count how many internal collection items appear
|
|
77
|
-
internal_items = sum(
|
|
78
|
-
1 for line in lines if "config." in line or "create." in line or "dist." in line
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
# There should be no internal collection items without -x
|
|
82
|
-
assert internal_items == 0, (
|
|
83
|
-
f"Found {internal_items} internal collection items without -x flag"
|
|
84
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/__init__.py
RENAMED
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/config.py
RENAMED
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/plugin.py
RENAMED
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/src/invoke_toolkit/extensions/tasks/shell.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/package-template/pyproject.toml.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/.gitignore.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/templates/provider-template/pyproject.toml.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/completion_with_config/.gitignore
RENAMED
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/completion_with_config/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/examples/local_field_resolver/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/extensions/test_package_template_entrypoint.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/collection.py
RENAMED
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/echo.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/no-echo.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/runtime.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yaml/tasks.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/configs/yml/tasks.py
RENAMED
|
File without changes
|
{invoke_toolkit-0.0.73 → invoke_toolkit-0.0.74}/tests/original_invoke/_support/has_modules.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|