qontract-development-cli 0.17.1__tar.gz → 0.18.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 (29) hide show
  1. qontract_development_cli-0.18.0/.gitignore +2 -0
  2. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/PKG-INFO +3 -3
  3. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/pyproject.toml +13 -4
  4. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/commands/profile.py +2 -4
  5. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/models.py +3 -3
  6. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/shell.py +8 -4
  7. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/cache.yml.j2 +4 -3
  8. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/compose.override.yml.j2 +20 -13
  9. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/internal-redhat-ca.yml.j2 +1 -0
  10. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/vault.yml.j2 +1 -0
  11. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/watchdog.py +5 -2
  12. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/README.md +0 -0
  13. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/__init__.py +0 -0
  14. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/__main__.py +0 -0
  15. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/cli.py +0 -0
  16. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/commands/__init__.py +0 -0
  17. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/commands/config.py +0 -0
  18. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/commands/env.py +0 -0
  19. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/completions.py +0 -0
  20. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/config.py +0 -0
  21. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/api.yml.j2 +0 -0
  22. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/compose.yml.j2 +0 -0
  23. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/prep-worktree.sh.j2 +0 -0
  24. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/reconcile.yml.j2 +0 -0
  25. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/server.yml.j2 +0 -0
  26. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/subscriber.yml.j2 +0 -0
  27. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates/worker.yml.j2 +0 -0
  28. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/templates.py +0 -0
  29. {qontract_development_cli-0.17.1 → qontract_development_cli-0.18.0}/qontract_development_cli/utils.py +0 -0
@@ -0,0 +1,2 @@
1
+ # Created by venv; see https://docs.python.org/3/library/venv.html
2
+ *
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-development-cli
3
- Version: 0.17.1
3
+ Version: 0.18.0
4
4
  Summary: Helper tool for qontract-reconcile development
5
5
  Project-URL: homepage, http://github.com/chassing/qontract-development-cli
6
6
  Project-URL: repository, http://github.com/chassing/qontract-development-cli
7
7
  Project-URL: documentation, http://github.com/chassing/qontract-development-cli
8
8
  Author-email: Christian Assing <cassing@redhat.com>
9
9
  License: MIT
10
- Requires-Python: >=3.11
10
+ Requires-Python: >=3.14
11
11
  Requires-Dist: appdirs~=1.4.4
12
12
  Requires-Dist: getkey~=0.6.5
13
13
  Requires-Dist: jinja2~=3.1
@@ -16,7 +16,7 @@ Requires-Dist: pydantic~=2.9
16
16
  Requires-Dist: pyyaml~=6.0.2
17
17
  Requires-Dist: rich~=15.0
18
18
  Requires-Dist: typer~=0.25.1
19
- Requires-Dist: watchfiles~=1.1.0
19
+ Requires-Dist: watchfiles~=1.2.0
20
20
  Description-Content-Type: text/markdown
21
21
 
22
22
  # Qontract Development CLI
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "qontract-development-cli"
3
- version = "0.17.1"
3
+ version = "0.18.0"
4
4
  description = "Helper tool for qontract-reconcile development"
5
5
  authors = [{ name = "Christian Assing", email = "cassing@redhat.com" }]
6
6
  license = { text = "MIT" }
7
7
  readme = "README.md"
