vantage-cli 0.1.5__tar.gz → 0.1.7__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.
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/PKG-INFO +7 -4
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/README.md +6 -3
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/pyproject.toml +1 -1
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/uv.lock +1 -1
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/__init__.py +22 -2
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/__init__.py +2 -0
- vantage_cli-0.1.7/vantage_cli/commands/alias/profiles.py +17 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/profile/crud.py +34 -11
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/main.py +3 -0
- vantage_cli-0.1.5/debug_annotations.py +0 -38
- vantage_cli-0.1.5/debug_decorators.py +0 -46
- vantage_cli-0.1.5/debug_typer.py +0 -41
- vantage_cli-0.1.5/debug_wraps.py +0 -57
- vantage_cli-0.1.5/fix_cluster_tests.py +0 -57
- vantage_cli-0.1.5/fix_config_tests.py +0 -51
- vantage_cli-0.1.5/fix_federation_tests.py +0 -47
- vantage_cli-0.1.5/fix_profile_crud.py +0 -86
- vantage_cli-0.1.5/fix_profile_crud_extra.py +0 -110
- vantage_cli-0.1.5/fix_profile_tests.py +0 -48
- vantage_cli-0.1.5/fix_tests.py +0 -68
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/.commitlintrc.yml +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/.github/workflows/ci.yml +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/.github/workflows/pages.yml +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/.github/workflows/publish.yml +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/.gitignore +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/scripts/README.md +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/scripts/generate_complete_docs.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/scripts/update_docs_version.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/scripts/update_docs_version.sh +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/common.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_juju_localhost/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_juju_localhost/app.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_juju_localhost/bundle_yaml.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_microk8s_localhost/README.md +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_microk8s_localhost/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_microk8s_localhost/app.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_multipass_localhost/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/slurm_multipass_localhost/app.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/apps/templates.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/auth.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/cache.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/client.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/command_base.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/command_decorators.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/command_utils.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/apps.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/clouds.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/clusters.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/federations.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/networks.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/notebooks.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/alias/teams.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/app/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/app/deploy.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/app/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/add.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/render.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cloud/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/federation/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/render.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/schema.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/cluster/utils.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/config/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/config/clear.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/example.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/federation/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/script/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/submission/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/job/template/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/configuration/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/deployment/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/product/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/license/server/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/attach.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/detach.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/network/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/notebook/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/profile/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/profile/render.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/attach.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/detach.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/storage/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/support_ticket/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/__init__.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/add_member.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/create.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/delete.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/get.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/list.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/list_members.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/remove_member.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/set_role.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/commands/team/update.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/config.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/constants.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/decorators.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/exceptions.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/format.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/gql_client.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/render.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/schemas.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/simple_commands.py +0 -0
- {vantage_cli-0.1.5 → vantage_cli-0.1.7}/vantage_cli/time_loop.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vantage-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: The Vantage Compute CLI.
|
|
5
5
|
Author-email: jamesbeedy <james@vantagecompute.ai>
|
|
6
6
|
License: MIT
|
|
@@ -39,6 +39,8 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
|
|
40
40
|
# Vantage CLI
|
|
41
41
|
|
|
42
|
+
A modern Python CLI tool to interface to Vantage Compute.
|
|
43
|
+
|
|
42
44
|
[](LICENSE)
|
|
43
45
|
[](https://python.org)
|
|
44
46
|
[](https://pypi.org/project/vantage-cli/)
|
|
@@ -48,12 +50,13 @@ Description-Content-Type: text/markdown
|
|
|
48
50
|

|
|
49
51
|

|
|
50
52
|
|
|
51
|
-
</
|
|
52
|
-
|
|
53
|
-
A modern Python CLI tool to interface to Vantage Compute.
|
|
53
|
+
</br>
|
|
54
54
|
|
|
55
55
|
## 🚀 Quick Start
|
|
56
56
|
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
|
|
57
60
|
### Option 1: Install from PyPI (Recommended)
|
|
58
61
|
|
|
59
62
|
```bash
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
# Vantage CLI
|
|
9
9
|
|
|
10
|
+
A modern Python CLI tool to interface to Vantage Compute.
|
|
11
|
+
|
|
10
12
|
[](LICENSE)
|
|
11
13
|
[](https://python.org)
|
|
12
14
|
[](https://pypi.org/project/vantage-cli/)
|
|
@@ -16,12 +18,13 @@
|
|
|
16
18
|

|
|
17
19
|

|
|
18
20
|
|
|
19
|
-
</
|
|
20
|
-
|
|
21
|
-
A modern Python CLI tool to interface to Vantage Compute.
|
|
21
|
+
</br>
|
|
22
22
|
|
|
23
23
|
## 🚀 Quick Start
|
|
24
24
|
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
|
|
25
28
|
### Option 1: Install from PyPI (Recommended)
|
|
26
29
|
|
|
27
30
|
```bash
|
|
@@ -55,8 +55,28 @@ class AsyncTyper(typer.Typer):
|
|
|
55
55
|
def maybe_run_async(func: Callable, *args: Any, **kwargs: Any) -> Any:
|
|
56
56
|
"""Run function asynchronously if it's a coroutine, otherwise run normally."""
|
|
57
57
|
if inspect.iscoroutinefunction(func):
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
# Check if we're already in an event loop
|
|
59
|
+
try:
|
|
60
|
+
asyncio.get_running_loop()
|
|
61
|
+
# We're in an event loop, cannot use asyncio.run()
|
|
62
|
+
# This typically happens in tests, return the coroutine
|
|
63
|
+
return func(*args, **kwargs)
|
|
64
|
+
except RuntimeError:
|
|
65
|
+
# No event loop running, safe to use asyncio.run()
|
|
66
|
+
return asyncio.run(func(*args, **kwargs))
|
|
67
|
+
else:
|
|
68
|
+
# Check if the function call returns a coroutine
|
|
69
|
+
result = func(*args, **kwargs)
|
|
70
|
+
if inspect.iscoroutine(result):
|
|
71
|
+
# Function returned a coroutine, need to run it
|
|
72
|
+
try:
|
|
73
|
+
asyncio.get_running_loop()
|
|
74
|
+
# We're in an event loop, return the coroutine
|
|
75
|
+
return result
|
|
76
|
+
except RuntimeError:
|
|
77
|
+
# No event loop running, safe to use asyncio.run()
|
|
78
|
+
return asyncio.run(result)
|
|
79
|
+
return result
|
|
60
80
|
|
|
61
81
|
def command(
|
|
62
82
|
self,
|
|
@@ -6,6 +6,7 @@ from .clusters import clusters_command
|
|
|
6
6
|
from .federations import federations_command
|
|
7
7
|
from .networks import networks_command
|
|
8
8
|
from .notebooks import notebooks_command
|
|
9
|
+
from .profiles import profiles_command
|
|
9
10
|
from .teams import teams_command
|
|
10
11
|
|
|
11
12
|
__all__ = [
|
|
@@ -15,5 +16,6 @@ __all__ = [
|
|
|
15
16
|
"federations_command",
|
|
16
17
|
"networks_command",
|
|
17
18
|
"notebooks_command",
|
|
19
|
+
"profiles_command",
|
|
18
20
|
"teams_command",
|
|
19
21
|
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# © 2025 Vantage Compute, Inc. All rights reserved.
|
|
2
|
+
# Confidential and proprietary. Unauthorized use prohibited.
|
|
3
|
+
"""Alias command for profiles -> profile list."""
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from vantage_cli.commands.profile.crud import list_profiles
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def profiles_command(
|
|
11
|
+
ctx: typer.Context,
|
|
12
|
+
):
|
|
13
|
+
"""List all profiles (alias for 'vantage profile list')."""
|
|
14
|
+
# Extract flags from the AsyncTyper context
|
|
15
|
+
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
16
|
+
verbose = getattr(ctx.obj, "verbose", False) if ctx.obj else False
|
|
17
|
+
list_profiles(ctx, json_output=json_output, verbose=verbose)
|
|
@@ -47,11 +47,15 @@ def create_profile(
|
|
|
47
47
|
activate: Annotated[
|
|
48
48
|
bool, typer.Option("--activate", help="Activate this profile after creation")
|
|
49
49
|
] = False,
|
|
50
|
+
json_output: Annotated[
|
|
51
|
+
bool, typer.Option("--json", "-j", help="Output in JSON format")
|
|
52
|
+
] = False,
|
|
53
|
+
verbose: Annotated[
|
|
54
|
+
bool, typer.Option("--verbose", "-v", help="Enable verbose terminal output")
|
|
55
|
+
] = False,
|
|
50
56
|
):
|
|
51
57
|
"""Create a new Vantage CLI profile."""
|
|
52
58
|
# Get the effective JSON output preference
|
|
53
|
-
# Get JSON flag from context (automatically set by AsyncTyper)
|
|
54
|
-
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
55
59
|
effective_json = get_effective_json_output(ctx, json_output)
|
|
56
60
|
|
|
57
61
|
# Check if profile already exists
|
|
@@ -138,11 +142,16 @@ def delete_profile(
|
|
|
138
142
|
ctx: typer.Context,
|
|
139
143
|
profile_name: Annotated[str, typer.Argument(help="Name of the profile to delete")],
|
|
140
144
|
force: Annotated[bool, typer.Option("--force", "-f", help="Skip confirmation prompt")] = False,
|
|
145
|
+
json_output: Annotated[
|
|
146
|
+
bool, typer.Option("--json", "-j", help="Output in JSON format")
|
|
147
|
+
] = False,
|
|
148
|
+
verbose: Annotated[
|
|
149
|
+
bool, typer.Option("--verbose", "-v", help="Enable verbose terminal output")
|
|
150
|
+
] = False,
|
|
141
151
|
):
|
|
142
152
|
"""Delete a Vantage CLI profile."""
|
|
143
153
|
# Get the effective JSON output preference
|
|
144
|
-
|
|
145
|
-
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
154
|
+
effective_json = get_effective_json_output(ctx, json_output)
|
|
146
155
|
effective_json = get_effective_json_output(ctx, json_output)
|
|
147
156
|
|
|
148
157
|
# Check if profile exists
|
|
@@ -250,11 +259,15 @@ def delete_profile(
|
|
|
250
259
|
def get_profile(
|
|
251
260
|
ctx: typer.Context,
|
|
252
261
|
profile_name: Annotated[str, typer.Argument(help="Name of the profile to get details for")],
|
|
262
|
+
json_output: Annotated[
|
|
263
|
+
bool, typer.Option("--json", "-j", help="Output in JSON format")
|
|
264
|
+
] = False,
|
|
265
|
+
verbose: Annotated[
|
|
266
|
+
bool, typer.Option("--verbose", "-v", help="Enable verbose terminal output")
|
|
267
|
+
] = False,
|
|
253
268
|
):
|
|
254
269
|
"""Get details of a specific Vantage CLI profile."""
|
|
255
270
|
# Get the effective JSON output preference
|
|
256
|
-
# Get JSON flag from context (automatically set by AsyncTyper)
|
|
257
|
-
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
258
271
|
effective_json = get_effective_json_output(ctx, json_output)
|
|
259
272
|
|
|
260
273
|
# Check if profile exists
|
|
@@ -305,10 +318,16 @@ def get_profile(
|
|
|
305
318
|
)
|
|
306
319
|
|
|
307
320
|
|
|
308
|
-
def list_profiles(
|
|
321
|
+
def list_profiles(
|
|
322
|
+
ctx: typer.Context,
|
|
323
|
+
json_output: Annotated[
|
|
324
|
+
bool, typer.Option("--json", "-j", help="Output in JSON format")
|
|
325
|
+
] = False,
|
|
326
|
+
verbose: Annotated[
|
|
327
|
+
bool, typer.Option("--verbose", "-v", help="Enable verbose terminal output")
|
|
328
|
+
] = False,
|
|
329
|
+
):
|
|
309
330
|
"""List all Vantage CLI profiles."""
|
|
310
|
-
# Get JSON flag from context (automatically set by AsyncTyper)
|
|
311
|
-
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
312
331
|
# Get the effective JSON output preference
|
|
313
332
|
effective_json = get_effective_json_output(ctx, json_output)
|
|
314
333
|
|
|
@@ -366,11 +385,15 @@ def list_profiles(ctx: typer.Context):
|
|
|
366
385
|
def use_profile(
|
|
367
386
|
ctx: typer.Context,
|
|
368
387
|
profile_name: Annotated[str, typer.Argument(help="Name of the profile to activate")],
|
|
388
|
+
json_output: Annotated[
|
|
389
|
+
bool, typer.Option("--json", "-j", help="Output in JSON format")
|
|
390
|
+
] = False,
|
|
391
|
+
verbose: Annotated[
|
|
392
|
+
bool, typer.Option("--verbose", "-v", help="Enable verbose terminal output")
|
|
393
|
+
] = False,
|
|
369
394
|
):
|
|
370
395
|
"""Activate a profile for use in the current session."""
|
|
371
396
|
# Get the effective JSON output preference
|
|
372
|
-
# Get JSON flag from context (automatically set by AsyncTyper)
|
|
373
|
-
json_output = getattr(ctx.obj, "json_output", False) if ctx.obj else False
|
|
374
397
|
effective_json = get_effective_json_output(ctx, json_output)
|
|
375
398
|
|
|
376
399
|
# Check if profile exists
|
|
@@ -26,6 +26,7 @@ from vantage_cli.commands.alias import (
|
|
|
26
26
|
federations_command,
|
|
27
27
|
networks_command,
|
|
28
28
|
notebooks_command,
|
|
29
|
+
profiles_command,
|
|
29
30
|
teams_command,
|
|
30
31
|
)
|
|
31
32
|
from vantage_cli.commands.cloud import clouds_app
|
|
@@ -202,6 +203,7 @@ async def logout(ctx: typer.Context):
|
|
|
202
203
|
|
|
203
204
|
|
|
204
205
|
@app.command()
|
|
206
|
+
@handle_abort
|
|
205
207
|
@with_cache
|
|
206
208
|
@attach_settings
|
|
207
209
|
async def whoami(ctx: typer.Context):
|
|
@@ -325,6 +327,7 @@ app.command("clusters", hidden=True)(clusters_command)
|
|
|
325
327
|
app.command("federations", hidden=True)(federations_command)
|
|
326
328
|
app.command("networks", hidden=True)(networks_command)
|
|
327
329
|
app.command("notebooks", hidden=True)(notebooks_command)
|
|
330
|
+
app.command("profiles", hidden=True)(profiles_command)
|
|
328
331
|
app.command("teams", hidden=True)(teams_command)
|
|
329
332
|
|
|
330
333
|
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Debug script to check if JsonOption annotation is the issue."""
|
|
3
|
-
|
|
4
|
-
import inspect
|
|
5
|
-
import typer
|
|
6
|
-
import functools
|
|
7
|
-
from typing_extensions import Annotated
|
|
8
|
-
|
|
9
|
-
JsonOption = Annotated[bool, typer.Option("--json", "-j", help="Output in JSON format")]
|
|
10
|
-
|
|
11
|
-
def test_wrapper1(ctx: typer.Context, json_output: bool = False):
|
|
12
|
-
"""Wrapper with plain bool type."""
|
|
13
|
-
return "test"
|
|
14
|
-
|
|
15
|
-
def test_wrapper2(ctx: typer.Context, json_output: JsonOption = False):
|
|
16
|
-
"""Wrapper with JsonOption type."""
|
|
17
|
-
return "test"
|
|
18
|
-
|
|
19
|
-
print("test_wrapper1 signature (plain bool):")
|
|
20
|
-
print(inspect.signature(test_wrapper1))
|
|
21
|
-
|
|
22
|
-
print("\ntest_wrapper2 signature (JsonOption):")
|
|
23
|
-
print(inspect.signature(test_wrapper2))
|
|
24
|
-
|
|
25
|
-
# Test parameter inspection
|
|
26
|
-
sig1 = inspect.signature(test_wrapper1)
|
|
27
|
-
sig2 = inspect.signature(test_wrapper2)
|
|
28
|
-
|
|
29
|
-
print(f"\ntest_wrapper1 parameters: {list(sig1.parameters.keys())}")
|
|
30
|
-
print(f"test_wrapper2 parameters: {list(sig2.parameters.keys())}")
|
|
31
|
-
|
|
32
|
-
print(f"\njson_output param in wrapper1: {'json_output' in sig1.parameters}")
|
|
33
|
-
print(f"json_output param in wrapper2: {'json_output' in sig2.parameters}")
|
|
34
|
-
|
|
35
|
-
if 'json_output' in sig2.parameters:
|
|
36
|
-
param = sig2.parameters['json_output']
|
|
37
|
-
print(f"json_output annotation: {param.annotation}")
|
|
38
|
-
print(f"json_output default: {param.default}")
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Debug script to understand how the decorators work."""
|
|
3
|
-
|
|
4
|
-
import inspect
|
|
5
|
-
import typer
|
|
6
|
-
from vantage_cli.decorators import vantage_command, JsonOption
|
|
7
|
-
|
|
8
|
-
app = typer.Typer()
|
|
9
|
-
|
|
10
|
-
# Test the decorator manually
|
|
11
|
-
def test_func(ctx: typer.Context):
|
|
12
|
-
return "test"
|
|
13
|
-
|
|
14
|
-
print("Original function signature:")
|
|
15
|
-
print(inspect.signature(test_func))
|
|
16
|
-
|
|
17
|
-
# Apply the decorator manually to see what happens
|
|
18
|
-
decorator = vantage_command(app, "test")
|
|
19
|
-
wrapped = decorator(test_func)
|
|
20
|
-
|
|
21
|
-
print("\nAfter applying vantage_command:")
|
|
22
|
-
print(f"wrapped is: {wrapped}")
|
|
23
|
-
print(f"wrapped type: {type(wrapped)}")
|
|
24
|
-
print(f"wrapped signature: {inspect.signature(wrapped)}")
|
|
25
|
-
|
|
26
|
-
print(f"\nRegistered commands: {len(app.registered_commands)}")
|
|
27
|
-
if app.registered_commands:
|
|
28
|
-
cmd = app.registered_commands[0]
|
|
29
|
-
print(f"Command name: {cmd.name}")
|
|
30
|
-
print(f"Command callback: {cmd.callback}")
|
|
31
|
-
print(f"Command callback type: {type(cmd.callback)}")
|
|
32
|
-
if cmd.callback:
|
|
33
|
-
print(f"Command callback signature: {inspect.signature(cmd.callback)}")
|
|
34
|
-
|
|
35
|
-
# Let's also test what the wrapper function looks like in isolation
|
|
36
|
-
import functools
|
|
37
|
-
|
|
38
|
-
def manual_wrapper(func):
|
|
39
|
-
@functools.wraps(func)
|
|
40
|
-
def wrapper(ctx: typer.Context, *args, json_output: JsonOption = False, **kwargs):
|
|
41
|
-
print(f"Wrapper called with json_output={json_output}")
|
|
42
|
-
return func(ctx, *args, **kwargs)
|
|
43
|
-
return wrapper
|
|
44
|
-
|
|
45
|
-
wrapped_manual = manual_wrapper(test_func)
|
|
46
|
-
print(f"\nManual wrapper signature: {inspect.signature(wrapped_manual)}")
|
vantage_cli-0.1.5/debug_typer.py
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Debug script to understand how typer.command works."""
|
|
3
|
-
|
|
4
|
-
import inspect
|
|
5
|
-
import typer
|
|
6
|
-
import functools
|
|
7
|
-
from typing_extensions import Annotated
|
|
8
|
-
|
|
9
|
-
app = typer.Typer()
|
|
10
|
-
|
|
11
|
-
JsonOption = Annotated[bool, typer.Option("--json", "-j", help="Output in JSON format")]
|
|
12
|
-
|
|
13
|
-
def original_func(ctx: typer.Context):
|
|
14
|
-
return "original"
|
|
15
|
-
|
|
16
|
-
print("Original function signature:")
|
|
17
|
-
print(inspect.signature(original_func))
|
|
18
|
-
|
|
19
|
-
# Create a wrapper manually
|
|
20
|
-
@functools.wraps(original_func)
|
|
21
|
-
def wrapper(ctx: typer.Context, *args, json_output: JsonOption = False, **kwargs):
|
|
22
|
-
return original_func(ctx, *args, **kwargs)
|
|
23
|
-
|
|
24
|
-
print(f"\nWrapper signature: {inspect.signature(wrapper)}")
|
|
25
|
-
|
|
26
|
-
# Test what app.command returns
|
|
27
|
-
result = app.command("test")(wrapper)
|
|
28
|
-
|
|
29
|
-
print(f"\napp.command result: {result}")
|
|
30
|
-
print(f"result is wrapper: {result is wrapper}")
|
|
31
|
-
print(f"result is original_func: {result is original_func}")
|
|
32
|
-
print(f"result signature: {inspect.signature(result)}")
|
|
33
|
-
|
|
34
|
-
# Check what's registered
|
|
35
|
-
print(f"\nRegistered commands: {len(app.registered_commands)}")
|
|
36
|
-
if app.registered_commands:
|
|
37
|
-
cmd = app.registered_commands[0]
|
|
38
|
-
print(f"Command callback: {cmd.callback}")
|
|
39
|
-
print(f"Callback is wrapper: {cmd.callback is wrapper}")
|
|
40
|
-
print(f"Callback is result: {cmd.callback is result}")
|
|
41
|
-
print(f"Callback signature: {inspect.signature(cmd.callback)}")
|
vantage_cli-0.1.5/debug_wraps.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Debug script to test functools.wraps behavior."""
|
|
3
|
-
|
|
4
|
-
import inspect
|
|
5
|
-
import typer
|
|
6
|
-
import functools
|
|
7
|
-
from typing_extensions import Annotated
|
|
8
|
-
|
|
9
|
-
JsonOption = Annotated[bool, typer.Option("--json", "-j", help="Output in JSON format")]
|
|
10
|
-
|
|
11
|
-
def original_func(ctx: typer.Context):
|
|
12
|
-
"""Original function."""
|
|
13
|
-
return "original"
|
|
14
|
-
|
|
15
|
-
print("Original function signature:")
|
|
16
|
-
print(inspect.signature(original_func))
|
|
17
|
-
|
|
18
|
-
# Test wrapper WITHOUT functools.wraps
|
|
19
|
-
def wrapper_no_wraps(ctx: typer.Context, json_output: JsonOption = False):
|
|
20
|
-
"""Wrapper without functools.wraps."""
|
|
21
|
-
return original_func(ctx)
|
|
22
|
-
|
|
23
|
-
print(f"\nWrapper without @functools.wraps signature:")
|
|
24
|
-
print(inspect.signature(wrapper_no_wraps))
|
|
25
|
-
|
|
26
|
-
# Test wrapper WITH functools.wraps
|
|
27
|
-
@functools.wraps(original_func)
|
|
28
|
-
def wrapper_with_wraps(ctx: typer.Context, json_output: JsonOption = False):
|
|
29
|
-
"""Wrapper with functools.wraps."""
|
|
30
|
-
return original_func(ctx)
|
|
31
|
-
|
|
32
|
-
print(f"\nWrapper with @functools.wraps signature:")
|
|
33
|
-
print(inspect.signature(wrapper_with_wraps))
|
|
34
|
-
|
|
35
|
-
print(f"\nWrapper without wraps parameters: {list(inspect.signature(wrapper_no_wraps).parameters.keys())}")
|
|
36
|
-
print(f"Wrapper with wraps parameters: {list(inspect.signature(wrapper_with_wraps).parameters.keys())}")
|
|
37
|
-
|
|
38
|
-
# Check what __wrapped__ attribute contains
|
|
39
|
-
if hasattr(wrapper_with_wraps, '__wrapped__'):
|
|
40
|
-
print(f"\n__wrapped__ signature: {inspect.signature(wrapper_with_wraps.__wrapped__)}")
|
|
41
|
-
|
|
42
|
-
# Test manually setting signature
|
|
43
|
-
wrapper_manual = lambda ctx, json_output=False: original_func(ctx)
|
|
44
|
-
wrapper_manual.__name__ = original_func.__name__
|
|
45
|
-
wrapper_manual.__doc__ = original_func.__doc__
|
|
46
|
-
|
|
47
|
-
print(f"\nManual wrapper (before signature): {inspect.signature(wrapper_manual)}")
|
|
48
|
-
|
|
49
|
-
# Manually set the signature
|
|
50
|
-
from inspect import Parameter, Signature
|
|
51
|
-
params = [
|
|
52
|
-
Parameter('ctx', Parameter.POSITIONAL_OR_KEYWORD, annotation=typer.Context),
|
|
53
|
-
Parameter('json_output', Parameter.KEYWORD_ONLY, default=False, annotation=JsonOption)
|
|
54
|
-
]
|
|
55
|
-
wrapper_manual.__signature__ = Signature(params)
|
|
56
|
-
|
|
57
|
-
print(f"Manual wrapper (after signature): {inspect.signature(wrapper_manual)}")
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Script to fix cluster tests by applying json_output parameter removal pattern."""
|
|
3
|
-
|
|
4
|
-
import re
|
|
5
|
-
|
|
6
|
-
def fix_cluster_tests():
|
|
7
|
-
file_path = "tests/unit/test_cluster_commands.py"
|
|
8
|
-
|
|
9
|
-
with open(file_path, 'r') as f:
|
|
10
|
-
content = f.read()
|
|
11
|
-
|
|
12
|
-
# Add SimpleNamespace import if not present
|
|
13
|
-
if "from types import SimpleNamespace" not in content:
|
|
14
|
-
content = content.replace(
|
|
15
|
-
"from unittest.mock import Mock, patch",
|
|
16
|
-
"from types import SimpleNamespace\nfrom unittest.mock import Mock, patch"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
# Fix mock_context fixtures
|
|
20
|
-
fixture_pattern = r'(ctx\.obj = Mock\(\)\s+ctx\.obj\.settings = Mock\(\)\s+ctx\.obj\.profile = "default")'
|
|
21
|
-
fixture_replacement = 'ctx.obj = SimpleNamespace(\n profile="default",\n verbose=False,\n json_output=False\n )'
|
|
22
|
-
|
|
23
|
-
content = re.sub(fixture_pattern, fixture_replacement, content, flags=re.MULTILINE)
|
|
24
|
-
|
|
25
|
-
# Fix function calls - remove json_output parameters
|
|
26
|
-
patterns_to_fix = [
|
|
27
|
-
(r'list_clusters\(([^,]+), json_output=\w+\)', r'list_clusters(\1)'),
|
|
28
|
-
(r'delete_cluster\(([^,]+), ([^,]+), force=(\w+), json_output=\w+\)', r'delete_cluster(\1, \2, force=\3)'),
|
|
29
|
-
(r'get_cluster\(([^,]+), ([^,]+), json_output=\w+\)', r'get_cluster(\1, \2)'),
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
for pattern, replacement in patterns_to_fix:
|
|
33
|
-
content = re.sub(pattern, replacement, content)
|
|
34
|
-
|
|
35
|
-
# Add context setting before function calls for json_output tests
|
|
36
|
-
content = re.sub(
|
|
37
|
-
r'(mock_get_effective_json_output\.return_value = True)\s+(# Call the function)',
|
|
38
|
-
r'\1\n mock_ctx.obj.json_output = True\n \2',
|
|
39
|
-
content,
|
|
40
|
-
flags=re.MULTILINE
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
# Handle cases where json_output is False
|
|
44
|
-
content = re.sub(
|
|
45
|
-
r'(await list_clusters\(mock_ctx\))\s+(# Check that render_json was called)',
|
|
46
|
-
r'mock_ctx.obj.json_output = True\n \1\n \2',
|
|
47
|
-
content,
|
|
48
|
-
flags=re.MULTILINE
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
with open(file_path, 'w') as f:
|
|
52
|
-
f.write(content)
|
|
53
|
-
|
|
54
|
-
print("Cluster tests fixed!")
|
|
55
|
-
|
|
56
|
-
if __name__ == "__main__":
|
|
57
|
-
fix_cluster_tests()
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Script to fix config tests by applying json_output parameter removal pattern."""
|
|
3
|
-
|
|
4
|
-
import re
|
|
5
|
-
|
|
6
|
-
def fix_config_tests():
|
|
7
|
-
file_path = "tests/unit/test_config_commands.py"
|
|
8
|
-
|
|
9
|
-
with open(file_path, 'r') as f:
|
|
10
|
-
content = f.read()
|
|
11
|
-
|
|
12
|
-
# Add SimpleNamespace import if not present
|
|
13
|
-
if "from types import SimpleNamespace" not in content:
|
|
14
|
-
content = content.replace(
|
|
15
|
-
"from unittest.mock import AsyncMock, Mock, patch",
|
|
16
|
-
"from types import SimpleNamespace\nfrom unittest.mock import AsyncMock, Mock, patch"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
# Fix mock_context fixtures - replace Mock objects with SimpleNamespace
|
|
20
|
-
fixture_pattern = r'(ctx\.obj = Mock\(\)[^}]+ctx\.obj\.profile = "default"[^}]*return ctx)'
|
|
21
|
-
fixture_replacement = '''ctx.obj = SimpleNamespace(
|
|
22
|
-
profile="default",
|
|
23
|
-
verbose=False,
|
|
24
|
-
json_output=False
|
|
25
|
-
)
|
|
26
|
-
return ctx'''
|
|
27
|
-
|
|
28
|
-
content = re.sub(fixture_pattern, fixture_replacement, content, flags=re.MULTILINE | re.DOTALL)
|
|
29
|
-
|
|
30
|
-
# Fix function calls - remove json_output parameters and add context setting
|
|
31
|
-
patterns_to_fix = [
|
|
32
|
-
(r'(await clear_config\([^,]+), json_output=(\w+)\)', r'mock_ctx.obj.json_output = \2\n \1)'),
|
|
33
|
-
]
|
|
34
|
-
|
|
35
|
-
for pattern, replacement in patterns_to_fix:
|
|
36
|
-
content = re.sub(pattern, replacement, content)
|
|
37
|
-
|
|
38
|
-
# Also fix any direct call patterns
|
|
39
|
-
content = re.sub(
|
|
40
|
-
r'await clear_config\(([^,]+), force=(\w+), json_output=(\w+)\)',
|
|
41
|
-
r'mock_ctx.obj.json_output = \3\n await clear_config(\1, force=\2)',
|
|
42
|
-
content
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
with open(file_path, 'w') as f:
|
|
46
|
-
f.write(content)
|
|
47
|
-
|
|
48
|
-
print("Config tests fixed!")
|
|
49
|
-
|
|
50
|
-
if __name__ == "__main__":
|
|
51
|
-
fix_config_tests()
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Script to fix federation tests by applying json_output parameter removal pattern."""
|
|
3
|
-
|
|
4
|
-
import re
|
|
5
|
-
|
|
6
|
-
def fix_federation_tests():
|
|
7
|
-
file_path = "tests/unit/test_federation_commands.py"
|
|
8
|
-
|
|
9
|
-
with open(file_path, 'r') as f:
|
|
10
|
-
content = f.read()
|
|
11
|
-
|
|
12
|
-
# Fix mock_context fixtures
|
|
13
|
-
fixture_pattern = r'(ctx\.obj = Mock\(\)\s+ctx\.obj\.settings = Mock\(\)\s+ctx\.obj\.profile = "default")'
|
|
14
|
-
fixture_replacement = 'ctx.obj = SimpleNamespace(\n profile="default",\n verbose=False,\n json_output=False\n )'
|
|
15
|
-
|
|
16
|
-
content = re.sub(fixture_pattern, fixture_replacement, content, flags=re.MULTILINE)
|
|
17
|
-
|
|
18
|
-
# Fix function calls - remove json_output parameters
|
|
19
|
-
patterns_to_fix = [
|
|
20
|
-
(r'list_federations\(([^,]+), json_output=\w+\)', r'list_federations(\1)'),
|
|
21
|
-
(r'create_federation\(([^,]+), ([^,]+), ([^,]+), json_output=\w+\)', r'create_federation(\1, \2, \3)'),
|
|
22
|
-
(r'delete_federation\(([^,]+), ([^,]+), force=(\w+), json_output=\w+\)', r'delete_federation(\1, \2, force=\3)'),
|
|
23
|
-
(r'get_federation\(([^,]+), ([^,]+), json_output=\w+\)', r'get_federation(\1, \2)'),
|
|
24
|
-
(r'update_federation\(([^,]+), ([^,]+), json_output=\w+\)', r'update_federation(\1, \2)'),
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
for pattern, replacement in patterns_to_fix:
|
|
28
|
-
content = re.sub(pattern, replacement, content)
|
|
29
|
-
|
|
30
|
-
# Add context setting before function calls
|
|
31
|
-
json_output_patterns = [
|
|
32
|
-
(r'(mock_get_json_output\.return_value = True)\s+# Run the command\s+import asyncio\s+(asyncio\.run\(list_federations\(mock_context\)\))',
|
|
33
|
-
r'\1\n mock_context.obj.json_output = True\n # Run the command\n import asyncio\n \2'),
|
|
34
|
-
(r'(mock_get_json_output\.return_value = False)\s+mock_console = Mock\(\)\s+mock_console_class\.return_value = mock_console\s+# Run the command\s+import asyncio\s+(asyncio\.run\(list_federations\(mock_context\)\))',
|
|
35
|
-
r'\1\n mock_console = Mock()\n mock_console_class.return_value = mock_console\n mock_context.obj.json_output = False\n # Run the command\n import asyncio\n \2'),
|
|
36
|
-
]
|
|
37
|
-
|
|
38
|
-
for pattern, replacement in json_output_patterns:
|
|
39
|
-
content = re.sub(pattern, replacement, content, flags=re.MULTILINE | re.DOTALL)
|
|
40
|
-
|
|
41
|
-
with open(file_path, 'w') as f:
|
|
42
|
-
f.write(content)
|
|
43
|
-
|
|
44
|
-
print("Federation tests fixed!")
|
|
45
|
-
|
|
46
|
-
if __name__ == "__main__":
|
|
47
|
-
fix_federation_tests()
|