machineconfig 5.98__py3-none-any.whl → 6.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.

Potentially problematic release.


This version of machineconfig might be problematic. Click here for more details.

@@ -37,13 +37,14 @@ def get_shell_profile_path() -> PathExtended:
37
37
 
38
38
  def create_default_shell_profile() -> None:
39
39
  shell_profile_path = get_shell_profile_path()
40
- shell_profile_path.parent.mkdir(parents=True, exist_ok=True)
40
+ if not shell_profile_path.exists():
41
+ console.print(Panel(f"""🆕 PROFILE | Profile does not exist at `{shell_profile_path}`. Creating a new one.""", title="[bold blue]Profile[/bold blue]", border_style="blue"))
42
+ shell_profile_path.parent.mkdir(parents=True, exist_ok=True)
43
+ shell_profile_path.write_text("", encoding="utf-8")
41
44
  shell_profile = shell_profile_path.read_text(encoding="utf-8")
42
-
43
45
  from machineconfig.profile.create_helper import copy_assets_to_machine
44
46
  copy_assets_to_machine("settings") # init.ps1 or init.sh live here
45
47
  copy_assets_to_machine("scripts") # init scripts are going to reference those scripts.
46
-
47
48
  if system == "Windows":
48
49
  init_script = PathExtended(CONFIG_ROOT).joinpath("settings/shells/pwsh/init.ps1")
49
50
  source_line = f""". {str(init_script.collapseuser(placeholder="$HOME"))}"""
@@ -10,7 +10,7 @@ import machineconfig.scripts.python.devops_helpers.cli_data as cli_data
10
10
  import machineconfig.scripts.python.devops_helpers.cli_nw as cli_network
11
11
 
12
12
 
