fastapi-cloud-cli 0.28.0__tar.gz → 0.29.0__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.
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/PKG-INFO +2 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/pyproject.toml +2 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/prepare_release.py +2 -2
- fastapi_cloud_cli-0.29.0/src/fastapi_cloud_cli/__init__.py +1 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/api/_models.py +10 -4
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/api/_retry.py +1 -2
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/api/client.py +4 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/_flow.py +20 -1
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/get.py +1 -1
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/disconnect.py +1 -1
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/logs.py +1 -1
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/setup_ci.py +2 -2
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/dates.py +4 -4
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/sentry.py +12 -1
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/version_check.py +3 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/domains/test_cli.py +4 -4
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/test_get.py +3 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_api_client.py +14 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli.py +3 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_apps.py +2 -2
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_deployments.py +3 -3
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_login.py +122 -4
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_dates.py +2 -2
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_deploy_utils.py +1 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_env_list.py +4 -4
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_progress_file.py +3 -7
- fastapi_cloud_cli-0.29.0/tests/test_sentry.py +73 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_version_check.py +7 -7
- fastapi_cloud_cli-0.28.0/src/fastapi_cloud_cli/__init__.py +0 -1
- fastapi_cloud_cli-0.28.0/tests/test_sentry.py +0 -38
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/LICENSE +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/README.md +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/add_latest_release_date.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/format.sh +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/lint.sh +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/test-cov-html.sh +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/scripts/test.sh +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/__main__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/api/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/api/_errors.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/cli.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/_auth.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/create.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/get.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/link.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/unlink.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/apps/update.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/auth/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/auth/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/auth/wait.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/ci/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/ci/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/ci/print_workflow.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/archive.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/cloud.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/command.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/configure.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/upload.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deploy/wait.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/deployments.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/_setup.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/_shared.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/add.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/get.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/remove.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/rendering.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/domains/restart.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/_shared.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/delete.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/set.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/providers/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/providers/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/providers/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/connect.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/get.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/integrations/resources/providers.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/login.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/logout.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/teams/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/teams/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/teams/get.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/teams/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/tokens/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/tokens/_app.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/tokens/create.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/tokens/delete.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/tokens/list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/whoami.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/config.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/logging.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/py.typed +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/apps.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/auth.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/build_logs.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/cli.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/config.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/env.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/errors.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/execution.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/progress_file.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/teams.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/conftest.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/domains/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/domains/test_setup.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/providers/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/providers/test_list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/__init__.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/test_connect.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/test_disconnect.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/test_list.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_archive.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_auth.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_ci.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_deploy.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_link.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_logout.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_setup_ci.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_teams.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_tokens.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_unlink.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_cli_whoami.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_config.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_env_delete.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_env_get.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_env_set.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_logs.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_prepare_release.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/test_utils_apps.py +0 -0
- {fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fastapi-cloud-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.29.0
|
|
4
4
|
Summary: Deploy and manage FastAPI Cloud apps from the command line 🚀
|
|
5
5
|
Author-Email: Patrick Arminio <patrick@fastapilabs.com>
|
|
6
6
|
License: MIT
|
|
@@ -19,7 +19,6 @@ Classifier: Framework :: FastAPI
|
|
|
19
19
|
Classifier: Intended Audience :: Developers
|
|
20
20
|
Classifier: License :: OSI Approved :: MIT License
|
|
21
21
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
@@ -30,7 +29,7 @@ Project-URL: Documentation, https://fastapi.tiangolo.com/fastapi-cloud-cli/
|
|
|
30
29
|
Project-URL: Repository, https://github.com/fastapilabs/fastapi-cloud-cli
|
|
31
30
|
Project-URL: Issues, https://github.com/fastapilabs/fastapi-cloud-cli/issues
|
|
32
31
|
Project-URL: Changelog, https://github.com/fastapilabs/fastapi-cloud-cli/blob/main/release-notes.md
|
|
33
|
-
Requires-Python: >=3.
|
|
32
|
+
Requires-Python: >=3.11
|
|
34
33
|
Requires-Dist: typer>=0.26.1
|
|
35
34
|
Requires-Dist: uvicorn[standard]>=0.17.6
|
|
36
35
|
Requires-Dist: rignore>=0.5.1
|
|
@@ -5,7 +5,7 @@ description = "Deploy and manage FastAPI Cloud apps from the command line 🚀"
|
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Patrick Arminio", email = "patrick@fastapilabs.com" },
|
|
7
7
|
]
|
|
8
|
-
requires-python = ">=3.
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Intended Audience :: Information Technology",
|
|
@@ -23,7 +23,6 @@ classifiers = [
|
|
|
23
23
|
"Intended Audience :: Developers",
|
|
24
24
|
"License :: OSI Approved :: MIT License",
|
|
25
25
|
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
-
"Programming Language :: Python :: 3.10",
|
|
27
26
|
"Programming Language :: Python :: 3.11",
|
|
28
27
|
"Programming Language :: Python :: 3.12",
|
|
29
28
|
"Programming Language :: Python :: 3.13",
|
|
@@ -44,7 +43,7 @@ dependencies = [
|
|
|
44
43
|
"detect-installer>=0.1.0",
|
|
45
44
|
"agent-detector>=1.1.0",
|
|
46
45
|
]
|
|
47
|
-
version = "0.
|
|
46
|
+
version = "0.29.0"
|
|
48
47
|
|
|
49
48
|
[project.license]
|
|
50
49
|
text = "MIT"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
from datetime import date
|
|
5
|
-
from enum import
|
|
5
|
+
from enum import StrEnum
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from typing import Annotated
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ RELEASE_NOTES_HEADER = "# Release Notes\n\n"
|
|
|
14
14
|
LATEST_CHANGES_HEADER = "## Latest Changes"
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
class BumpType(
|
|
17
|
+
class BumpType(StrEnum):
|
|
18
18
|
major = "major"
|
|
19
19
|
minor = "minor"
|
|
20
20
|
patch = "patch"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.29.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from enum import
|
|
1
|
+
from enum import StrEnum
|
|
2
2
|
from typing import Annotated, Literal
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field, TypeAdapter
|
|
@@ -50,7 +50,7 @@ BuildLogAdapter: TypeAdapter[BuildLogLine] = TypeAdapter(
|
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
class CustomDomainStatus(
|
|
53
|
+
class CustomDomainStatus(StrEnum):
|
|
54
54
|
internal_dcv_pending = "internal_dcv_pending"
|
|
55
55
|
internal_dcv_missing = "internal_dcv_missing"
|
|
56
56
|
internal_dcv_invalid = "internal_dcv_invalid"
|
|
@@ -96,7 +96,7 @@ class CustomDomainsAPIResponse(BaseModel):
|
|
|
96
96
|
count: int
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
class DeploymentStatus(
|
|
99
|
+
class DeploymentStatus(StrEnum):
|
|
100
100
|
waiting_upload = "waiting_upload"
|
|
101
101
|
upload_cancelled = "upload_cancelled"
|
|
102
102
|
ready_for_build = "ready_for_build"
|
|
@@ -117,6 +117,7 @@ class DeploymentStatus(str, Enum):
|
|
|
117
117
|
verification_failed_oom = "verification_failed_oom"
|
|
118
118
|
verifying_skipped = "verifying_skipped"
|
|
119
119
|
success = "success"
|
|
120
|
+
scaled_to_zero = "scaled_to_zero"
|
|
120
121
|
degraded_oom = "degraded_oom"
|
|
121
122
|
degraded = "degraded"
|
|
122
123
|
expired = "expired"
|
|
@@ -151,6 +152,7 @@ class DeploymentStatus(str, Enum):
|
|
|
151
152
|
cls.verification_failed_oom: "Verification Failed (OOM)",
|
|
152
153
|
cls.verifying_skipped: "Verification Skipped",
|
|
153
154
|
cls.success: "Ready",
|
|
155
|
+
cls.scaled_to_zero: "Scaled to Zero",
|
|
154
156
|
cls.degraded_oom: "Degraded (OOM)",
|
|
155
157
|
cls.degraded: "Degraded",
|
|
156
158
|
cls.expired: "Expired",
|
|
@@ -170,7 +172,11 @@ class Deployment(BaseModel):
|
|
|
170
172
|
failure: BuildFailure | None = None
|
|
171
173
|
|
|
172
174
|
|
|
173
|
-
SUCCESSFUL_STATUSES = {
|
|
175
|
+
SUCCESSFUL_STATUSES = {
|
|
176
|
+
DeploymentStatus.success,
|
|
177
|
+
DeploymentStatus.scaled_to_zero,
|
|
178
|
+
DeploymentStatus.verifying_skipped,
|
|
179
|
+
}
|
|
174
180
|
BUILD_FAILED_STATUSES = {
|
|
175
181
|
DeploymentStatus.building_image_failed,
|
|
176
182
|
DeploymentStatus.building_image_failed_timeout,
|
|
@@ -4,10 +4,9 @@ from collections.abc import Callable, Generator
|
|
|
4
4
|
from contextlib import contextmanager
|
|
5
5
|
from datetime import timedelta
|
|
6
6
|
from functools import wraps
|
|
7
|
-
from typing import TypeVar
|
|
7
|
+
from typing import ParamSpec, TypeVar
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
|
-
from typing_extensions import ParamSpec
|
|
11
10
|
|
|
12
11
|
from ._errors import StreamLogError, TooManyRetriesError
|
|
13
12
|
|
|
@@ -211,10 +211,11 @@ class APIClient(httpx.Client):
|
|
|
211
211
|
|
|
212
212
|
return CustomDomain.model_validate(response.json())
|
|
213
213
|
|
|
214
|
-
def logout(self) -> None:
|
|
215
|
-
"""Revoke the token this client sends."""
|
|
214
|
+
def logout(self, token: str | None = None) -> None:
|
|
215
|
+
"""Revoke the given token, or else the token this client sends."""
|
|
216
|
+
headers = {"Authorization": f"Bearer {token}"} if token else None
|
|
216
217
|
# Short, so logging out doesn't hang when FastAPI Cloud is slow.
|
|
217
|
-
response = self.post("/logout", timeout=5)
|
|
218
|
+
response = self.post("/logout", headers=headers, timeout=5)
|
|
218
219
|
# FastAPI Cloud without /logout can't revoke tokens, so there's nothing to do.
|
|
219
220
|
if response.status_code != 404:
|
|
220
221
|
response.raise_for_status()
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/_flow.py
RENAMED
|
@@ -8,7 +8,12 @@ from rich_toolkit.progress import Progress
|
|
|
8
8
|
|
|
9
9
|
from fastapi_cloud_cli.api import APIClient
|
|
10
10
|
from fastapi_cloud_cli.config import Settings
|
|
11
|
-
from fastapi_cloud_cli.utils.auth import
|
|
11
|
+
from fastapi_cloud_cli.utils.auth import (
|
|
12
|
+
AuthConfig,
|
|
13
|
+
AuthMode,
|
|
14
|
+
Identity,
|
|
15
|
+
write_auth_config,
|
|
16
|
+
)
|
|
12
17
|
from fastapi_cloud_cli.utils.cli import FastAPIRichToolkit
|
|
13
18
|
|
|
14
19
|
logger = logging.getLogger(__name__)
|
|
@@ -172,8 +177,22 @@ def complete_device_login(
|
|
|
172
177
|
if token.expires_in is not None:
|
|
173
178
|
expires_at = int(time.time()) + token.expires_in
|
|
174
179
|
|
|
180
|
+
replaced = Identity()
|
|
181
|
+
|
|
175
182
|
write_auth_config(
|
|
176
183
|
AuthConfig(access_token=token.access_token, expires_at=expires_at)
|
|
177
184
|
)
|
|
178
185
|
|
|
186
|
+
if replaced.user_token and not replaced.is_user_token_expired():
|
|
187
|
+
_revoke_replaced_login(client, replaced.user_token)
|
|
188
|
+
|
|
179
189
|
return LoginOutput(authenticated=True, auth_mode="user")
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def _revoke_replaced_login(client: APIClient, token: str) -> None:
|
|
193
|
+
# Otherwise the replaced login stays valid, unused, until it expires.
|
|
194
|
+
# Best effort: the new login is already saved, so a failure changes nothing.
|
|
195
|
+
try:
|
|
196
|
+
client.logout(token)
|
|
197
|
+
except httpx.HTTPError as e:
|
|
198
|
+
logger.debug("Could not revoke the replaced login: %s", e)
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/env/get.py
RENAMED
|
@@ -105,7 +105,7 @@ def get_variable(
|
|
|
105
105
|
name = toolkit.ask(
|
|
106
106
|
"Select the environment variable to get:",
|
|
107
107
|
options=[
|
|
108
|
-
Option({"name": env_var.name, "value": env_var.name})
|
|
108
|
+
Option[str]({"name": env_var.name, "value": env_var.name})
|
|
109
109
|
for env_var in environment_variables.data
|
|
110
110
|
],
|
|
111
111
|
bullet=False,
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/logs.py
RENAMED
|
@@ -84,7 +84,7 @@ def _get_log_bullet(log: AppLogEntry) -> str:
|
|
|
84
84
|
def _format_log_line(log: AppLogEntry) -> str:
|
|
85
85
|
"""Format a log entry for display"""
|
|
86
86
|
# Parse the timestamp string to format it consistently
|
|
87
|
-
timestamp = datetime.fromisoformat(log.timestamp
|
|
87
|
+
timestamp = datetime.fromisoformat(log.timestamp)
|
|
88
88
|
timestamp_str = timestamp.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
|
|
89
89
|
|
|
90
90
|
return f"[dim]{timestamp_str}[/dim] {escape(log.message)}"
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/commands/setup_ci.py
RENAMED
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
import re
|
|
3
3
|
import shutil
|
|
4
4
|
import subprocess
|
|
5
|
-
from datetime import
|
|
5
|
+
from datetime import UTC, datetime
|
|
6
6
|
from pathlib import Path, PurePath
|
|
7
7
|
from typing import Annotated, Any
|
|
8
8
|
|
|
@@ -418,7 +418,7 @@ def setup_ci(
|
|
|
418
418
|
|
|
419
419
|
if should_create_token:
|
|
420
420
|
# Create unique token name with timestamp to avoid duplicates
|
|
421
|
-
timestamp = datetime.now(
|
|
421
|
+
timestamp = datetime.now(UTC).strftime("%Y-%m-%d %H:%M UTC")
|
|
422
422
|
token_name = f"GitHub Actions — {repo_slug} ({timestamp})"
|
|
423
423
|
|
|
424
424
|
with (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import
|
|
1
|
+
from datetime import UTC, datetime
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
def format_last_updated(updated_at: str | None) -> str:
|
|
@@ -6,14 +6,14 @@ def format_last_updated(updated_at: str | None) -> str:
|
|
|
6
6
|
return "-"
|
|
7
7
|
|
|
8
8
|
try:
|
|
9
|
-
updated = datetime.fromisoformat(updated_at
|
|
9
|
+
updated = datetime.fromisoformat(updated_at)
|
|
10
10
|
except ValueError:
|
|
11
11
|
return updated_at
|
|
12
12
|
|
|
13
13
|
if updated.tzinfo is None:
|
|
14
|
-
updated = updated.replace(tzinfo=
|
|
14
|
+
updated = updated.replace(tzinfo=UTC)
|
|
15
15
|
|
|
16
|
-
now = datetime.now(
|
|
16
|
+
now = datetime.now(UTC)
|
|
17
17
|
seconds = int((now - updated).total_seconds())
|
|
18
18
|
|
|
19
19
|
if seconds < 60:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
1
3
|
import sentry_sdk
|
|
2
4
|
from sentry_sdk.integrations.typer import TyperIntegration
|
|
3
5
|
|
|
@@ -6,6 +8,15 @@ from fastapi_cloud_cli.utils.auth import Identity
|
|
|
6
8
|
SENTRY_DSN = "https://230250605ea4b58a0b69c768e9ec1168@o4506985151856640.ingest.us.sentry.io/4508449198899200"
|
|
7
9
|
|
|
8
10
|
|
|
11
|
+
def _without_user_data() -> dict[str, Any]:
|
|
12
|
+
# sentry-sdk 3 replaced `send_default_pii` with `data_collection`, and
|
|
13
|
+
# collects user info unless told not to. Apps can still pin sentry-sdk 2.
|
|
14
|
+
if int(sentry_sdk.VERSION.split(".")[0]) < 3:
|
|
15
|
+
return {"send_default_pii": False}
|
|
16
|
+
|
|
17
|
+
return {"data_collection": {"user_info": False}}
|
|
18
|
+
|
|
19
|
+
|
|
9
20
|
def init_sentry() -> None:
|
|
10
21
|
"""Initialize Sentry error tracking only if user is logged in or has a deploy token."""
|
|
11
22
|
identity = Identity()
|
|
@@ -16,5 +27,5 @@ def init_sentry() -> None:
|
|
|
16
27
|
sentry_sdk.init(
|
|
17
28
|
dsn=SENTRY_DSN,
|
|
18
29
|
integrations=[TyperIntegration()],
|
|
19
|
-
|
|
30
|
+
**_without_user_data(),
|
|
20
31
|
)
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/src/fastapi_cloud_cli/utils/version_check.py
RENAMED
|
@@ -4,7 +4,7 @@ import re
|
|
|
4
4
|
import threading
|
|
5
5
|
from contextlib import suppress
|
|
6
6
|
from dataclasses import dataclass
|
|
7
|
-
from datetime import datetime, timedelta
|
|
7
|
+
from datetime import UTC, datetime, timedelta
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
10
|
import httpx
|
|
@@ -68,7 +68,7 @@ def read_cached_latest_version(
|
|
|
68
68
|
*,
|
|
69
69
|
ttl: timedelta = VERSION_CHECK_CACHE_TTL,
|
|
70
70
|
) -> str | None:
|
|
71
|
-
now = datetime.now(
|
|
71
|
+
now = datetime.now(UTC)
|
|
72
72
|
|
|
73
73
|
try:
|
|
74
74
|
cache = VersionCheckCache.model_validate_json(
|
|
@@ -93,7 +93,7 @@ def write_latest_version_cache(
|
|
|
93
93
|
latest_version: str,
|
|
94
94
|
now: datetime | None = None,
|
|
95
95
|
) -> None:
|
|
96
|
-
now = now or datetime.now(
|
|
96
|
+
now = now or datetime.now(UTC)
|
|
97
97
|
data = {
|
|
98
98
|
"latest_version": latest_version,
|
|
99
99
|
"checked_at": now.isoformat(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
from typing import Any
|
|
4
4
|
from unittest.mock import patch
|
|
5
5
|
|
|
@@ -90,7 +90,7 @@ def test_domains_list_requires_app_context(logged_in_cli: None) -> None:
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
@pytest.mark.respx
|
|
93
|
-
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=
|
|
93
|
+
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=UTC), tick=False)
|
|
94
94
|
def test_domains_list_uses_linked_app_and_renders_rows(
|
|
95
95
|
logged_in_cli: None,
|
|
96
96
|
respx_mock: respx.MockRouter,
|
|
@@ -341,7 +341,7 @@ def test_domains_get_resolves_normalized_hostname_or_id_as_json(
|
|
|
341
341
|
|
|
342
342
|
|
|
343
343
|
@pytest.mark.respx
|
|
344
|
-
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=
|
|
344
|
+
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=UTC), tick=False)
|
|
345
345
|
def test_domains_get_prompts_with_selector_and_renders_details(
|
|
346
346
|
logged_in_cli: None,
|
|
347
347
|
respx_mock: respx.MockRouter,
|
|
@@ -480,7 +480,7 @@ def test_domains_get_gates_zero_downtime_records_by_phase(
|
|
|
480
480
|
|
|
481
481
|
|
|
482
482
|
@pytest.mark.respx
|
|
483
|
-
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=
|
|
483
|
+
@time_machine.travel(datetime(2026, 9, 1, 10, 1, tzinfo=UTC), tick=False)
|
|
484
484
|
def test_domains_get_shows_url_and_no_action_when_live(
|
|
485
485
|
logged_in_cli: None,
|
|
486
486
|
respx_mock: respx.MockRouter,
|
{fastapi_cloud_cli-0.28.0 → fastapi_cloud_cli-0.29.0}/tests/integrations/resources/test_get.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Literal
|
|
5
5
|
|
|
@@ -216,7 +216,7 @@ def test_gets_resource_json_requires_app_without_linked_app(
|
|
|
216
216
|
|
|
217
217
|
|
|
218
218
|
@pytest.mark.respx
|
|
219
|
-
@time_machine.travel(datetime(2026, 9, 1, 10, tzinfo=
|
|
219
|
+
@time_machine.travel(datetime(2026, 9, 1, 10, tzinfo=UTC), tick=False)
|
|
220
220
|
def test_gets_database_resource_in_human_output(
|
|
221
221
|
logged_in_cli: None,
|
|
222
222
|
respx_mock: respx.MockRouter,
|
|
@@ -248,7 +248,7 @@ connected resource
|
|
|
248
248
|
|
|
249
249
|
|
|
250
250
|
@pytest.mark.respx
|
|
251
|
-
@time_machine.travel(datetime(2026, 9, 1, 10, tzinfo=
|
|
251
|
+
@time_machine.travel(datetime(2026, 9, 1, 10, tzinfo=UTC), tick=False)
|
|
252
252
|
def test_gets_logfire_resource_in_human_output_without_environment_variables(
|
|
253
253
|
logged_in_cli: None,
|
|
254
254
|
respx_mock: respx.MockRouter,
|
|
@@ -497,3 +497,17 @@ def test_get_deployment_with_persisted_failure(
|
|
|
497
497
|
respx_mock.get(f"/deployments/{deployment_id}").respond(200, json=deployment)
|
|
498
498
|
|
|
499
499
|
assert client.get_deployment(deployment_id).model_dump(mode="json") == deployment
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
@pytest.mark.respx
|
|
503
|
+
def test_logout_revokes_the_given_token(
|
|
504
|
+
logged_in_cli: None, respx_mock: respx.MockRouter
|
|
505
|
+
) -> None:
|
|
506
|
+
logout_route = respx_mock.post(
|
|
507
|
+
"/logout", headers={"Authorization": "Bearer other_token"}
|
|
508
|
+
).respond(204)
|
|
509
|
+
|
|
510
|
+
with APIClient() as client:
|
|
511
|
+
client.logout("other_token")
|
|
512
|
+
|
|
513
|
+
assert logout_route.call_count == 1
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
import subprocess
|
|
4
4
|
import sys
|
|
5
5
|
from collections.abc import Callable, Iterator
|
|
6
|
-
from datetime import
|
|
6
|
+
from datetime import UTC, datetime
|
|
7
7
|
from inspect import signature
|
|
8
8
|
from types import FunctionType
|
|
9
9
|
from typing import Any
|
|
@@ -447,7 +447,7 @@ def test_toolkit_json_mode_suppresses_update_message(
|
|
|
447
447
|
write_latest_version_cache(
|
|
448
448
|
get_version_check_cache_path(),
|
|
449
449
|
latest_version="999.0.0",
|
|
450
|
-
now=datetime.now(
|
|
450
|
+
now=datetime.now(UTC),
|
|
451
451
|
)
|
|
452
452
|
|
|
453
453
|
@test_app.command()
|
|
@@ -545,7 +545,7 @@ def test_embedded_fastapi_cli_prints_forced_update_message(
|
|
|
545
545
|
write_latest_version_cache(
|
|
546
546
|
get_version_check_cache_path(),
|
|
547
547
|
latest_version="999.0.0",
|
|
548
|
-
now=datetime.now(
|
|
548
|
+
now=datetime.now(UTC),
|
|
549
549
|
)
|
|
550
550
|
|
|
551
551
|
result = runner.invoke(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from unittest.mock import patch
|
|
5
5
|
|
|
@@ -944,7 +944,7 @@ def test_get_app_dashboard_url_uses_settings_team_and_app_slugs() -> None:
|
|
|
944
944
|
|
|
945
945
|
|
|
946
946
|
@pytest.mark.respx
|
|
947
|
-
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=
|
|
947
|
+
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=UTC), tick=False)
|
|
948
948
|
def test_lists_apps_in_human_output(
|
|
949
949
|
logged_in_cli: None,
|
|
950
950
|
respx_mock: respx.MockRouter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
from typing import Any
|
|
4
4
|
from unittest.mock import patch
|
|
5
5
|
|
|
@@ -119,7 +119,7 @@ def test_lists_deployments_as_json_uses_linked_app(
|
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
@pytest.mark.respx
|
|
122
|
-
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=
|
|
122
|
+
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=UTC), tick=False)
|
|
123
123
|
def test_lists_deployments_human_output_shows_id_status_and_created(
|
|
124
124
|
logged_in_cli: None,
|
|
125
125
|
respx_mock: respx.MockRouter,
|
|
@@ -325,7 +325,7 @@ def test_gets_deployment_json_returns_missing_required_input_without_app_context
|
|
|
325
325
|
|
|
326
326
|
|
|
327
327
|
@pytest.mark.respx
|
|
328
|
-
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=
|
|
328
|
+
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=UTC), tick=False)
|
|
329
329
|
def test_gets_deployment_in_human_output(
|
|
330
330
|
logged_in_cli: None,
|
|
331
331
|
respx_mock: respx.MockRouter,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from unittest.mock import patch
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ from typer.testing import CliRunner
|
|
|
13
13
|
|
|
14
14
|
from fastapi_cloud_cli.cli import app
|
|
15
15
|
from fastapi_cloud_cli.config import Settings
|
|
16
|
-
from tests.utils import SnapshotCliRunner
|
|
16
|
+
from tests.utils import USER_TOKEN, SnapshotCliRunner
|
|
17
17
|
|
|
18
18
|
runner = CliRunner()
|
|
19
19
|
snapshot_runner = SnapshotCliRunner()
|
|
@@ -91,7 +91,7 @@ def test_full_login(
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
@pytest.mark.respx
|
|
94
|
-
@time_machine.travel(datetime(2026, 11, 2, 12, tzinfo=
|
|
94
|
+
@time_machine.travel(datetime(2026, 11, 2, 12, tzinfo=UTC), tick=False)
|
|
95
95
|
def test_login_saves_token_expiry(
|
|
96
96
|
respx_mock: respx.MockRouter, temp_auth_config: Path, settings: Settings
|
|
97
97
|
) -> None:
|
|
@@ -132,7 +132,7 @@ def test_login_saves_token_expiry(
|
|
|
132
132
|
|
|
133
133
|
assert result.exit_code == 0
|
|
134
134
|
|
|
135
|
-
expires_at = datetime(2026, 11, 10, 11, 59, 50, tzinfo=
|
|
135
|
+
expires_at = datetime(2026, 11, 10, 11, 59, 50, tzinfo=UTC)
|
|
136
136
|
assert json.loads(temp_auth_config.read_text()) == {
|
|
137
137
|
"access_token": "test_token_1234",
|
|
138
138
|
"expires_at": int(expires_at.timestamp()),
|
|
@@ -793,6 +793,9 @@ def test_login_replaces_stored_token(
|
|
|
793
793
|
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
|
|
794
794
|
},
|
|
795
795
|
).mock(return_value=Response(200, json={"access_token": "new_token"}))
|
|
796
|
+
logout_route = respx_mock.post(
|
|
797
|
+
"/logout", headers={"Authorization": f"Bearer {USER_TOKEN}"}
|
|
798
|
+
).mock(return_value=Response(204))
|
|
796
799
|
|
|
797
800
|
result = snapshot_runner.invoke(app, ["login", "--no-open"])
|
|
798
801
|
|
|
@@ -810,3 +813,118 @@ FastAPI Cloud
|
|
|
810
813
|
"access_token": "new_token",
|
|
811
814
|
"expires_at": None,
|
|
812
815
|
}
|
|
816
|
+
assert logout_route.call_count == 1
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
def _mock_device_login(
|
|
820
|
+
respx_mock: respx.MockRouter, settings: Settings, token_response: Response
|
|
821
|
+
) -> None:
|
|
822
|
+
respx_mock.post(
|
|
823
|
+
"/login/device/authorization", data={"client_id": settings.client_id}
|
|
824
|
+
).respond(
|
|
825
|
+
200,
|
|
826
|
+
json={
|
|
827
|
+
"verification_uri_complete": "http://test.com/device?code=query-code",
|
|
828
|
+
"verification_uri": "http://test.com",
|
|
829
|
+
"user_code": "manual-code",
|
|
830
|
+
"device_code": "5678",
|
|
831
|
+
},
|
|
832
|
+
)
|
|
833
|
+
respx_mock.post(
|
|
834
|
+
"/login/device/token",
|
|
835
|
+
data={
|
|
836
|
+
"device_code": "5678",
|
|
837
|
+
"client_id": settings.client_id,
|
|
838
|
+
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
|
|
839
|
+
},
|
|
840
|
+
).mock(return_value=token_response)
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
@pytest.mark.respx
|
|
844
|
+
@pytest.mark.parametrize(
|
|
845
|
+
"logout_response",
|
|
846
|
+
[Response(401), Response(500), httpx.ConnectError("Connection refused")],
|
|
847
|
+
)
|
|
848
|
+
def test_login_succeeds_when_the_replaced_login_is_not_revoked(
|
|
849
|
+
logout_response: Response | httpx.HTTPError,
|
|
850
|
+
respx_mock: respx.MockRouter,
|
|
851
|
+
logged_in_cli: None,
|
|
852
|
+
temp_auth_config: Path,
|
|
853
|
+
settings: Settings,
|
|
854
|
+
) -> None:
|
|
855
|
+
_mock_device_login(
|
|
856
|
+
respx_mock, settings, Response(200, json={"access_token": "new_token"})
|
|
857
|
+
)
|
|
858
|
+
logout_route = respx_mock.post("/logout").mock(side_effect=[logout_response])
|
|
859
|
+
|
|
860
|
+
result = runner.invoke(app, ["login", "--no-open"])
|
|
861
|
+
|
|
862
|
+
assert result.exit_code == 0
|
|
863
|
+
assert "Now you are logged in!" in result.output
|
|
864
|
+
assert logout_route.call_count == 1
|
|
865
|
+
assert json.loads(temp_auth_config.read_text())["access_token"] == "new_token"
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
@pytest.mark.respx
|
|
869
|
+
def test_login_does_not_revoke_an_expired_login(
|
|
870
|
+
respx_mock: respx.MockRouter,
|
|
871
|
+
logged_in_with_expired_token: None,
|
|
872
|
+
temp_auth_config: Path,
|
|
873
|
+
settings: Settings,
|
|
874
|
+
) -> None:
|
|
875
|
+
# No /logout route: respx fails any request to it.
|
|
876
|
+
_mock_device_login(
|
|
877
|
+
respx_mock, settings, Response(200, json={"access_token": "new_token"})
|
|
878
|
+
)
|
|
879
|
+
|
|
880
|
+
result = runner.invoke(app, ["login", "--no-open"])
|
|
881
|
+
|
|
882
|
+
assert result.exit_code == 0
|
|
883
|
+
assert json.loads(temp_auth_config.read_text())["access_token"] == "new_token"
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
@pytest.mark.respx
|
|
887
|
+
def test_declined_login_keeps_the_saved_login(
|
|
888
|
+
respx_mock: respx.MockRouter,
|
|
889
|
+
logged_in_cli: None,
|
|
890
|
+
temp_auth_config: Path,
|
|
891
|
+
settings: Settings,
|
|
892
|
+
) -> None:
|
|
893
|
+
# No /logout route: respx fails any request to it.
|
|
894
|
+
_mock_device_login(
|
|
895
|
+
respx_mock, settings, Response(400, json={"error": "access_denied"})
|
|
896
|
+
)
|
|
897
|
+
|
|
898
|
+
result = runner.invoke(app, ["login", "--no-open"])
|
|
899
|
+
|
|
900
|
+
assert result.exit_code == 1
|
|
901
|
+
assert "Login authorization was declined." in result.output
|
|
902
|
+
assert json.loads(temp_auth_config.read_text())["access_token"] == USER_TOKEN
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
@pytest.mark.respx
|
|
906
|
+
def test_auth_wait_revokes_the_replaced_login(
|
|
907
|
+
respx_mock: respx.MockRouter,
|
|
908
|
+
logged_in_cli: None,
|
|
909
|
+
temp_auth_config: Path,
|
|
910
|
+
settings: Settings,
|
|
911
|
+
) -> None:
|
|
912
|
+
respx_mock.post(
|
|
913
|
+
"/login/device/token",
|
|
914
|
+
data={
|
|
915
|
+
"device_code": "5678",
|
|
916
|
+
"client_id": settings.client_id,
|
|
917
|
+
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
|
|
918
|
+
},
|
|
919
|
+
).respond(200, json={"access_token": "new_token"})
|
|
920
|
+
logout_route = respx_mock.post(
|
|
921
|
+
"/logout", headers={"Authorization": f"Bearer {USER_TOKEN}"}
|
|
922
|
+
).respond(204)
|
|
923
|
+
|
|
924
|
+
result = runner.invoke(
|
|
925
|
+
app, ["cloud", "auth", "wait", "--device-code", "5678", "--json"]
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
assert result.exit_code == 0
|
|
929
|
+
assert logout_route.call_count == 1
|
|
930
|
+
assert json.loads(temp_auth_config.read_text())["access_token"] == "new_token"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import
|
|
1
|
+
from datetime import UTC, datetime
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
import time_machine
|
|
@@ -6,7 +6,7 @@ import time_machine
|
|
|
6
6
|
from fastapi_cloud_cli.utils.dates import format_last_updated
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=
|
|
9
|
+
@time_machine.travel(datetime(2026, 5, 22, 12, 0, tzinfo=UTC), tick=False)
|
|
10
10
|
@pytest.mark.parametrize(
|
|
11
11
|
("updated_at", "expected"),
|
|
12
12
|
[
|
|
@@ -85,6 +85,7 @@ def test_includes_paths(path: Path) -> None:
|
|
|
85
85
|
(DeploymentStatus.verification_failed_oom, "Verification Failed (OOM)"),
|
|
86
86
|
(DeploymentStatus.verifying_skipped, "Verification Skipped"),
|
|
87
87
|
(DeploymentStatus.success, "Ready"),
|
|
88
|
+
(DeploymentStatus.scaled_to_zero, "Scaled to Zero"),
|
|
88
89
|
(DeploymentStatus.degraded_oom, "Degraded (OOM)"),
|
|
89
90
|
(DeploymentStatus.degraded, "Degraded"),
|
|
90
91
|
(DeploymentStatus.expired, "Expired"),
|