Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies = [
"rich-toolkit >= 0.14.5",
"pydantic[email] >= 1.6.1",
"sentry-sdk >= 2.20.0",
"fastar >= 0.5.0",
]

[project.optional-dependencies]
Expand Down
9 changes: 5 additions & 4 deletions src/fastapi_cloud_cli/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import json
import logging
import subprocess
import tarfile
import tempfile
import time
from enum import Enum
from itertools import cycle
from pathlib import Path
from typing import Any, Dict, Generator, List, Optional, Union

import fastar
import rignore
import typer
from httpx import Client
Expand Down Expand Up @@ -56,13 +56,14 @@ def archive(path: Path, tar_path: Path) -> Path:
logger.debug("Archive will be created at: %s", tar_path)

file_count = 0
with tarfile.open(tar_path, "w") as tar:
with fastar.open(tar_path, "w") as tar:
for filename in files:
if filename.is_dir():
continue

logger.debug("Adding %s to archive", filename.relative_to(path))
tar.add(filename, arcname=filename.relative_to(path))
arcname = filename.relative_to(path)
logger.debug("Adding %s to archive", arcname)
tar.append(filename, arcname=arcname)
file_count += 1

logger.debug("Archive created successfully with %s files", file_count)
Expand Down
Loading