bl-odoo 0.3.0__py3-none-any.whl → 0.3.1__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.
- bl/__main__.py +13 -9
- bl/spec_parser.py +16 -9
- bl/spec_processor.py +1 -0
- bl/utils.py +4 -2
- {bl_odoo-0.3.0.dist-info → bl_odoo-0.3.1.dist-info}/METADATA +1 -1
- bl_odoo-0.3.1.dist-info/RECORD +13 -0
- bl_odoo-0.3.0.dist-info/RECORD +0 -13
- {bl_odoo-0.3.0.dist-info → bl_odoo-0.3.1.dist-info}/WHEEL +0 -0
- {bl_odoo-0.3.0.dist-info → bl_odoo-0.3.1.dist-info}/entry_points.txt +0 -0
- {bl_odoo-0.3.0.dist-info → bl_odoo-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {bl_odoo-0.3.0.dist-info → bl_odoo-0.3.1.dist-info}/top_level.txt +0 -0
bl/__main__.py
CHANGED
|
@@ -12,15 +12,19 @@ def run():
|
|
|
12
12
|
parser = argparse.ArgumentParser(
|
|
13
13
|
description="Process a project specification.", formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
|
14
14
|
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parser.add_argument(
|
|
15
|
+
|
|
16
|
+
parent_parser = argparse.ArgumentParser(add_help=False)
|
|
17
|
+
parent_parser.add_argument(
|
|
19
18
|
"-c", "--config", type=Path, help="Path to the project specification file.", default="spec.yaml"
|
|
20
19
|
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
parent_parser.add_argument("-z", "--frozen", type=Path, help="Path to the frozen specification file.")
|
|
21
|
+
parent_parser.add_argument("-j", "--concurrency", type=int, default=28, help="Number of concurrent tasks.")
|
|
22
|
+
parent_parser.add_argument("-w", "--workdir", type=Path, help="Working directory. Defaults to config directory.")
|
|
23
|
+
|
|
24
|
+
sub = parser.add_subparsers(help="subcommand help", dest="command")
|
|
25
|
+
build = sub.add_parser("build", parents=[parent_parser], help="build help")
|
|
26
|
+
freeze = sub.add_parser("freeze", parents=[parent_parser], help="freeze help")
|
|
27
|
+
|
|
24
28
|
args = parser.parse_args()
|
|
25
29
|
|
|
26
30
|
project_spec = load_spec_file(args.config, args.frozen, args.workdir)
|
|
@@ -28,9 +32,9 @@ def run():
|
|
|
28
32
|
sys.exit(1)
|
|
29
33
|
|
|
30
34
|
try:
|
|
31
|
-
if args.freeze:
|
|
35
|
+
if args.command == "freeze":
|
|
32
36
|
asyncio.run(freeze_project(project_spec, args.freeze, concurrency=args.concurrency))
|
|
33
|
-
|
|
37
|
+
elif args.command == "build":
|
|
34
38
|
asyncio.run(process_project(project_spec, concurrency=args.concurrency))
|
|
35
39
|
except Exception:
|
|
36
40
|
sys.exit(1)
|
bl/spec_parser.py
CHANGED
|
@@ -3,7 +3,7 @@ import warnings
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any, Dict, List, Optional
|
|
6
|
+
from typing import Any, Dict, List, Optional, Type
|
|
7
7
|
|
|
8
8
|
import yaml
|
|
9
9
|
|
|
@@ -69,6 +69,13 @@ def parse_remote_refspec_from_parts(parts: List[str], frozen_repo: Dict[str, Dic
|
|
|
69
69
|
return RefspecInfo(remote_key, ref_spec, ref_type, ref_name)
|
|
70
70
|
|
|
71
71
|
|
|
72
|
+
def get_with_syntax_check(name, data, key: str, type: Type):
|
|
73
|
+
result = data.get(key, type())
|
|
74
|
+
if not isinstance(result, type):
|
|
75
|
+
raise Exception(f"Key {key} not of proper syntax should be {str(type)} in {name} description")
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
72
79
|
def load_spec_file(config: Path, frozen: Path, workdir: Path) -> Optional[ProjectSpec]:
|
|
73
80
|
"""
|
|
74
81
|
Loads and parses the project specification from a YAML file.
|
|
@@ -115,14 +122,14 @@ def load_spec_file(config: Path, frozen: Path, workdir: Path) -> Optional[Projec
|
|
|
115
122
|
|
|
116
123
|
repos: Dict[str, RepoInfo] = {}
|
|
117
124
|
for repo_name, repo_data in data.items():
|
|
118
|
-
modules = repo_data
|
|
119
|
-
src = repo_data
|
|
120
|
-
remotes = repo_data
|
|
121
|
-
merges = repo_data
|
|
122
|
-
shell_commands = repo_data
|
|
123
|
-
patch_globs_to_apply = repo_data
|
|
124
|
-
target_folder = repo_data
|
|
125
|
-
locales = repo_data
|
|
125
|
+
modules = get_with_syntax_check(repo_name, repo_data, "modules", list)
|
|
126
|
+
src = get_with_syntax_check(repo_name, repo_data, "src", str)
|
|
127
|
+
remotes = get_with_syntax_check(repo_name, repo_data, "remotes", dict)
|
|
128
|
+
merges = get_with_syntax_check(repo_name, repo_data, "merges", list)
|
|
129
|
+
shell_commands = get_with_syntax_check(repo_name, repo_data, "shell_command_after", list)
|
|
130
|
+
patch_globs_to_apply = get_with_syntax_check(repo_name, repo_data, "patch_globs", list)
|
|
131
|
+
target_folder = get_with_syntax_check(repo_name, repo_data, "target_folder", str)
|
|
132
|
+
locales = get_with_syntax_check(repo_name, repo_data, "locales", list)
|
|
126
133
|
|
|
127
134
|
frozen_repo = frozen_mapping.get(repo_name, {})
|
|
128
135
|
|
bl/spec_processor.py
CHANGED
|
@@ -4,6 +4,7 @@ import warnings
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from typing import Dict, List
|
|
6
6
|
|
|
7
|
+
from rich import progress
|
|
7
8
|
from rich.console import Console
|
|
8
9
|
from rich.live import Live
|
|
9
10
|
from rich.progress import BarColumn, MofNCompleteColumn, Progress, SpinnerColumn, TaskID, TextColumn
|
bl/utils.py
CHANGED
|
@@ -14,14 +14,14 @@ english_env["LANG"] = "en_US.UTF-8"
|
|
|
14
14
|
|
|
15
15
|
def get_module_path(workdir: Path, module_name: str, module_spec: RepoInfo) -> Path:
|
|
16
16
|
"""Returns the path to the module directory."""
|
|
17
|
-
if module_name == "odoo" and module_spec.target_folder
|
|
17
|
+
if module_name == "odoo" and not module_spec.target_folder:
|
|
18
18
|
warnings.warn(
|
|
19
19
|
"importing 'odoo' without a 'target_folder' "
|
|
20
20
|
+ "property is deprecated. Use target_folder: 'src/' in spec.yaml.",
|
|
21
21
|
DeprecationWarning,
|
|
22
22
|
)
|
|
23
23
|
return workdir / "src/"
|
|
24
|
-
elif module_spec.target_folder
|
|
24
|
+
elif module_spec.target_folder:
|
|
25
25
|
return workdir / module_spec.target_folder
|
|
26
26
|
else:
|
|
27
27
|
return workdir / "external-src" / module_name
|
|
@@ -36,6 +36,8 @@ async def run_git(*args: str, cwd: Optional[Path] = None) -> tuple[int, str, str
|
|
|
36
36
|
"""Executes a git command asynchronously."""
|
|
37
37
|
proc = await asyncio.create_subprocess_exec(
|
|
38
38
|
"git",
|
|
39
|
+
"--git-dir",
|
|
40
|
+
".git/",
|
|
39
41
|
*args,
|
|
40
42
|
stdout=asyncio.subprocess.PIPE,
|
|
41
43
|
stderr=asyncio.subprocess.PIPE,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
bl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
bl/__main__.py,sha256=ypl02Cl-9NF9823xjdHVQa3aA9lHtnKAJFrtwmP9vbc,1643
|
|
3
|
+
bl/freezer.py,sha256=wUYNd0zKU-0OGdIXSLJol-_xJmxSSkXvzV_VbF2HJyg,2512
|
|
4
|
+
bl/spec_parser.py,sha256=dVvaK4fhtut5_vI3sm7g5oGk0hc_vFAvDfnVDVTf_64,5457
|
|
5
|
+
bl/spec_processor.py,sha256=KsgNX-IAizLZ_22WcFKJAeCJKd98clDZb4qQ0kclqOs,17893
|
|
6
|
+
bl/types.py,sha256=h14FXDVCrYRxY7lYTEu8jhdrEHr1PvSNyZRIHm33CTk,2158
|
|
7
|
+
bl/utils.py,sha256=ZAdvXjNqDhICoZU8IZ5QQnmA5ILdYFbjaEeieyuo2GI,1622
|
|
8
|
+
bl_odoo-0.3.1.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
|
|
9
|
+
bl_odoo-0.3.1.dist-info/METADATA,sha256=6-dmdSbQqzfSmhA-wbIer6Pj36rtRretVUQ88TFSzIA,391
|
|
10
|
+
bl_odoo-0.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
+
bl_odoo-0.3.1.dist-info/entry_points.txt,sha256=fmdGhYYJlP-XByamgaZdM0bo3JK4LJFswU_Nilq6SSw,39
|
|
12
|
+
bl_odoo-0.3.1.dist-info/top_level.txt,sha256=1o4tN3wszdw7U5SnGgdF5P2sTYA0Schf0vKFy9_2D6A,3
|
|
13
|
+
bl_odoo-0.3.1.dist-info/RECORD,,
|
bl_odoo-0.3.0.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
bl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
bl/__main__.py,sha256=v1d-voJ7N1QBLGJJh8JdrTxXtzf0JFHQv4RUBxlCkcg,1428
|
|
3
|
-
bl/freezer.py,sha256=wUYNd0zKU-0OGdIXSLJol-_xJmxSSkXvzV_VbF2HJyg,2512
|
|
4
|
-
bl/spec_parser.py,sha256=nZTwMh_ja4Mc7CKqB7-5cwECHrP15xd1S8zb_LW79BU,4953
|
|
5
|
-
bl/spec_processor.py,sha256=yejkFFig_Yfbv1Ail1xTpteFv-f7dE7gasF_YU1oTXs,17867
|
|
6
|
-
bl/types.py,sha256=h14FXDVCrYRxY7lYTEu8jhdrEHr1PvSNyZRIHm33CTk,2158
|
|
7
|
-
bl/utils.py,sha256=JNLsxgJgWaa71Xs62gcoOwJnPjNHkrW0q9HFB0vQ60E,1600
|
|
8
|
-
bl_odoo-0.3.0.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
|
|
9
|
-
bl_odoo-0.3.0.dist-info/METADATA,sha256=VRKm91QHoxE_y5hSphmULSNRdjzvyvcSfBbQ5iRwafs,391
|
|
10
|
-
bl_odoo-0.3.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
-
bl_odoo-0.3.0.dist-info/entry_points.txt,sha256=fmdGhYYJlP-XByamgaZdM0bo3JK4LJFswU_Nilq6SSw,39
|
|
12
|
-
bl_odoo-0.3.0.dist-info/top_level.txt,sha256=1o4tN3wszdw7U5SnGgdF5P2sTYA0Schf0vKFy9_2D6A,3
|
|
13
|
-
bl_odoo-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|