compose2pod 0.1.2__tar.gz → 0.1.4__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.
- {compose2pod-0.1.2 → compose2pod-0.1.4}/PKG-INFO +13 -1
- {compose2pod-0.1.2 → compose2pod-0.1.4}/README.md +12 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/emit.py +4 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/graph.py +4 -1
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/parsing.py +7 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/pyproject.toml +1 -1
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/__init__.py +0 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/__main__.py +0 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/cli.py +0 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/exceptions.py +0 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/healthcheck.py +0 -0
- {compose2pod-0.1.2 → compose2pod-0.1.4}/compose2pod/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: compose2pod
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Convert a Docker Compose file into a script that runs its services as a single Podman pod
|
|
5
5
|
Keywords: podman,docker-compose,compose,pod,ci,testing,containers
|
|
6
6
|
Author: Artur Shiriev
|
|
@@ -26,6 +26,18 @@ Description-Content-Type: text/markdown
|
|
|
26
26
|
|
|
27
27
|
# compose2pod
|
|
28
28
|
|
|
29
|
+
[](https://pypi.org/project/compose2pod/)
|
|
30
|
+
[](https://pypi.org/project/compose2pod/)
|
|
31
|
+
[](https://pepy.tech/projects/compose2pod)
|
|
32
|
+
[](https://github.com/modern-python/compose2pod/actions/workflows/ci.yml)
|
|
33
|
+
[](https://github.com/modern-python/compose2pod/actions/workflows/ci.yml)
|
|
34
|
+
[](https://github.com/modern-python/compose2pod/blob/main/LICENSE)
|
|
35
|
+
[](https://github.com/modern-python/compose2pod/stargazers)
|
|
36
|
+
[](https://context7.com/modern-python/compose2pod)
|
|
37
|
+
[](https://github.com/astral-sh/uv)
|
|
38
|
+
[](https://github.com/astral-sh/ruff)
|
|
39
|
+
[](https://github.com/astral-sh/ty)
|
|
40
|
+
|
|
29
41
|
Convert a Docker Compose file into a POSIX `sh` script that runs its services as a **single Podman pod**.
|
|
30
42
|
|
|
31
43
|
Built for CI and test environments where you can't use `docker compose` or `podman kube play`:
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# compose2pod
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/compose2pod/)
|
|
4
|
+
[](https://pypi.org/project/compose2pod/)
|
|
5
|
+
[](https://pepy.tech/projects/compose2pod)
|
|
6
|
+
[](https://github.com/modern-python/compose2pod/actions/workflows/ci.yml)
|
|
7
|
+
[](https://github.com/modern-python/compose2pod/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/modern-python/compose2pod/blob/main/LICENSE)
|
|
9
|
+
[](https://github.com/modern-python/compose2pod/stargazers)
|
|
10
|
+
[](https://context7.com/modern-python/compose2pod)
|
|
11
|
+
[](https://github.com/astral-sh/uv)
|
|
12
|
+
[](https://github.com/astral-sh/ruff)
|
|
13
|
+
[](https://github.com/astral-sh/ty)
|
|
14
|
+
|
|
3
15
|
Convert a Docker Compose file into a POSIX `sh` script that runs its services as a **single Podman pod**.
|
|
4
16
|
|
|
5
17
|
Built for CI and test environments where you can't use `docker compose` or `podman kube play`:
|
|
@@ -57,6 +57,10 @@ def run_flags(name: str, svc: dict[str, Any], pod: str, hosts: list[str], projec
|
|
|
57
57
|
for env_file in env_files:
|
|
58
58
|
flags += ["--env-file", str(Path(project_dir, env_file))]
|
|
59
59
|
for volume in svc.get("volumes") or []:
|
|
60
|
+
if ":" not in volume:
|
|
61
|
+
# Anonymous volume: a bare container path, no host source to translate.
|
|
62
|
+
flags += ["-v", volume]
|
|
63
|
+
continue
|
|
60
64
|
source, destination = volume.split(":", 1)
|
|
61
65
|
if not source.startswith("/"):
|
|
62
66
|
source = str(Path(project_dir, source))
|
|
@@ -14,12 +14,15 @@ def depends_on(svc: dict[str, Any]) -> dict[str, str]:
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def hostnames(services: dict[str, Any]) -> list[str]:
|
|
17
|
-
"""All names other services may use to reach a service: names, hostnames, then aliases."""
|
|
17
|
+
"""All names other services may use to reach a service: names, hostnames/container names, then aliases."""
|
|
18
18
|
names = list(services)
|
|
19
19
|
for svc in services.values():
|
|
20
20
|
hostname = svc.get("hostname")
|
|
21
21
|
if hostname:
|
|
22
22
|
names.append(hostname)
|
|
23
|
+
container_name = svc.get("container_name")
|
|
24
|
+
if container_name:
|
|
25
|
+
names.append(container_name)
|
|
23
26
|
networks = svc.get("networks")
|
|
24
27
|
if isinstance(networks, dict):
|
|
25
28
|
for network in networks.values():
|
|
@@ -18,6 +18,7 @@ SUPPORTED_SERVICE_KEYS = {
|
|
|
18
18
|
"depends_on",
|
|
19
19
|
"networks",
|
|
20
20
|
"hostname",
|
|
21
|
+
"container_name",
|
|
21
22
|
}
|
|
22
23
|
IGNORED_SERVICE_KEYS = {"ports", "restart", "stdin_open", "tty"}
|
|
23
24
|
SUPPORTED_HEALTHCHECK_KEYS = {"test", "interval", "timeout", "retries", "start_period"}
|
|
@@ -41,6 +42,12 @@ def _validate_service_volumes(name: str, svc: dict[str, Any]) -> None:
|
|
|
41
42
|
if not isinstance(volume, str):
|
|
42
43
|
msg = f"service {name!r}: only short volume syntax is supported"
|
|
43
44
|
raise UnsupportedComposeError(msg)
|
|
45
|
+
if ":" not in volume:
|
|
46
|
+
# Anonymous volume: must be an absolute container path.
|
|
47
|
+
if not volume.startswith("/"):
|
|
48
|
+
msg = f"service {name!r}: anonymous volume '{volume}' must be an absolute path"
|
|
49
|
+
raise UnsupportedComposeError(msg)
|
|
50
|
+
continue
|
|
44
51
|
source = volume.split(":", 1)[0]
|
|
45
52
|
if not source.startswith((".", "/")):
|
|
46
53
|
msg = f"service {name!r}: named volume '{source}' is not supported (bind mounts only)"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|