shared-pre-deployment 0.1.0__tar.gz → 1.0.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.
Files changed (26) hide show
  1. shared_pre_deployment-1.0.0/.gitignore +19 -0
  2. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/PKG-INFO +1 -1
  3. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/pyproject.toml +1 -1
  4. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/release.py +2 -3
  5. shared_pre_deployment-1.0.0/src/shared_pre_deployment/__init__.py +55 -0
  6. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/cli.py +3 -6
  7. shared_pre_deployment-1.0.0/src/shared_pre_deployment/exceptions.py +26 -0
  8. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/src/shared_pre_deployment/runner.py +52 -7
  9. shared_pre_deployment-1.0.0/src/shared_pre_deployment/validators.py +514 -0
  10. shared_pre_deployment-1.0.0/tests/test_runner.py +527 -0
  11. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/uv.lock +1 -1
  12. shared_pre_deployment-0.1.0/.gitignore +0 -47
  13. shared_pre_deployment-0.1.0/src/shared_pre_deployment/__init__.py +0 -35
  14. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/__init__.py +0 -66
  15. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/callback.py +0 -76
  16. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/command.py +0 -106
  17. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/env.py +0 -64
  18. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/postgres.py +0 -97
  19. shared_pre_deployment-0.1.0/src/shared_pre_deployment/checks/redis.py +0 -95
  20. shared_pre_deployment-0.1.0/src/shared_pre_deployment/logging.py +0 -67
  21. shared_pre_deployment-0.1.0/tests/conftest.py +0 -49
  22. shared_pre_deployment-0.1.0/tests/test_checks.py +0 -237
  23. shared_pre_deployment-0.1.0/tests/test_cli.py +0 -68
  24. shared_pre_deployment-0.1.0/tests/test_logging.py +0 -58
  25. shared_pre_deployment-0.1.0/tests/test_runner.py +0 -96
  26. {shared_pre_deployment-0.1.0 → shared_pre_deployment-1.0.0}/README.md +0 -0
@@ -0,0 +1,19 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+
5
+ # Environments
6
+ .venv/
7
+ env/
8
+ venv/
9
+ ENV/
10
+
11
+ # Build artifacts
12
+ dist/
13
+ build/
14
+ *.egg-info/
15
+
16
+ # Pytest / coverage
17
+ .pytest_cache/
18
+ .coverage
19
+ htmlcov/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: shared-pre-deployment
3
- Version: 0.1.0
3
+ Version: 1.0.0
4
4
  Summary: A modular pre-deployment verification gate and orchestration runner for services.
5
5
  Author-email: Film Review Platform Engineering <dev@example.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "shared-pre-deployment"
7
- version = "0.1.0"
7
+ version = "1.0.0"
8
8
  description = "A modular pre-deployment verification gate and orchestration runner for services."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -95,9 +95,8 @@ def verify_artifacts() -> bool:
95
95
  "shared_pre_deployment/__init__.py",
96
96
  "shared_pre_deployment/runner.py",
97
97
  "shared_pre_deployment/cli.py",
98
- "shared_pre_deployment/checks/env.py",
99
- "shared_pre_deployment/checks/postgres.py",
100
- "shared_pre_deployment/checks/redis.py",
98
+ "shared_pre_deployment/validators.py",
99
+ "shared_pre_deployment/exceptions.py",
101
100
  ]
102
101
  for req in required_whl_files:
103
102
  if not any(req in n for n in names):
