machineconfig 2.1__py3-none-any.whl → 2.3__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.

Files changed (127) hide show
  1. machineconfig/cluster/sessions_managers/enhanced_command_runner.py +0 -2
  2. machineconfig/cluster/sessions_managers/layout_types.py +29 -0
  3. machineconfig/cluster/sessions_managers/wt_local.py +68 -62
  4. machineconfig/cluster/sessions_managers/wt_local_manager.py +51 -22
  5. machineconfig/cluster/sessions_managers/wt_remote.py +30 -108
  6. machineconfig/cluster/sessions_managers/wt_remote_manager.py +14 -11
  7. machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +33 -37
  8. machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +22 -17
  9. machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +59 -10
  10. machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +16 -14
  11. machineconfig/cluster/sessions_managers/zellij_local.py +75 -57
  12. machineconfig/cluster/sessions_managers/zellij_local_manager.py +51 -23
  13. machineconfig/cluster/sessions_managers/zellij_remote.py +47 -27
  14. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +13 -12
  15. machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +14 -10
  16. machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +31 -15
  17. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +47 -21
  18. machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +1 -1
  19. machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +8 -7
  20. machineconfig/cluster/templates/utils.py +0 -35
  21. machineconfig/jobs/python/check_installations.py +1 -1
  22. machineconfig/jobs/python_custom_installers/dev/code.py +0 -13
  23. machineconfig/jobs/python_generic_installers/config.json +1 -1
  24. machineconfig/profile/create.py +13 -4
  25. machineconfig/profile/create_hardlinks.py +3 -1
  26. machineconfig/profile/shell.py +8 -7
  27. machineconfig/scripts/__init__.py +0 -2
  28. machineconfig/scripts/linux/devops +6 -4
  29. machineconfig/scripts/python/ai/generate_files.py +14 -15
  30. machineconfig/scripts/python/ai/mcinit.py +8 -5
  31. machineconfig/scripts/python/archive/tmate_conn.py +5 -5
  32. machineconfig/scripts/python/archive/tmate_start.py +7 -7
  33. machineconfig/scripts/python/choose_wezterm_theme.py +35 -32
  34. machineconfig/scripts/python/cloud_copy.py +22 -13
  35. machineconfig/scripts/python/cloud_mount.py +35 -23
  36. machineconfig/scripts/python/cloud_repo_sync.py +38 -25
  37. machineconfig/scripts/python/cloud_sync.py +4 -4
  38. machineconfig/scripts/python/croshell.py +37 -28
  39. machineconfig/scripts/python/devops.py +46 -27
  40. machineconfig/scripts/python/devops_add_identity.py +15 -25
  41. machineconfig/scripts/python/devops_add_ssh_key.py +7 -7
  42. machineconfig/scripts/python/devops_backup_retrieve.py +17 -15
  43. machineconfig/scripts/python/devops_devapps_install.py +26 -20
  44. machineconfig/scripts/python/devops_update_repos.py +142 -57
  45. machineconfig/scripts/python/dotfile.py +16 -14
  46. machineconfig/scripts/python/fire_agents.py +30 -23
  47. machineconfig/scripts/python/fire_jobs.py +86 -98
  48. machineconfig/scripts/python/fire_jobs_args_helper.py +84 -0
  49. machineconfig/scripts/python/fire_jobs_layout_helper.py +66 -0
  50. machineconfig/scripts/python/ftpx.py +24 -14
  51. machineconfig/scripts/python/get_zellij_cmd.py +8 -7
  52. machineconfig/scripts/python/helpers/cloud_helpers.py +33 -28
  53. machineconfig/scripts/python/helpers/helpers2.py +25 -14
  54. machineconfig/scripts/python/helpers/helpers4.py +44 -31
  55. machineconfig/scripts/python/helpers/helpers5.py +1 -1
  56. machineconfig/scripts/python/helpers/repo_sync_helpers.py +31 -9
  57. machineconfig/scripts/python/mount_nfs.py +8 -15
  58. machineconfig/scripts/python/mount_nw_drive.py +10 -5
  59. machineconfig/scripts/python/mount_ssh.py +8 -6
  60. machineconfig/scripts/python/repos.py +215 -57
  61. machineconfig/scripts/python/snapshot.py +0 -1
  62. machineconfig/scripts/python/start_slidev.py +10 -5
  63. machineconfig/scripts/python/start_terminals.py +22 -16
  64. machineconfig/scripts/python/viewer_template.py +0 -1
  65. machineconfig/scripts/python/wifi_conn.py +49 -76
  66. machineconfig/scripts/python/wsl_windows_transfer.py +8 -6
  67. machineconfig/settings/lf/linux/lfrc +1 -0
  68. machineconfig/setup_linux/web_shortcuts/croshell.sh +5 -0
  69. machineconfig/setup_linux/web_shortcuts/interactive.sh +1 -1
  70. machineconfig/setup_linux/web_shortcuts/ssh.sh +0 -4
  71. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +3 -12
  72. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +1 -1
  73. machineconfig/utils/code.py +2 -3
  74. machineconfig/utils/installer.py +2 -2
  75. machineconfig/utils/installer_utils/installer_abc.py +2 -4
  76. machineconfig/utils/installer_utils/installer_class.py +6 -4
  77. machineconfig/utils/links.py +103 -33
  78. machineconfig/utils/notifications.py +52 -38
  79. machineconfig/utils/options.py +14 -21
  80. machineconfig/utils/path.py +12 -12
  81. machineconfig/utils/path_reduced.py +239 -200
  82. machineconfig/utils/procs.py +1 -1
  83. machineconfig/utils/source_of_truth.py +27 -0
  84. machineconfig/utils/ssh.py +9 -19
  85. machineconfig/utils/terminal.py +4 -2
  86. machineconfig/utils/upgrade_packages.py +91 -0
  87. machineconfig/utils/utils2.py +1 -2
  88. machineconfig/utils/utils5.py +23 -11
  89. machineconfig/utils/ve.py +4 -1
  90. {machineconfig-2.1.dist-info → machineconfig-2.3.dist-info}/METADATA +13 -13
  91. {machineconfig-2.1.dist-info → machineconfig-2.3.dist-info}/RECORD +105 -121
  92. machineconfig-2.3.dist-info/entry_points.txt +2 -0
  93. machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +0 -59
  94. machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -183
  95. machineconfig/cluster/sessions_managers/demo_rich_zellij.py +0 -0
  96. machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
  97. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  98. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  99. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  100. machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  101. machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
  102. machineconfig/scripts/python/__pycache__/croshell.cpython-313.pyc +0 -0
  103. machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
  104. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
  105. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
  106. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
  107. machineconfig/scripts/python/ai/__pycache__/__init__.cpython-313.pyc +0 -0
  108. machineconfig/scripts/python/ai/__pycache__/generate_files.cpython-313.pyc +0 -0
  109. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-313.pyc +0 -0
  110. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
  111. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
  112. machineconfig/setup_linux/web_shortcuts/all.sh +0 -48
  113. machineconfig/setup_linux/web_shortcuts/update_system.sh +0 -48
  114. machineconfig/utils/utils.py +0 -97
  115. /machineconfig/cluster/{cloud_manager.py → remote/cloud_manager.py} +0 -0
  116. /machineconfig/cluster/{data_transfer.py → remote/data_transfer.py} +0 -0
  117. /machineconfig/cluster/{distribute.py → remote/distribute.py} +0 -0
  118. /machineconfig/cluster/{file_manager.py → remote/file_manager.py} +0 -0
  119. /machineconfig/cluster/{job_params.py → remote/job_params.py} +0 -0
  120. /machineconfig/cluster/{loader_runner.py → remote/loader_runner.py} +0 -0
  121. /machineconfig/cluster/{remote_machine.py → remote/remote_machine.py} +0 -0
  122. /machineconfig/cluster/{script_execution.py → remote/script_execution.py} +0 -0
  123. /machineconfig/cluster/{script_notify_upon_completion.py → remote/script_notify_upon_completion.py} +0 -0
  124. /machineconfig/{cluster/sessions_managers/archive/__init__.py → scripts/python/fire_jobs_streamlit_helper.py} +0 -0
  125. /machineconfig/setup_linux/web_shortcuts/{tmp.sh → android.sh} +0 -0
  126. {machineconfig-2.1.dist-info → machineconfig-2.3.dist-info}/WHEEL +0 -0
  127. {machineconfig-2.1.dist-info → machineconfig-2.3.dist-info}/top_level.txt +0 -0