8
- requires-python = ">= 3.11"
8
+ requires-python = ">= 3.14"
9
9
  dependencies = [
10
10
  "appdirs ~=1.4.4",
11
11
  "getkey ~=0.6.5",
@@ -15,7 +15,7 @@ dependencies = [
15
15
  "pyyaml ~=6.0.2",
16
16
  "rich ~=15.0",
17
17
  "typer ~=0.25.1",
18
- "watchfiles ~=1.1.0",
18
+ "watchfiles ~=1.2.0",
19
19
  ]
20
20
 
21
21
  [dependency-groups]
@@ -61,7 +61,6 @@ ignore_missing_imports = true
61
61
 
62
62
  [tool.ruff]
63
63
  line-length = 88
64
- target-version = 'py311'
65
64
  src = ["qontract_development_cli"]
66
65
  extend-exclude = [".local", ".cache"]
67
66
  fix = true
@@ -109,3 +108,13 @@ preview = true
109
108
 
110
109
  [tool.ruff.lint.isort]
111
110
  known-first-party = ["qontract_development_cli"]
111
+
112
+ [tool.ruff.lint.flake8-type-checking]
113
+ runtime-evaluated-base-classes = ["pydantic.BaseModel"]
114
+ runtime-evaluated-decorators = [
115
+ "dataclasses.dataclass",
116
+ "pydantic.dataclasses.dataclass",
117
+ "pydantic.validate_call",
118
+ "typer.Typer.command",
119
+ "typer.Typer.callback",
120
+ ]
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
  import subprocess
3
3
  import tempfile
4
+ from multiprocessing import Process
4
5
  from pathlib import Path
5
- from typing import TYPE_CHECKING, Annotated
6
+ from typing import Annotated
6
7
 
7
8
  import typer
8
9
  from getkey import getkey
@@ -34,9 +35,6 @@ from ..shell import (
34
35
  from ..templates import template
35
36
  from ..utils import console
36
37
 
37
- if TYPE_CHECKING:
38
- from multiprocessing import Process
39
-
40
38
  app = typer.Typer()
41
39
  log = logging.getLogger(__name__)
42
40
 
@@ -66,7 +66,7 @@ class ProfileSettings(BaseModel):
66
66
  qontract_api_worker_debugger_port: int = 5680
67
67
 
68
68
  # cache
69
- cache_image: str = "redis:7-alpine"
69
+ cache_image: str = "valkey/valkey:8-alpine"
70
70
  cache_container_platform: str | None = None
71
71
  cache_compose_file: str = "cache.yml.j2"
72
72
 
@@ -149,7 +149,7 @@ class Base(BaseModel):
149
149
  default: bool = False
150
150
  root: ClassVar[Path]
151
151
 
152
- def __lt__(self, other: "Base") -> bool:
152
+ def __lt__(self, other: Base) -> bool:
153
153
  return self.name < other.name
154
154
 
155
155
  @model_validator(mode="after")
@@ -165,7 +165,7 @@ class Base(BaseModel):
165
165
  return p.with_suffix(".yml")
166
166
 
167
167
  @classmethod
168
- def list_all(cls) -> list["Base"]:
168
+ def list_all(cls) -> list[Base]:
169
169
  items = []
170
170
  for f in [f for f in list(cls.root.glob("**/*")) if f.is_file()]:
171
171
  items.append( # noqa: PERF401
@@ -5,15 +5,18 @@ import os
5
5
  import subprocess
6
6
  import sys
7
7
  import tempfile
8
- from multiprocessing import Process
9
8
  from pathlib import Path
10
9
  from shutil import which
11
- from typing import Any
10
+ from typing import TYPE_CHECKING, Any
12
11
 
13
- from .models import Profile
14
12
  from .templates import template
15
13
  from .utils import EndlessProcess, console
16
14
 
15
+ if TYPE_CHECKING:
16
+ from multiprocessing import Process
17
+
18
+ from .models import Profile
19
+
17
20
  log = logging.getLogger(__name__)
18
21
 
19
22
  _docker_compose_bin = (
@@ -101,7 +104,8 @@ def compose_stop_project(project_name: str) -> None:
101
104
  for p in compose_list_projects():
102
105
  if p["Name"] == project_name:
103
106
  subprocess.run(
104
- [*_docker_compose_bin, "-f", p["ConfigFiles"], "down"], check=True
107
+ [*_docker_compose_bin, "-f", p["ConfigFiles"].split(",")[0], "down"],
108
+ check=True,
105
109
  )
106
110
 
107
111
 
@@ -2,7 +2,6 @@ services:
2
2
  # Cache/Broker (Redis or Valkey compatible)
3
3
  cache:
4
4
  container_name: cache
5
- platform: {{ profile.settings.cache_container_platform or env.settings.container_platform }}
6
5
  image: {{ profile.settings.cache_image }}
7
6
 
8
7
  ports:
@@ -10,12 +9,14 @@ services:
10
9
 
11
10
  healthcheck:
12
11
  test: ["CMD", "redis-cli", "ping"]
12
+ start_period: 5s
13
+ start_interval: 0.1s
13
14
  interval: 5s
14
15
  timeout: 3s
15
16
  retries: 5
16
17
 
17
18
  volumes:
18
- - cache_data:/data
19
+ - cache_data_valkey:/data
19
20
 
20
21
  volumes:
21
- cache_data:
22
+ cache_data_valkey:
@@ -17,12 +17,15 @@ services:
17
17
  depends_on:
18
18
  cache:
19
19
  condition: service_healthy
20
+
21
+ links:
22
+ - cache
20
23
  {% endif %}
21
24
  {% endif %}
22
25
 
23
26
 
24
- {% if env.settings.run_qontract_api_worker %}
25
- qontract-api-worker:
27
+ {% if env.settings.run_qontract_api_subscriber %}
28
+ qontract-api-subscriber:
26
29
  networks:
27
30
  - qontract-development
28
31
 
@@ -30,9 +33,23 @@ services:
30
33
  depends_on:
31
34
  cache:
32
35
  condition: service_healthy
36
+
37
+ links:
38
+ - cache
33
39
  {% endif %}
40
+ {% endif %}
41
+
42
+
43
+ {% if env.settings.run_qontract_api_worker %}
44
+ qontract-api-worker:
45
+ networks:
46
+ - qontract-development
34
47
 
35
48
  {% if env.settings.run_cache %}
49
+ depends_on:
50
+ cache:
51
+ condition: service_healthy
52
+
36
53
  links:
37
54
  - cache
38
55
  {% endif %}
@@ -62,21 +79,11 @@ services:
62
79
  - pki-volume:/etc/pki:z
63
80
  {% endif %}
64
81
 
65
- {% if env.settings.run_qontract_api or env.settings.run_qontract_server or profile.settings.internal_redhat_ca %}
66
- depends_on:
67
- {% if env.settings.run_qontract_api %}
68
- qontract-api:
69
- condition: service_healthy
70
- {% endif %}
71
- {% if env.settings.run_qontract_server %}
72
- qontract-server:
73
- condition: service_healthy
74
- {% endif %}
75
82
  {% if profile.settings.internal_redhat_ca %}
83
+ depends_on:
76
84
  internal-certificates:
77
85
  condition: service_completed_successfully # Let the init container create the pki directory first
78
86
  {% endif %}
79
- {% endif %}
80
87
 
81
88
  {% if env.settings.run_qontract_server or env.settings.run_qontract_api or env.settings.run_vault %}
82
89
  links:
@@ -1,6 +1,7 @@
1
1
  services:
2
2
  internal-certificates:
3
3
  image: {{ profile.settings.internal_redhat_ca_image }}
4
+ pull_policy: daily
4
5
  container_name: internal-certificates
5
6
  platform: {{ profile.settings.internal_redhat_ca_container_platform or env.settings.container_platform }}
6
7
  command: |
@@ -3,6 +3,7 @@ services:
3
3
  container_name: vault
4
4
  platform: {{ profile.settings.vault_container_platform or env.settings.container_platform }}
5
5
  image: {{ profile.settings.vault_image }}
6
+ pull_policy: daily
6
7
  environment:
7
8
  - VAULT_ADDR=http://127.0.0.1:8200
8
9
  - VAULT_TOKEN=root
@@ -1,11 +1,14 @@
1
1
  import logging
2
- from collections.abc import Callable, Sequence
3
2
  from multiprocessing import Process
4
- from pathlib import Path
3
+ from typing import TYPE_CHECKING
5
4
 
6
5
  from rich.logging import RichHandler
7
6
  from watchfiles import Change, DefaultFilter, watch
8
7
 
8
+ if TYPE_CHECKING:
9
+ from collections.abc import Callable, Sequence
10
+ from pathlib import Path
11
+
9
12
  log = logging.getLogger(__name__)
10
13
 
11
14