bl-odoo 0.3.1__py3-none-any.whl → 0.3.2__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 CHANGED
@@ -33,7 +33,7 @@ def run():
33
33
 
34
34
  try:
35
35
  if args.command == "freeze":
36
- asyncio.run(freeze_project(project_spec, args.freeze, concurrency=args.concurrency))
36
+ asyncio.run(freeze_project(project_spec, args.frozen, concurrency=args.concurrency))
37
37
  elif args.command == "build":
38
38
  asyncio.run(process_project(project_spec, concurrency=args.concurrency))
39
39
  except Exception:
bl/freezer.py CHANGED
@@ -40,7 +40,7 @@ async def freeze_spec(
40
40
  async def freeze_project(project_spec: ProjectSpec, freeze_file: Path | bool, concurrency: int):
41
41
  frz_semaphore = asyncio.Semaphore(concurrency)
42
42
  workdir = project_spec.workdir
43
- freeze_file_name = freeze_file if freeze_file is not True else "frozen.yaml"
43
+ freeze_file_name = freeze_file if freeze_file else "frozen.yaml"
44
44
  freeze_file_path = workdir / freeze_file_name
45
45
 
46
46
  task_count_progress = Progress(
@@ -49,14 +49,14 @@ async def freeze_project(project_spec: ProjectSpec, freeze_file: Path | bool, co
49
49
  MofNCompleteColumn(),
50
50
  )
51
51
  count_task = task_count_progress.add_task(
52
- f"Freezing modules into {freeze_file_path}", total=len(project_spec.specs)
52
+ f"Freezing modules into {freeze_file_path}", total=len(project_spec.repos)
53
53
  )
54
54
 
55
55
  freeze_data = {}
56
56
 
57
57
  with Live(task_count_progress, console=console, refresh_per_second=10):
58
58
  task_list = []
59
- for name, spec in project_spec.specs.items():
59
+ for name, spec in project_spec.repos.items():
60
60
  task_list.append(
61
61
  freeze_spec(
62
62
  frz_semaphore,
@@ -71,7 +71,6 @@ async def freeze_project(project_spec: ProjectSpec, freeze_file: Path | bool, co
71
71
  for item in freeze_list:
72
72
  freeze_data.update(item)
73
73
 
74
- console.print(yaml.dump(freeze_data, default_flow_style=False))
75
74
  with open(freeze_file_path, "w") as freeze_stream:
76
75
  yaml.dump(freeze_data, freeze_stream, default_flow_style=False)
77
76
 
bl/utils.py CHANGED
@@ -29,7 +29,7 @@ def get_module_path(workdir: Path, module_name: str, module_spec: RepoInfo) -> P
29
29
 
30
30
  def get_local_ref(origin: RefspecInfo) -> str:
31
31
  """Generates a local reference name for a given origin."""
32
- return f"loc-{origin.ref_name or origin.refspec}"
32
+ return f"{origin.ref_name or origin.refspec}"
33
33
 
34
34
 
35
35
  async def run_git(*args: str, cwd: Optional[Path] = None) -> tuple[int, str, str]:
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.4
2
+ Name: bl-odoo
3
+ Version: 0.3.2
4
+ Summary: A command-line tool for managing Odoo dependencies.
5
+ Author-email: Your Name <your.email@example.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: pyyaml>=6.0.3
11
+ Requires-Dist: rich
12
+ Requires-Dist: typer
13
+ Dynamic: license-file
14
+
15
+ # bl
16
+
17
+ ## Why BL
18
+
19
+ Because `ak` is slow and `bl` is fast
20
+
21
+ Because `ak` crashes if anything goes wrong
22
+
23
+ Because `ak` error are impossible to find
24
+
25
+ ## Install
26
+
27
+ `pipx install bl-odoo`
28
+
29
+ ## Usage
30
+
31
+ ### Build
32
+
33
+ ```bl build -c <path_to_spec.yaml> -z <path_to_frozen.yaml> -j <concurrency>```
34
+
35
+ #### Params
36
+ * `path_to_spec.yaml` should be the path to your spec (default: spec.yaml)
37
+ * `path_to_frozen.yaml` should be the path to your spec (default: frozen.yaml)
38
+ * `concurrency` number of module clone simultaneously (default: 28)
39
+
40
+ #### How it looks
41
+ <img width="1683" height="756" alt="bl_build" src="https://github.com/user-attachments/assets/22fc1565-3a54-4f57-9b85-a11263b9b536" />
42
+
43
+ ### Freeze
44
+
45
+ ```bl freeze -c <path_to_spec.yaml> -z <path_to_frozen.yaml> -j <concurrency>```
46
+
47
+ #### Params
48
+ * `path_to_spec.yaml` should be the path to your spec (default: spec.yaml)
49
+ * `path_to_frozen.yaml` should be the path to your spec (default: frozen.yaml)
50
+ * `concurrency` number of module clone simultaneously (default: 28)
51
+
52
+ ## Odoo is taking a really long time to clone
53
+
54
+ Yes !
55
+
56
+ You can add a locales entry to your odoo repo in `spec.yaml` like so:
57
+ ```
58
+ odoo:
59
+ modules:
60
+ - account
61
+ ...
62
+ remotes:
63
+ odoo: https://github.com/odoo/odoo
64
+ merges:
65
+ - odoo 14.0
66
+ locales:
67
+ - fr
68
+ - en
69
+ ```
70
+ It will only download the french and english translation instead of all of them
71
+ - without locales: 849MB and 40 seconds fresh build
72
+ - with locales fr, en: 169MB and 27 seconds fresh build
73
+
74
+ ## Benchmarks
75
+
76
+ ### Ak benchmarks
77
+ #### Fresh install
78
+ <img width="1462" height="347" alt="ak_bench_cold" src="https://github.com/user-attachments/assets/e29cd3d9-831c-43c1-8f29-e040ebee5740" />
79
+
80
+ #### Already cloned once
81
+ <img width="1419" height="356" alt="ak_bench_hot" src="https://github.com/user-attachments/assets/47b5756e-efe1-4272-82b7-e160f73af1be" />
82
+
83
+ ### Bl benchmarks
84
+ #### Fresh install
85
+ <img width="1335" height="343" alt="bl_bench_cold" src="https://github.com/user-attachments/assets/a64ba1c4-17bd-4017-acfd-5749df505f50" />
86
+
87
+ #### Already cloned once
88
+ <img width="1373" height="342" alt="bl_bench_hot" src="https://github.com/user-attachments/assets/b11e60c2-368b-496c-bc88-f5a765f44bfe" />
89
+
90
+ ### Results
91
+ |Type| AK | BL |
92
+ |----|----|----|
93
+ |Cold| ~100s | 2 - 10x faster |
94
+ |Hot| 3-20s | 2 - 10x faster |
95
+
@@ -0,0 +1,13 @@
1
+ bl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ bl/__main__.py,sha256=EoFSp4KttZ3QvJqymAvilLUhkzAGVig0JVJY5FyzYko,1643
3
+ bl/freezer.py,sha256=vabN0MY_JRx8ztNou0ymZgDCWb2EKGf6xUnhG6z33u8,2432
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=BFczSYKSpKCcaYilHVm1yQVXbbV0yw4QdOAu474vNlY,1618
8
+ bl_odoo-0.3.2.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
9
+ bl_odoo-0.3.2.dist-info/METADATA,sha256=1PDB9kSY8YP8lSviWJ5xbXTWxqXUv9HT7xi6ZJpiRFg,2639
10
+ bl_odoo-0.3.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
+ bl_odoo-0.3.2.dist-info/entry_points.txt,sha256=fmdGhYYJlP-XByamgaZdM0bo3JK4LJFswU_Nilq6SSw,39
12
+ bl_odoo-0.3.2.dist-info/top_level.txt,sha256=1o4tN3wszdw7U5SnGgdF5P2sTYA0Schf0vKFy9_2D6A,3
13
+ bl_odoo-0.3.2.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: bl-odoo
3
- Version: 0.3.1
4
- Summary: A command-line tool for managing Odoo dependencies.
5
- Author-email: Your Name <your.email@example.com>
6
- License-Expression: MIT
7
- Requires-Python: >=3.9
8
- Description-Content-Type: text/markdown
9
- License-File: LICENSE
10
- Requires-Dist: pyyaml>=6.0.3
11
- Requires-Dist: rich
12
- Requires-Dist: typer
13
- Dynamic: license-file
14
-
15
- # bl
16
-
17
- A new Python project.
@@ -1,13 +0,0 @@
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,,