13
- def install(which: Annotated[Optional[str], typer.Argument(..., help="Comma-separated list of program names to install, or group name if --group flag is set.")],
13
+ def install(which: Annotated[Optional[str], typer.Argument(..., help="Comma-separated list of program names to install, or group name if --group flag is set.")] = None,
14
14
  group: Annotated[bool, typer.Option(..., "--group", "-g", help="Treat 'which' as a group name. A group is bundle of apps.")] = False,
15
15
  interactive: Annotated[bool, typer.Option(..., "--interactive", "-ia", help="Interactive selection of programs to install.")] = False,
16
16
  ) -> None:
@@ -3,7 +3,7 @@ import typer
3
3
  from typing import Optional, Annotated
4
4
 
5
5
 
6
- def update():
6
+ def update(copy_assets: Annotated[bool, typer.Option(..., "--copy-assets", "-c", help="Copy assets to the machine after the update. Default is True.")] = False):
7
7
  """🔄 UPDATE uv and machineconfig"""
8
8
  # from machineconfig.utils.source_of_truth import LIBRARY_ROOT
9
9
  # repo_root = LIBRARY_ROOT.parent.parent
@@ -23,10 +23,19 @@ def update():
23
23
  import platform
24
24
  if platform.system() == "Windows":
25
25
  from machineconfig.utils.code import run_shell_script_after_exit
26
+ if copy_assets:
27
+ code += """
28
+ devops self copy-assets both
29
+ """
26
30
  run_shell_script_after_exit(code)
27
31
  else:
28
32
  from machineconfig.utils.code import run_shell_script
29
33
  run_shell_script(code)
34
+ if copy_assets:
35
+ import machineconfig.profile.create_helper as create_helper
36
+ create_helper.copy_assets_to_machine(which="scripts")
37
+ create_helper.copy_assets_to_machine(which="settings")
38
+
30
39
 
31
40
  def interactive():
32
41
  """🤖 INTERACTIVE configuration of machine."""
@@ -125,10 +125,9 @@ def get_all_installer_data_files() -> list[InstallerData]:
125
125
  return res_final
126
126
 
127
127
 
128
- def get_installers_system_groups():
128
+ def dynamically_extract_installers_system_groups_from_scripts():
129
129
  res_final: list[InstallerData] = []
130
130
  from platform import system
131
-
132
131
  if system() == "Windows":
133
132
  options_system = parse_apps_installer_windows(LIBRARY_ROOT.joinpath("setup_windows/apps.ps1").read_text(encoding="utf-8"))
134
133
  elif system() == "Linux" or system() == "Darwin":
@@ -1,6 +1,6 @@
1
1
  """Devops Devapps Install"""
2
2
 
3
- from machineconfig.utils.installer import get_installers_system_groups
3
+ from machineconfig.utils.installer import dynamically_extract_installers_system_groups_from_scripts
4
4
  import typer
5
5
  from rich.console import Console
6
6
  from rich.panel import Panel
@@ -68,6 +68,26 @@ def main(
68
68
  return install_group(package_group=a_group)
69
69
  else:
70
70
  return install_clis(clis_names=[x.strip() for x in which.split(",") if x.strip() != ""])
71
+ else:
72
+ if group:
73
+ typer.echo("❌ You must provide a group name when using the --group/-g option.")
74
+ res = get_static_groups_combined_with_dynamic_groups_extracted()
75
+ console.print("[bold blue]Here are the available groups:[/bold blue]")
76
+ table = Table(show_header=True, header_style="bold magenta")
77
+ table.add_column("Group", style="cyan", no_wrap=True)
78
+ table.add_column("AppsBundled", style="green", overflow="fold")
79
+ for display, group_name in res.items():
80
+ # Parse display
81
+ if " -- " in display:
82
+ group_part, items_part = display.split(" -- ", 1)
83
+ group_name_parsed = group_part.replace("📦 ", "").strip()
84
+ items_str = items_part.strip()
85
+ else:
86
+ group_name_parsed = display
87
+ items_str = group_name
88
+ table.add_row(group_name_parsed, items_str)
89
+ console.print(table)
90
+ raise typer.Exit(1)
71
91
  typer.echo("❌ You must provide either a program name/group name, or use --interactive/-ia option.")
72
92
  import click
73
93
  ctx = click.get_current_context()
@@ -75,6 +95,19 @@ def main(
75
95
  raise typer.Exit(1)
76
96
 
77
97
 
98
+ def get_static_groups_combined_with_dynamic_groups_extracted():
99
+ # Build category options and maintain a mapping from display text to actual category name
100
+ category_display_to_name: dict[str, str] = {}
101
+ for group_name, group_values in PACKAGE_GROUP2NAMES.items():
102
+ display = f"📦 {group_name:<20}" + " -- " + f"{'|'.join(group_values):<60}"
103
+ category_display_to_name[display] = group_name
104
+ options_system = dynamically_extract_installers_system_groups_from_scripts()
105
+ for item in options_system:
106
+ display = f"📦 {item['appName']:<20} -- {item['doc']:<60}"
107
+ category_display_to_name[display] = item['appName']
108
+ return category_display_to_name
109
+
110
+
78
111
  def install_interactively():
79
112
  from machineconfig.utils.options import choose_from_options
80
113
  from machineconfig.utils.schemas.installer.installer_types import get_normalized_arch, get_os_name
@@ -84,16 +117,8 @@ def install_interactively():
84
117
  installer_options = []
85
118
  for x in installers:
86
119
  installer_options.append(Installer(installer_data=x).get_description())
87
- # Build category options and maintain a mapping from display text to actual category name
88
- category_display_to_name: dict[str, str] = {}
89
- for group_name, group_values in PACKAGE_GROUP2NAMES.items():
90
- display = f"📦 {group_name:<20}" + " -- " + f"{'|'.join(group_values):<60}"
91
- category_display_to_name[display] = group_name
92
- options_system = get_installers_system_groups()
93
- for item in options_system:
94
- display = f"📦 {item['appName']:<20} -- {item['doc']:<60}"
95
- category_display_to_name[display] = item['appName']
96
-
120
+
121
+ category_display_to_name = get_static_groups_combined_with_dynamic_groups_extracted()
97
122
  options = list(category_display_to_name.keys()) + ["─" * 50] + installer_options
98
123
  program_names = choose_from_options(multi=True, msg="Categories are prefixed with 📦", options=options, header="🚀 CHOOSE DEV APP OR CATEGORY", default="📦 essentials", fzf=True)
99
124
  installation_messages: list[str] = []
@@ -123,7 +148,7 @@ def install_group(package_group: str):
123
148
  installers_ = get_installers(os=get_os_name(), arch=get_normalized_arch(), which_cats=[package_group])
124
149
  install_bulk(installers_data=installers_)
125
150
  else:
126
- options_system = get_installers_system_groups()
151
+ options_system = dynamically_extract_installers_system_groups_from_scripts()
127
152
  from machineconfig.utils.schemas.installer.installer_types import get_normalized_arch, get_os_name
128
153
  from machineconfig.utils.code import run_shell_script
129
154
  for an_item in options_system:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: machineconfig
3
- Version: 5.98
3
+ Version: 6.1
4
4
  Summary: Dotfiles management package
5
5
  Author-email: Alex Al-Saffar <programmer@usa.com>
6
6
  License: Apache 2.0
@@ -96,7 +96,7 @@ machineconfig/profile/bash_shell_profiles.md,sha256=mio0xkMTwO-F3fikWIfgcdQaPCmQ
96
96
  machineconfig/profile/create_helper.py,sha256=_iNeuwmcEGTx6sf_f40JKHfOCuJRZQRpyE8Fo_3Q6bI,1519
97
97
  machineconfig/profile/create_links.py,sha256=K7T2bq08GZP9fo2NzCOE0pojAgQDe0Ofe7fNfbQlQpw,14219
98
98
  machineconfig/profile/create_links_export.py,sha256=6LW4ZzHhQaox6W-rAuw3_gENTVKmOXA8_JfVDA-Mfws,3294
99
- machineconfig/profile/create_shell_profile.py,sha256=fFRFe2tWwCOto8S5nv5TkgIbYK-Ts5cKe6bQUM944sA,9603
99
+ machineconfig/profile/create_shell_profile.py,sha256=Kxic1RPANP04uFbRuKMJmvkKdduuZ4Y6QNH0vpk0lYs,9888
100
100
  machineconfig/profile/mapper.toml,sha256=50q2VdR_PNLXGljH47R2cxuJvzlJQnq7lkJ05TMtJ5Q,12357
101
101
  machineconfig/profile/records/generic/shares.toml,sha256=FduDztfyQtZcr5bfx-RSKhEEweweQSWfVXkKWnx8hCY,143
102
102
  machineconfig/profile/records/linux/apps_summary_report.csv,sha256=pw9djvaRUPalKDLn2sl3odcbD2_Zx3aEupsQ8UPfaaY,2738
@@ -122,7 +122,7 @@ machineconfig/scripts/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
122
122
  machineconfig/scripts/python/agents.py,sha256=f5UxgXjGlEypoNFqK0uHKO0UkbV_wUmPiPzotL2yapM,10677
123
123
  machineconfig/scripts/python/cloud.py,sha256=ubLmf06FSdi1NawpQDgUDAtYb9cZSQqHbSUHzAwRIas,1199
124
124
  machineconfig/scripts/python/croshell.py,sha256=0Ym3n-ZmIpaOX_SWnGP88dq_iH7QWJKUZvY0x58sXjI,7083
125
- machineconfig/scripts/python/devops.py,sha256=VYxwtgwKVs9qMmBxTz2fagNnapizpAXEGlzR0iHp-rw,2152
125
+ machineconfig/scripts/python/devops.py,sha256=NS4zbOGm8uRNxmtWuH4vBAajrbZj014FpZrpZTYXS1Y,2159
126
126
  machineconfig/scripts/python/devops_navigator.py,sha256=4O9_-ACeP748NcMjWQXZF7mBQpMPxqCGhLvPG3DMi4Q,236
127
127
  machineconfig/scripts/python/entry.py,sha256=Az7dK1eXHGW5l46Yg10Cd88VChCdhvLAzO3e1A3r56A,2176
128
128
  machineconfig/scripts/python/fire_jobs.py,sha256=O5DrckUGLxGblOcLf_iXU31pmCSpTg-c0hQZxQKD1os,13591
@@ -178,7 +178,7 @@ machineconfig/scripts/python/devops_helpers/cli_config_dotfile.py,sha256=rjTys4F
178
178
  machineconfig/scripts/python/devops_helpers/cli_data.py,sha256=kvJ7g2CccjjXIhCwdu_Vlif8JHC0qUoLjuGcTSqT-IU,514
179
179
  machineconfig/scripts/python/devops_helpers/cli_nw.py,sha256=nI_zmcmUvijVeXIWT2dN5onoy3ou-lub1cL-SJImmDA,4125
180
180
  machineconfig/scripts/python/devops_helpers/cli_repos.py,sha256=GEsW0ykgu8mtoiXurOSjOlbY_Xrngy_aeBq4eRZY8ts,12335
181
- machineconfig/scripts/python/devops_helpers/cli_self.py,sha256=WHrx980iGBMO_A-QiA4NyJ_2bvHBIe1nmhzwbczEOi0,5179
181
+ machineconfig/scripts/python/devops_helpers/cli_self.py,sha256=oBci1GDFyA43ZHu04VpjuBq6MnfCIOKpp5dK7-NxRdw,5638
182
182
  machineconfig/scripts/python/devops_helpers/cli_share_server.py,sha256=q9pFJ6AxPuygMr3onMNOKEuuQHbVE_6Qoyo7xRT5FX0,4196
183
183
  machineconfig/scripts/python/devops_helpers/cli_terminal.py,sha256=k_PzXaiGyE0vXr0Ii1XcJz2A7UvyPJrR31TRWt4RKRI,6019
184
184
  machineconfig/scripts/python/devops_helpers/devops_backup_retrieve.py,sha256=nK47Rc7gQuDCnkk6_sW1y82gBnDJ9TdHU8XwMPFBK9c,5591
@@ -384,7 +384,7 @@ machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py,sha256=ogxJnwpdcpH7N6
384
384
  machineconfig/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
385
385
  machineconfig/utils/accessories.py,sha256=W_9dLzjwNTW5JQk_pe3B2ijQ1nA2-8Kdg2r7VBtzgQs,4340
386
386
  machineconfig/utils/code.py,sha256=f0K5abTIBBurK5pSM_VRtW_npFjK18UvIG_BEyzOv40,8912
387
- machineconfig/utils/installer.py,sha256=ZnhW_gRmGlq5uXwzNvIn-x1vXuOJxkzVqjNu188f37s,10465
387
+ machineconfig/utils/installer.py,sha256=puFcMe-oNAeqTW0jz1NAEil8HRtxY4B6Z0VAeq_jH-o,10493
388
388
  machineconfig/utils/io.py,sha256=rzEwAnq-gyT29Y4CDHHGxAA6ddIIFOCxrqZ6dn0ALa4,2255
389
389
  machineconfig/utils/links.py,sha256=KM6vIn3hag9FYEzLSHP5MAM9tU_RStw2mCq2_OvmmZA,23672
390
390
  machineconfig/utils/meta.py,sha256=fDn7cpq6iqAPzX2eKLSK9DZb0870rluR7eLDx5NgNaw,5994
@@ -413,7 +413,7 @@ machineconfig/utils/files/ouch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
413
413
  machineconfig/utils/files/ouch/decompress.py,sha256=7qPaEkMerBBXzeZyFn8hLODHZJv1aty-yGgwBxLgVys,1413
414
414
  machineconfig/utils/installer_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
415
415
  machineconfig/utils/installer_utils/github_release_bulk.py,sha256=WJf_qZlF02SmIc6C7o1h4Gy4gAaJAfeAS8O9s2Itj-k,6535
416
- machineconfig/utils/installer_utils/installer.py,sha256=E1GqBJpVDGcYVX5LfiaQbLO2va2FrOMZOcwWiyP_nXw,9837
416
+ machineconfig/utils/installer_utils/installer.py,sha256=aqoAUv2gQoiIrg9ErxLh_kZWyFk3dOL4HEVxXEyAmW4,11178
417
417
  machineconfig/utils/installer_utils/installer_abc.py,sha256=ZoMtINHD9cHEu4R5SYUWgHLTAqo4F2a33pBrEOGX4zs,11693
418
418
  machineconfig/utils/installer_utils/installer_class.py,sha256=apLMLmpZfHbj4I5ttgwg0ZIp66B5vx2nPtuhEobGdWM,17186
419
419
  machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=Xbi59rU35AzR7HZZ8ZQ8aUu_FjSgijNqc8Sme0rCk2Y,2050
@@ -421,8 +421,8 @@ machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoS
421
421
  machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
422
422
  machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
423
423
  machineconfig/utils/ssh_utils/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
424
- machineconfig-5.98.dist-info/METADATA,sha256=ZH7aa6qaREgckDGVClz8l044tHNP9ym_oCGE3notpt8,3012
425
- machineconfig-5.98.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
426
- machineconfig-5.98.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
427
- machineconfig-5.98.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
428
- machineconfig-5.98.dist-info/RECORD,,
424
+ machineconfig-6.1.dist-info/METADATA,sha256=kXGOmMpW4eD3gRmpLwh3No6nfJ_xPOjQsHZHky-bZJU,3011
425
+ machineconfig-6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
426
+ machineconfig-6.1.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
427
+ machineconfig-6.1.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
428
+ machineconfig-6.1.dist-info/RECORD,,