odoo-plugin-manager 0.2.3__tar.gz → 0.2.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.
Files changed (25) hide show
  1. {odoo_plugin_manager-0.2.3/src/odoo_plugin_manager.egg-info → odoo_plugin_manager-0.2.4}/PKG-INFO +1 -1
  2. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/pyproject.toml +1 -1
  3. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4/src/odoo_plugin_manager.egg-info}/PKG-INFO +1 -1
  4. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/cli/commands/test.py +35 -0
  5. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/LICENSE +0 -0
  6. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/MANIFEST.in +0 -0
  7. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/README.md +0 -0
  8. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/opm.example.yaml +0 -0
  9. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/setup.cfg +0 -0
  10. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/odoo_plugin_manager.egg-info/SOURCES.txt +0 -0
  11. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/odoo_plugin_manager.egg-info/dependency_links.txt +0 -0
  12. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/odoo_plugin_manager.egg-info/entry_points.txt +0 -0
  13. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/odoo_plugin_manager.egg-info/requires.txt +0 -0
  14. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/odoo_plugin_manager.egg-info/top_level.txt +0 -0
  15. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/__init__.py +0 -0
  16. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/cli/__main__.py +0 -0
  17. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/cli/commands/dev.py +0 -0
  18. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/cli/commands/diagnose.py +0 -0
  19. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/cli/commands/init.py +0 -0
  20. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/docker.py +0 -0
  21. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/env.py +0 -0
  22. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/env_cmds.py +0 -0
  23. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/odoo_rpc.py +0 -0
  24. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/state.py +0 -0
  25. {odoo_plugin_manager-0.2.3 → odoo_plugin_manager-0.2.4}/src/opm/core/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-plugin-manager
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: OPM - Plugin Manager for Odoo (CLI)
5
5
  Author: Ahmet Atakan
6
6
  License-Expression: GPL-3.0-or-later
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "odoo-plugin-manager"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "OPM - Plugin Manager for Odoo (CLI)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-plugin-manager
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: OPM - Plugin Manager for Odoo (CLI)
5
5
  Author: Ahmet Atakan
6
6
  License-Expression: GPL-3.0-or-later
@@ -10,6 +10,20 @@ import time
10
10
  from ...core.env import load_config
11
11
  from ...core.utils import info, run
12
12
 
13
+ def _module_exists_on_host(module: str, host_addons: str | None) -> bool:
14
+ if not host_addons:
15
+ return False
16
+ p = Path(host_addons).expanduser().resolve() / module
17
+ return p.is_dir()
18
+
19
+ def _module_exists_in_container(module: str, container: str) -> bool:
20
+ # /mnt/extra-addons altında var mı?
21
+ code, out, _ = run([
22
+ "bash", "-lc",
23
+ f"docker exec -i {shlex.quote(container)} sh -lc '[ -d /mnt/extra-addons/{shlex.quote(module)} ] && echo OK || true'"
24
+ ])
25
+ return (code == 0) and ("OK" in (out or ""))
26
+
13
27
  def test(
14
28
  module: str = typer.Argument(..., help="Module name (e.g. opm_dev_helper)"),
15
29
  db: str = typer.Option(None, "--db", "-d", help="Database name (fallback: runtime.db)"),
@@ -50,6 +64,27 @@ def test(
50
64
 
51
65
  info(f"[opm] Host addons: {host_addons or '(not provided)'}")
52
66
 
67
+ # --- preflight module existence check ---
68
+ found_locally = _module_exists_on_host(module, host_addons)
69
+ found_in_container = False
70
+ if container:
71
+ try:
72
+ found_in_container = _module_exists_in_container(module, container)
73
+ except Exception:
74
+ found_in_container = False
75
+
76
+ if not (found_locally or found_in_container):
77
+ info(
78
+ f"❌ Module '{module}' not found under any addons path.\n"
79
+ f" Checked host: {host_addons or '(unset)'}\n"
80
+ f" Checked container: /mnt/extra-addons/{module} (container={container or 'N/A'})\n"
81
+ f" Hints:\n"
82
+ f" • Ensure runtime.addons points to the folder that contains '{module}/'.\n"
83
+ f" • If running in Docker, bind-mount that folder to /mnt/extra-addons.\n"
84
+ f" • Or pass --addons /path/to/addons explicitly."
85
+ )
86
+ raise typer.Exit(2)
87
+
53
88
  # Build addons-path (inside container)
54
89
  addons_path = "/usr/lib/python3/dist-packages/odoo/addons"
55
90
  if host_addons: