odoo-dev 0.2.2__py3-none-any.whl → 0.2.4__py3-none-any.whl
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.
- odoo_dev/__init__.py +1 -1
- odoo_dev/commands/setup.py +45 -8
- {odoo_dev-0.2.2.dist-info → odoo_dev-0.2.4.dist-info}/METADATA +3 -2
- {odoo_dev-0.2.2.dist-info → odoo_dev-0.2.4.dist-info}/RECORD +6 -6
- {odoo_dev-0.2.2.dist-info → odoo_dev-0.2.4.dist-info}/WHEEL +0 -0
- {odoo_dev-0.2.2.dist-info → odoo_dev-0.2.4.dist-info}/entry_points.txt +0 -0
odoo_dev/__init__.py
CHANGED
odoo_dev/commands/setup.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Setup commands for initializing Odoo development environment."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import shutil
|
|
4
5
|
import subprocess
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
|
|
@@ -75,12 +76,27 @@ def _update_env_file(env_file: Path, updates: dict[str, str]) -> None:
|
|
|
75
76
|
env_file.write_text(content + "\n")
|
|
76
77
|
|
|
77
78
|
|
|
79
|
+
def _clean():
|
|
80
|
+
cfg = load_config()
|
|
81
|
+
success("Cleaning up current environment...")
|
|
82
|
+
for name in ["odoo", "enterprise", "design-themes", "industry", ".venv"]:
|
|
83
|
+
path = cfg.project_dir / name
|
|
84
|
+
if path.exists():
|
|
85
|
+
shutil.rmtree(path)
|
|
86
|
+
success("Clean up complete.")
|
|
87
|
+
|
|
88
|
+
|
|
78
89
|
def setup(
|
|
79
90
|
community: bool = typer.Option(
|
|
80
91
|
False,
|
|
81
92
|
"--community",
|
|
82
93
|
help="Set up Community edition only (skip Enterprise repos)",
|
|
83
94
|
),
|
|
95
|
+
clean: bool = typer.Option(
|
|
96
|
+
False,
|
|
97
|
+
"--clean",
|
|
98
|
+
help="Clean up before setup (remove existing venv, etc.)",
|
|
99
|
+
),
|
|
84
100
|
) -> None:
|
|
85
101
|
"""Complete setup: clone Odoo repos, configure VSCode, build image."""
|
|
86
102
|
# Prompt for versions if not configured
|
|
@@ -88,6 +104,8 @@ def setup(
|
|
|
88
104
|
|
|
89
105
|
cfg = load_config()
|
|
90
106
|
|
|
107
|
+
if clean:
|
|
108
|
+
_clean()
|
|
91
109
|
success("Setting up complete Odoo development environment...")
|
|
92
110
|
|
|
93
111
|
# Initialize/update git submodules first
|
|
@@ -305,22 +323,25 @@ def _clone_odoo_repos(cfg, community_only: bool = False) -> None:
|
|
|
305
323
|
if community_only:
|
|
306
324
|
warning("Community edition mode: Enterprise repositories will be skipped")
|
|
307
325
|
|
|
326
|
+
# Use HTTPS for odoo (public), SSH for all others (private)
|
|
308
327
|
repos = [
|
|
309
|
-
(
|
|
310
|
-
(f"git@github.com:odoo/design-themes.git", "design-themes", cfg.odoo_version),
|
|
328
|
+
("https://github.com/odoo/odoo.git", "odoo", cfg.odoo_version),
|
|
311
329
|
]
|
|
312
330
|
|
|
313
|
-
#
|
|
331
|
+
# Private repos require SSH
|
|
332
|
+
repos.append(
|
|
333
|
+
("git@github.com:odoo/design-themes.git", "design-themes", cfg.odoo_version)
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
# Add enterprise if not community only (private repo, needs SSH)
|
|
314
337
|
if not community_only:
|
|
315
338
|
repos.append(
|
|
316
|
-
(
|
|
339
|
+
("git@github.com:odoo/enterprise.git", "enterprise", cfg.odoo_version)
|
|
317
340
|
)
|
|
318
341
|
|
|
319
|
-
# Add industry for Odoo 18+
|
|
342
|
+
# Add industry for Odoo 18+ (private repo)
|
|
320
343
|
if cfg.odoo_version.startswith("18") or cfg.odoo_version.startswith("19"):
|
|
321
|
-
repos.append(
|
|
322
|
-
(f"git@github.com:odoo/industry.git", "industry", cfg.odoo_version)
|
|
323
|
-
)
|
|
344
|
+
repos.append(("git@github.com:odoo/industry.git", "industry", cfg.odoo_version))
|
|
324
345
|
|
|
325
346
|
for repo_url, repo_dir, branch in repos:
|
|
326
347
|
repo_path = cfg.project_dir / repo_dir
|
|
@@ -355,6 +376,15 @@ def _clone_odoo_repos(cfg, community_only: bool = False) -> None:
|
|
|
355
376
|
success("Odoo repositories setup complete.")
|
|
356
377
|
|
|
357
378
|
|
|
379
|
+
def _can_sudo_without_password() -> bool:
|
|
380
|
+
"""Check if sudo can run without prompting for password."""
|
|
381
|
+
result = subprocess.run(
|
|
382
|
+
["sudo", "-n", "true"],
|
|
383
|
+
capture_output=True,
|
|
384
|
+
)
|
|
385
|
+
return result.returncode == 0
|
|
386
|
+
|
|
387
|
+
|
|
358
388
|
def _install_system_dependencies() -> None:
|
|
359
389
|
"""Install system dependencies based on OS."""
|
|
360
390
|
import platform
|
|
@@ -376,6 +406,13 @@ def _install_system_dependencies() -> None:
|
|
|
376
406
|
check=False,
|
|
377
407
|
)
|
|
378
408
|
elif system == "Linux":
|
|
409
|
+
if not _can_sudo_without_password():
|
|
410
|
+
warning(
|
|
411
|
+
"Cannot run sudo without password. "
|
|
412
|
+
"Please install system dependencies manually or run with sudo."
|
|
413
|
+
)
|
|
414
|
+
return
|
|
415
|
+
|
|
379
416
|
success("Installing dependencies for Linux...")
|
|
380
417
|
subprocess.run(
|
|
381
418
|
[
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-dev
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Odoo Development Environment Helper
|
|
5
5
|
Project-URL: Homepage, https://git.bemade.org/bemade/odoo-dev
|
|
6
6
|
Project-URL: Repository, https://git.bemade.org/bemade/odoo-dev
|
|
7
7
|
Project-URL: Issues, https://git.bemade.org/bemade/odoo-dev/-/issues
|
|
8
|
+
License-Expression: LGPL-3.0
|
|
8
9
|
Requires-Python: >=3.12
|
|
9
10
|
Requires-Dist: rich>=13.0.0
|
|
10
11
|
Requires-Dist: typer>=0.9.0
|
|
@@ -133,4 +134,4 @@ uv build
|
|
|
133
134
|
|
|
134
135
|
## License
|
|
135
136
|
|
|
136
|
-
|
|
137
|
+
LGPL-3. For complete license terms, visit https://www.gnu.org/licenses/lgpl-3.0.en.html
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
odoo_dev/__init__.py,sha256=
|
|
1
|
+
odoo_dev/__init__.py,sha256=LQnKjAyQAt2lL6PzS-n6zROczZe6nmwAn8MS8_WWbxo,66
|
|
2
2
|
odoo_dev/cli.py,sha256=2KdvrUNka57MWN9W98SHScG_PsY1ENKqleTPwcnyW3Q,1199
|
|
3
3
|
odoo_dev/config.py,sha256=tZ_aDAsHeDSFs6fLwdn974UzTIPAR3DHBLmdvO4jyeM,2977
|
|
4
4
|
odoo_dev/commands/__init__.py,sha256=yOxitS1Oes2ZS95F0nXyw3LDOBXCFWmudZInYbTu1eQ,33
|
|
5
5
|
odoo_dev/commands/db.py,sha256=7DnI28y2YpugnjoMkyTYymLMZ5MjNagfD6T15RWvZ0c,9605
|
|
6
6
|
odoo_dev/commands/docker.py,sha256=I5dvxRX4uHzwBwTM7d7yhMphge8fdKoqjXCKo_-7FQw,5386
|
|
7
7
|
odoo_dev/commands/run.py,sha256=FPi_rIyMOWadZfMPin0TXHbdBcW1YIuqUseBEhr4PnE,11882
|
|
8
|
-
odoo_dev/commands/setup.py,sha256=
|
|
8
|
+
odoo_dev/commands/setup.py,sha256=ffECQ8ADnj2CrdI7aV-NgBimopoqGDK7Dg-2mUAu_zQ,14459
|
|
9
9
|
odoo_dev/utils/__init__.py,sha256=EDPdElYZN3cPJtZIkNjXFoItz1mPBPUsasQzb6mRrss,36
|
|
10
10
|
odoo_dev/utils/console.py,sha256=bRbXVD15QiMhdU8Rp4cyaoA1-J8vFX8r16TwsYurUug,549
|
|
11
|
-
odoo_dev-0.2.
|
|
12
|
-
odoo_dev-0.2.
|
|
13
|
-
odoo_dev-0.2.
|
|
14
|
-
odoo_dev-0.2.
|
|
11
|
+
odoo_dev-0.2.4.dist-info/METADATA,sha256=uU3E3Lg5HElnAaf7iqQo7zy3uv0LbGYovrM-zVNWWwc,3463
|
|
12
|
+
odoo_dev-0.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
odoo_dev-0.2.4.dist-info/entry_points.txt,sha256=EKJCgGArQtoRNYRBRcbkRfIXO_APFkYujr2u8-UCfXo,46
|
|
14
|
+
odoo_dev-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|