@@ -0,0 +1,55 @@
1
+ """
2
+ shared-pre-deployment: A modular pre-deployment verification gate and orchestration runner.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from .exceptions import (
8
+ ConfigurationError,
9
+ ConnectivityError,
10
+ PreDeploymentError,
11
+ ValidationError,
12
+ )
13
+ from .runner import Logger, PreDeploymentRunner
14
+ from .validators import (
15
+ BaseCheck,
16
+ CallbackCheck,
17
+ CallbackValidator,
18
+ CheckResult,
19
+ CheckStatus,
20
+ CommandCheck,
21
+ CommandValidator,
22
+ EnvCheck,
23
+ EnvValidator,
24
+ PostgresCheck,
25
+ PostgresValidator,
26
+ RedisCheck,
27
+ RedisValidator,
28
+ mask_url_password,
29
+ )
30
+
31
+ __version__ = "1.0.0"
32
+
33
+ __all__ = [
34
+ "__version__",
35
+ "BaseCheck",
36
+ "CheckResult",
37
+ "CheckStatus",
38
+ "CallbackCheck",
39
+ "CallbackValidator",
40
+ "CommandCheck",
41
+ "CommandValidator",
42
+ "EnvCheck",
43
+ "EnvValidator",
44
+ "PostgresCheck",
45
+ "PostgresValidator",
46
+ "RedisCheck",
47
+ "RedisValidator",
48
+ "Logger",
49
+ "mask_url_password",
50
+ "PreDeploymentRunner",
51
+ "PreDeploymentError",
52
+ "ValidationError",
53
+ "ConfigurationError",
54
+ "ConnectivityError",
55
+ ]
@@ -12,12 +12,9 @@ from typing import Optional, Sequence
12
12
 
13
13
  import click
14
14
 
15
- from shared_pre_deployment import __version__
16
- from shared_pre_deployment.checks.command import CommandCheck
17
- from shared_pre_deployment.checks.env import EnvCheck
18
- from shared_pre_deployment.checks.postgres import PostgresCheck
19
- from shared_pre_deployment.checks.redis import RedisCheck
20
- from shared_pre_deployment.runner import PreDeploymentRunner
15
+ from . import __version__
16
+ from .runner import PreDeploymentRunner
17
+ from .validators import CommandCheck, EnvCheck, PostgresCheck, RedisCheck
21
18
 
22
19
 
23
20
  def _load_env_file(path: Optional[str]) -> None:
@@ -0,0 +1,26 @@
1
+ """
2
+ Custom exceptions for shared-pre-deployment.
3
+ Provides standardized exception types for pre-deployment gate failures.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+
9
+ class PreDeploymentError(Exception):
10
+ """Base exception for all pre-deployment gate errors."""
11
+ pass
12
+
13
+
14
+ class ValidationError(PreDeploymentError):
15
+ """Raised or recorded when a validation check fails."""
16
+ pass
17
+
18
+
19
+ class ConfigurationError(PreDeploymentError):
20
+ """Raised when required environment configuration is missing or invalid."""
21
+ pass
22
+
23
+
24
+ class ConnectivityError(PreDeploymentError):
25
+ """Raised when an external service (PostgreSQL, Redis) is unreachable."""
26
+ pass
@@ -6,15 +6,60 @@ Coordinates check execution, formats log outputs, and manages exit statuses.
6
6
  from __future__ import annotations
7
7
 
8
8
  import asyncio
9
+ import sys
9
10
  from typing import Callable, Optional, Sequence
10
11
 
11
- from shared_pre_deployment.checks import BaseCheck, CheckResult, CheckStatus
12
- from shared_pre_deployment.checks.callback import CallbackCheck
13
- from shared_pre_deployment.checks.command import CommandCheck
14
- from shared_pre_deployment.checks.env import EnvCheck
15
- from shared_pre_deployment.checks.postgres import PostgresCheck
16
- from shared_pre_deployment.checks.redis import RedisCheck
17
- from shared_pre_deployment.logging import Logger
12
+ from .validators import (
13
+ BaseCheck,
14
+ CheckResult,
15
+ CheckStatus,
16
+ CallbackCheck,
17
+ CommandCheck,
18
+ EnvCheck,
19
+ PostgresCheck,
20
+ RedisCheck,
21
+ )
22
+
23
+
24
+ class Logger:
25
+ """Standard console logger formatting pre-deployment gate output."""
26
+
27
+ @staticmethod
28
+ def header(title: str) -> None:
29
+ border = "=" * max(65, len(title) + 4)
30
+ print(f"\n{border}")
31
+ print(f" {title}")
32
+ print(f"{border}\n")
33
+
34
+ @staticmethod
35
+ def info(msg: str) -> None:
36
+ print(f"[PRE-DEPLOYMENT] {msg}")
37
+
38
+ @staticmethod
39
+ def pass_(msg: str) -> None:
40
+ print(f"[PASS] {msg}")
41
+
42
+ @staticmethod
43
+ def fail(msg: str) -> None:
44
+ print(f"[FAIL] {msg}", file=sys.stderr)
45
+
46
+ @staticmethod
47
+ def warn(msg: str) -> None:
48
+ print(f"[WARN] {msg}")
49
+
50
+ @staticmethod
51
+ def summary_success(msg: str = "All pre-deployment safety gates passed successfully!") -> None:
52
+ border = "=" * 65
53
+ print(f"\n{border}")
54
+ print(f"[PASS] {msg}")
55
+ print(f"{border}\n")
56
+
57
+ @staticmethod
58
+ def summary_failure(failed_count: int, total_count: int) -> None:
59
+ border = "=" * 65
60
+ print(f"\n{border}", file=sys.stderr)
61
+ print(f"[FAIL] Pre-deployment verification failed: {failed_count}/{total_count} check(s) failed.", file=sys.stderr)
62
+ print(f"{border}\n", file=sys.stderr)
18
63
 
19
64
 
20
65
  class PreDeploymentRunner: