abstract.py 951 B

1234567891011121314151617181920212223242526272829
  1. """Abstract base class for environments."""
  2. from abc import ABC, abstractmethod
  3. class AbstractEnvironment(ABC):
  4. """Abstract base class for environments."""
  5. region: str
  6. @abstractmethod
  7. async def verify(self) -> None:
  8. """Verify that the environment is configured correctly."""
  9. raise NotImplementedError
  10. @abstractmethod
  11. async def upload_file(self, source: str, destination: str) -> None:
  12. """Upload a file from the local filesystem to storage in the environment."""
  13. raise NotImplementedError
  14. @abstractmethod
  15. async def upload_dir(self, source: str, destination: str) -> None:
  16. """Upload the contents of a directory from the local filesystem to the environment."""
  17. raise NotImplementedError
  18. @abstractmethod
  19. async def verify_storage_uri(self, uri: str) -> None:
  20. """Verify that the storage URI is configured correctly."""
  21. raise NotImplementedError