@@ -1,48 +0,0 @@
1
- #!/usr/bin/bash
2
- #=======================================================================
3
- # 🌐 WEB SHORTCUTS MASTER SCRIPT
4
- #=======================================================================
5
- # This script provides quick access to installation scripts via web
6
-
7
- echo """#=======================================================================
8
- 📚 AVAILABLE INSTALLATION OPTIONS | Web-based installers
9
- #=======================================================================
10
-
11
- Choose from the following installation options:
12
- """
13
-
14
- echo """#=======================================================================
15
- 📦 SYSTEM APPLICATIONS | Basic system applications
16
- #=======================================================================
17
-
18
- # To install system applications, run:
19
- # curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps.sh | bash
20
- """
21
-
22
- echo """#=======================================================================
23
- 🐍 PYTHON ENVIRONMENT | Virtual environment setup
24
- #=======================================================================
25
-
26
- Setting up Python virtual environment...
27
- """
28
- curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/ve.sh | bash
29
-
30
- echo """#=======================================================================
31
- 🔄 CODE REPOSITORIES | Cloning project repositories
32
- #=======================================================================
33
-
34
- Setting up code repositories...
35
- """
36
- curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/repos.sh | bash
37
-
38
- echo """#=======================================================================
39
- ⚙️ DEVELOPMENT TOOLS | Developer applications
40
- #=======================================================================
41
-
42
- # To install development applications, run:
43
- # source <(sudo cat ~/code/machineconfig/src/machineconfig/setup_linux/devapps.sh)
44
-
45
- #=======================================================================
46
- ✅ INSTALLATION COMPLETE | Basic environment setup finished
47
- #=======================================================================
48
- """
@@ -1,48 +0,0 @@
1
- #!/usr/bin/bash
2
- #=======================================================================
3
- # 🔄 SYSTEM UPDATE SCRIPT
4
- #=======================================================================
5
- # This script provides methods to update Ubuntu system and kernel
6
-
7
- echo """#=======================================================================
8
- 🔄 SYSTEM UPGRADE OPTIONS | Ubuntu system maintenance
9
- #=======================================================================
10
- """
11
-
12
- echo """#=======================================================================
13
- 📦 UBUNTU DISTRIBUTION UPGRADE | Full system version upgrade
14
- #=======================================================================
15
-
16
- ⚠️ This will upgrade Ubuntu to the next available release
17
- Edit /etc/update-manager/release-upgrades to configure upgrade behavior
18
- """
19
- # Uncomment the line below to actually run the upgrade
20
- # do-release-upgrade
21
-
22
- echo """#=======================================================================
23
- 🔧 KERNEL UPDATE | Installing the latest Linux kernel
24
- #=======================================================================
25
-
26
- 📥 Downloading Ubuntu mainline kernel installation script...
27
- """
28
- wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
29
-
30
- echo """🛠️ Installing script to system path...
31
- """
32
- sudo install ubuntu-mainline-kernel.sh /usr/local/bin/
33
-
34
- echo """🔍 Checking available kernel versions...
35
- """
36
- sudo ubuntu-mainline-kernel.sh -c
37
-
38
- echo """⏳ Installing the latest kernel (this may take several minutes)...
39
- """
40
- sudo ubuntu-mainline-kernel.sh -i -y
41
-
42
- echo """#=======================================================================
43
- ✅ UPDATE COMPLETE | System upgrade finished
44
- #=======================================================================
45
-
46
- ⚠️ IMPORTANT: A system reboot is required to use the new kernel
47
- To reboot now, run: sudo reboot
48
- """
@@ -1,97 +0,0 @@
1
- """
2
- Utils
3
- """
4
-
5
- from machineconfig.utils.path_reduced import PathExtended as PathExtended
6
- import machineconfig
7
- from machineconfig.utils.options import check_tool_exists, choose_cloud_interactively, choose_multiple_options, choose_one_option, choose_ssh_host, display_options
8
- from rich.console import Console
9
- from rich.panel import Panel
10
- from machineconfig.utils.links import build_links, symlink_copy, symlink_func
11
- from machineconfig.utils.code import write_shell_script_to_default_program_path, print_code, PROGRAM_PATH
12
- from machineconfig.utils.path import sanitize_path, match_file_name
13
-
14
- # Split into multiple assignments to fix incompatible tuple sizes
15
- _ = print_code, PROGRAM_PATH, display_options, write_shell_script_to_default_program_path
16
- _ = build_links
17
- _ = symlink_copy
18
- _ = symlink_func
19
- _ = check_tool_exists
20
- _ = choose_cloud_interactively
21
- _ = choose_multiple_options
22
- _ = choose_one_option
23
- _ = choose_ssh_host
24
- _ = sanitize_path
25
- _ = match_file_name
26
-
27
-
28
- LIBRARY_ROOT = PathExtended(machineconfig.__file__).resolve().parent # .replace(str(PathExtended.home()).lower(), PathExtended.home().str)
29
- REPO_ROOT = LIBRARY_ROOT.parent.parent
30
- CONFIG_PATH = PathExtended.home().joinpath(".config/machineconfig")
31
- INSTALL_VERSION_ROOT = CONFIG_PATH.joinpath("cli_tools_installers/versions")
32
- INSTALL_TMP_DIR = PathExtended.home().joinpath("tmp_results", "tmp_installers")
33
- DEFAULTS_PATH = PathExtended.home().joinpath("dotfiles/machineconfig/defaults.ini")
34
-
35
-
36
- # def get_latest_version(url: str) -> None:
37
- # # not yet used, consider, using it.
38
- # import requests
39
- # import json
40
- # url = f"https://api.github.com/repos/{url.split('github.com/')[1]}/releases/latest"
41
- # # Replace {owner} and {repo} with the actual owner and repository name
42
- # response = requests.get(url, timeout=10)
43
- # if response.status_code == 200:
44
- # data = json.loads(response.text)
45
- # latest_version = data["tag_name"]
46
- # print(f"\n📦 VERSION INFO | Latest release: {latest_version}\n")
47
- # else: print(f"\n❌ ERROR | API request failed: {response.status_code}\n")
48
-
49
-
50
- def check_dotfiles_version_is_beyond(commit_dtm: str, update: bool) -> bool:
51
- dotfiles_path = str(PathExtended.home().joinpath("dotfiles"))
52
- from git import Repo
53
-
54
- repo = Repo(path=dotfiles_path)
55
- last_commit = repo.head.commit
56
- dtm = last_commit.committed_datetime
57
- from datetime import datetime # make it tz unaware
58
-
59
- dtm = datetime(dtm.year, dtm.month, dtm.day, dtm.hour, dtm.minute, dtm.second)
60
- res = dtm > datetime.fromisoformat(commit_dtm)
61
- if res is False and update is True:
62
- console = Console()
63
- console.print(Panel(f"🔄 UPDATE REQUIRED | Updating dotfiles because {dtm} < {datetime.fromisoformat(commit_dtm)}", border_style="bold blue", expand=False))
64
- from machineconfig.scripts.python.cloud_repo_sync import main
65
-
66
- main(cloud=None, path=dotfiles_path)
67
- return res
68
-
69
-
70
- def wait_for_jobs_to_finish(root: PathExtended, pattern: str, wait_for_n_jobs: int, max_wait_minutes: float) -> bool:
71
- wait_finished: bool = False
72
- import time
73
-
74
- t0 = time.time()
75
- while not wait_finished:
76
- parts = root.search(pattern, folders=False, r=False)
77
- counter = len(parts)
78
- if counter == wait_for_n_jobs:
79
- wait_finished = True
80
- console = Console()
81
- console.print(Panel(f"✅ JOB COMPLETE | {counter} Jobs finished successfully. Exiting.", border_style="bold blue", expand=False))
82
- return True
83
- if (time.time() - t0) > 60 * max_wait_minutes:
84
- console = Console()
85
- console.print(Panel(f"⏱️ TIMEOUT | Waited for {max_wait_minutes} minutes. Exiting.", border_style="bold blue", expand=False))
86
- return False
87
- print(f"""
88
- ⏳ PROGRESS | {counter}/{wait_for_n_jobs} jobs finished. Waiting for {wait_for_n_jobs - counter} more jobs to complete, sleeping for 60 seconds.
89
- """)
90
- time.sleep(60)
91
- return False
92
-
93
-
94
- if __name__ == "__main__":
95
- # import typer
96
- # typer.run(check_tool_exists)
97
- pass