machineconfig 1.97__py3-none-any.whl → 2.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.
- machineconfig/cluster/cloud_manager.py +22 -29
- machineconfig/cluster/data_transfer.py +2 -3
- machineconfig/cluster/distribute.py +0 -2
- machineconfig/cluster/file_manager.py +4 -5
- machineconfig/cluster/job_params.py +1 -4
- machineconfig/cluster/loader_runner.py +8 -11
- machineconfig/cluster/remote_machine.py +4 -5
- machineconfig/cluster/script_execution.py +2 -2
- machineconfig/cluster/script_notify_upon_completion.py +0 -1
- machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +4 -6
- machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +35 -75
- machineconfig/cluster/sessions_managers/wt_local.py +113 -185
- machineconfig/cluster/sessions_managers/wt_local_manager.py +127 -197
- machineconfig/cluster/sessions_managers/wt_remote.py +60 -67
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +110 -149
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +61 -64
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +72 -172
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +27 -60
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +58 -137
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +46 -74
- machineconfig/cluster/sessions_managers/zellij_local.py +91 -147
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +165 -190
- machineconfig/cluster/sessions_managers/zellij_remote.py +51 -58
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +40 -46
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +19 -17
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +30 -31
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +64 -134
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +7 -11
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +27 -55
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +14 -13
- machineconfig/cluster/templates/cli_click.py +0 -1
- machineconfig/cluster/templates/cli_gooey.py +0 -2
- machineconfig/cluster/templates/cli_trogon.py +0 -1
- machineconfig/cluster/templates/run_cloud.py +0 -1
- machineconfig/cluster/templates/run_cluster.py +0 -1
- machineconfig/cluster/templates/run_remote.py +0 -1
- machineconfig/cluster/templates/utils.py +27 -11
- machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
- machineconfig/jobs/python/check_installations.py +9 -9
- machineconfig/jobs/python/create_bootable_media.py +0 -2
- machineconfig/jobs/python/python_cargo_build_share.py +2 -2
- machineconfig/jobs/python/python_ve_symlink.py +9 -11
- machineconfig/jobs/python/tasks.py +0 -1
- machineconfig/jobs/python/vscode/api.py +5 -5
- machineconfig/jobs/python/vscode/link_ve.py +20 -21
- machineconfig/jobs/python/vscode/select_interpreter.py +28 -29
- machineconfig/jobs/python/vscode/sync_code.py +14 -18
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +15 -15
- machineconfig/jobs/python_custom_installers/dev/aider.py +10 -18
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +12 -21
- machineconfig/jobs/python_custom_installers/dev/brave.py +13 -22
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +13 -20
- machineconfig/jobs/python_custom_installers/dev/code.py +17 -24
- machineconfig/jobs/python_custom_installers/dev/cursor.py +10 -21
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +12 -11
- machineconfig/jobs/python_custom_installers/dev/espanso.py +19 -23
- machineconfig/jobs/python_custom_installers/dev/goes.py +9 -16
- machineconfig/jobs/python_custom_installers/dev/lvim.py +13 -21
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +15 -22
- machineconfig/jobs/python_custom_installers/dev/redis.py +15 -23
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +15 -22
- machineconfig/jobs/python_custom_installers/dev/winget.py +32 -50
- machineconfig/jobs/python_custom_installers/docker.py +15 -24
- machineconfig/jobs/python_custom_installers/gh.py +18 -26
- machineconfig/jobs/python_custom_installers/hx.py +33 -17
- machineconfig/jobs/python_custom_installers/warp-cli.py +15 -23
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/python_generic_installers/config.json +412 -389
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/jobs/python_windows_installers/dev/config.json +1 -1
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
- machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
- machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
- machineconfig/jobs/windows/start_terminal.ps1 +1 -1
- machineconfig/logger.py +50 -0
- machineconfig/profile/create.py +50 -36
- machineconfig/profile/create_hardlinks.py +33 -26
- machineconfig/profile/shell.py +87 -60
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +2 -2
- machineconfig/scripts/linux/checkout_versions +1 -1
- machineconfig/scripts/linux/choose_wezterm_theme +1 -1
- machineconfig/scripts/linux/cloud_copy +1 -1
- machineconfig/scripts/linux/cloud_manager +1 -1
- machineconfig/scripts/linux/cloud_mount +1 -1
- machineconfig/scripts/linux/cloud_repo_sync +1 -1
- machineconfig/scripts/linux/cloud_sync +1 -1
- machineconfig/scripts/linux/croshell +1 -1
- machineconfig/scripts/linux/devops +3 -5
- machineconfig/scripts/linux/fire +2 -1
- machineconfig/scripts/linux/fire_agents +3 -3
- machineconfig/scripts/linux/ftpx +1 -1
- machineconfig/scripts/linux/gh_models +1 -1
- machineconfig/scripts/linux/kill_process +1 -1
- machineconfig/scripts/linux/mcinit +2 -2
- machineconfig/scripts/linux/repos +1 -1
- machineconfig/scripts/linux/scheduler +1 -1
- machineconfig/scripts/linux/start_slidev +1 -1
- machineconfig/scripts/linux/start_terminals +1 -1
- machineconfig/scripts/linux/url2md +1 -1
- machineconfig/scripts/linux/warp-cli.sh +122 -0
- machineconfig/scripts/linux/wifi_conn +1 -1
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/__init__.py +0 -0
- machineconfig/scripts/python/ai/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/generate_files.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-313.pyc +0 -0
- machineconfig/scripts/python/ai/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
- machineconfig/scripts/python/ai/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
- machineconfig/scripts/python/ai/chatmodes/deepResearch.chatmode.md +81 -0
- machineconfig/scripts/python/ai/configs/.gemini/settings.json +81 -0
- machineconfig/scripts/python/ai/generate_files.py +84 -0
- machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +45 -0
- machineconfig/scripts/python/ai/mcinit.py +107 -0
- machineconfig/scripts/python/ai/prompts/allLintersAndTypeCheckers.prompt.md +5 -0
- machineconfig/scripts/python/ai/prompts/research-report-skeleton.prompt.md +38 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +52 -0
- machineconfig/scripts/python/archive/tmate_conn.py +5 -5
- machineconfig/scripts/python/archive/tmate_start.py +3 -3
- machineconfig/scripts/python/choose_wezterm_theme.py +2 -2
- machineconfig/scripts/python/cloud_copy.py +20 -19
- machineconfig/scripts/python/cloud_mount.py +10 -8
- machineconfig/scripts/python/cloud_repo_sync.py +15 -15
- machineconfig/scripts/python/cloud_sync.py +1 -1
- machineconfig/scripts/python/croshell.py +18 -16
- machineconfig/scripts/python/devops.py +6 -6
- machineconfig/scripts/python/devops_add_identity.py +9 -7
- machineconfig/scripts/python/devops_add_ssh_key.py +19 -19
- machineconfig/scripts/python/devops_backup_retrieve.py +14 -14
- machineconfig/scripts/python/devops_devapps_install.py +3 -3
- machineconfig/scripts/python/devops_update_repos.py +141 -53
- machineconfig/scripts/python/dotfile.py +3 -3
- machineconfig/scripts/python/fire_agents.py +202 -41
- machineconfig/scripts/python/fire_jobs.py +20 -21
- machineconfig/scripts/python/ftpx.py +4 -3
- machineconfig/scripts/python/gh_models.py +94 -94
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
- machineconfig/scripts/python/helpers/cloud_helpers.py +3 -3
- machineconfig/scripts/python/helpers/helpers2.py +3 -3
- machineconfig/scripts/python/helpers/helpers4.py +8 -7
- machineconfig/scripts/python/helpers/helpers5.py +7 -7
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +2 -2
- machineconfig/scripts/python/mount_nfs.py +4 -3
- machineconfig/scripts/python/mount_nw_drive.py +4 -4
- machineconfig/scripts/python/mount_ssh.py +4 -3
- machineconfig/scripts/python/repos.py +9 -9
- machineconfig/scripts/python/scheduler.py +1 -1
- machineconfig/scripts/python/start_slidev.py +9 -8
- machineconfig/scripts/python/start_terminals.py +1 -1
- machineconfig/scripts/python/viewer.py +40 -40
- machineconfig/scripts/python/wifi_conn.py +65 -66
- machineconfig/scripts/python/wsl_windows_transfer.py +2 -2
- machineconfig/scripts/windows/checkout_version.ps1 +1 -3
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
- machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
- machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
- machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
- machineconfig/scripts/windows/croshell.ps1 +2 -2
- machineconfig/scripts/windows/devops.ps1 +1 -4
- machineconfig/scripts/windows/dotfile.ps1 +1 -3
- machineconfig/scripts/windows/fire.ps1 +1 -1
- machineconfig/scripts/windows/ftpx.ps1 +2 -2
- machineconfig/scripts/windows/gpt.ps1 +1 -1
- machineconfig/scripts/windows/kill_process.ps1 +1 -2
- machineconfig/scripts/windows/mcinit.ps1 +2 -2
- machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
- machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
- machineconfig/scripts/windows/pomodoro.ps1 +1 -1
- machineconfig/scripts/windows/py2exe.ps1 +1 -3
- machineconfig/scripts/windows/repos.ps1 +1 -1
- machineconfig/scripts/windows/scheduler.ps1 +1 -1
- machineconfig/scripts/windows/snapshot.ps1 +2 -2
- machineconfig/scripts/windows/start_slidev.ps1 +1 -1
- machineconfig/scripts/windows/start_terminals.ps1 +1 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
- machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
- machineconfig/settings/lf/linux/lfrc +1 -1
- machineconfig/settings/linters/.ruff.toml +2 -2
- machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
- machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
- machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +71 -71
- machineconfig/settings/shells/wt/settings.json +8 -8
- machineconfig/settings/svim/linux/init.toml +1 -1
- machineconfig/settings/svim/windows/init.toml +1 -1
- machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -54
- machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
- machineconfig/setup_linux/web_shortcuts/tmp.sh +2 -0
- machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
- machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +75 -18
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +52 -42
- machineconfig/utils/ai/browser_user_wrapper.py +5 -5
- machineconfig/utils/ai/generate_file_checklist.py +19 -22
- machineconfig/utils/ai/url2md.py +5 -3
- machineconfig/utils/cloud/onedrive/setup_oauth.py +5 -4
- machineconfig/utils/cloud/onedrive/transaction.py +192 -227
- machineconfig/utils/code.py +71 -43
- machineconfig/utils/installer.py +77 -85
- machineconfig/utils/installer_utils/installer_abc.py +29 -17
- machineconfig/utils/installer_utils/installer_class.py +188 -83
- machineconfig/utils/io_save.py +3 -15
- machineconfig/utils/links.py +22 -11
- machineconfig/utils/notifications.py +197 -0
- machineconfig/utils/options.py +38 -25
- machineconfig/utils/path.py +18 -6
- machineconfig/utils/path_reduced.py +637 -316
- machineconfig/utils/procs.py +69 -63
- machineconfig/utils/scheduling.py +11 -13
- machineconfig/utils/ssh.py +351 -0
- machineconfig/utils/terminal.py +225 -0
- machineconfig/utils/utils.py +13 -12
- machineconfig/utils/utils2.py +43 -10
- machineconfig/utils/utils5.py +242 -46
- machineconfig/utils/ve.py +11 -6
- {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/METADATA +15 -9
- {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/RECORD +232 -235
- machineconfig/cluster/self_ssh.py +0 -57
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/archive/python_tools.txt +0 -12
- machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
- machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_generic_installers/update.py +0 -3
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/linux/activate_ve +0 -87
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/init.py +0 -56
- machineconfig/scripts/python/ai/rules/python/dev.md +0 -31
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/windows/activate_ve.ps1 +0 -54
- {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/WHEEL +0 -0
- {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/top_level.txt +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# """SelfSSh
|
|
3
|
-
# """
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
# from typing import Optional, Any
|
|
7
|
-
# import getpass
|
|
8
|
-
# import platform
|
|
9
|
-
# import subprocess
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# class SelfSSH:
|
|
13
|
-
# """Instead of SSH'ing to the same machine, one can use this interface.
|
|
14
|
-
# """
|
|
15
|
-
# def __init__(self):
|
|
16
|
-
# self.hostname = "localhost"
|
|
17
|
-
# self._remote_machine: Optional[MACHINE] = None
|
|
18
|
-
# self.remote_env_cmd = ". activate_ve"
|
|
19
|
-
# self.sftp: Any
|
|
20
|
-
# def __getstate__(self) -> object: return {}
|
|
21
|
-
# def __setstate__(self, state: dict[str, Any]) -> None:
|
|
22
|
-
# """This behaviour makes SelfSSH dynamic, even if it was pickled from windows machine, when unpickled on Linux, it will behave as a Linux machine instance."""
|
|
23
|
-
# _ = state
|
|
24
|
-
# new_instance = SelfSSH()
|
|
25
|
-
# self.__dict__.update(new_instance.__dict__)
|
|
26
|
-
# return None
|
|
27
|
-
# def run(self, cmd: str, desc: str = "", verbose: bool = False):
|
|
28
|
-
# _ = desc, verbose
|
|
29
|
-
# return Terminal().run(cmd, shell="powershell")
|
|
30
|
-
# def run_py(self, cmd: str, verbose: bool = False, desc: str = ''):
|
|
31
|
-
# _ = verbose, cmd, desc
|
|
32
|
-
# exec(cmd) # type: ignore # pylint: disable=exec-used
|
|
33
|
-
# return None
|
|
34
|
-
# def get_ssh_conn_str(self): return "ssh localhost"
|
|
35
|
-
# def get_remote_machine(self) -> MACHINE:
|
|
36
|
-
# if self._remote_machine is None:
|
|
37
|
-
# self._remote_machine = "Windows" if (self.run("$env:OS").op.rstrip("\n") == "Windows_NT" or self.run("echo %OS%").op == "Windows_NT") else "Linux"
|
|
38
|
-
# return self._remote_machine
|
|
39
|
-
# def get_remote_repr(self, add_machine: bool = False):
|
|
40
|
-
# _ = add_machine
|
|
41
|
-
# host = f"{getpass.getuser()}@{platform.node()}"
|
|
42
|
-
# return f"SelfSSH({host}) REMOTE"
|
|
43
|
-
# def get_local_repr(self, add_machine: bool = False): return self.get_remote_repr(add_machine=add_machine).replace("REMOTE", "LOCAL")
|
|
44
|
-
# def open_console(self, cmd: str = '', new_window: bool = True, terminal: Optional[str] = None, shell: str = "pwsh"):
|
|
45
|
-
# _ = cmd, shell, new_window, terminal
|
|
46
|
-
# # return Terminal().run_async("", new_window=True, shell=shell)
|
|
47
|
-
# # Terminal().run_async(*(self.get_ssh_conn_str(cmd=cmd).split(" ")), new_window=new_window, terminal=terminal, shell=shell)
|
|
48
|
-
# if platform.system() == "Windows":
|
|
49
|
-
# subprocess.Popen(["wt", "--profile", "pwsh"], stdin=subprocess.PIPE, shell=True)
|
|
50
|
-
# elif platform.system() in ["Linux", "Darwin"]:
|
|
51
|
-
# subprocess.Popen(["zellij --session haha"], shell=True, stdin=None, stdout=None, stderr=None)
|
|
52
|
-
# def copy_to_here(self, source: PLike = '', target: Optional[str] = '', z: bool = True, r: bool = True, desc: str = '', overwrite: bool = False):
|
|
53
|
-
# _ = source, target, z, r, desc, overwrite
|
|
54
|
-
# return None
|
|
55
|
-
# def copy_from_here(self, source: PLike = '', target: Optional[str] = '', z: bool = True, r: bool = True, desc: str = '', overwrite: bool = False):
|
|
56
|
-
# _ = source, target, z, r, desc, overwrite
|
|
57
|
-
# return None
|
|
Binary file
|
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
revChatGPT # talk to gpt from terminal
|
|
3
|
-
you-get # download content from internet with CLI
|
|
4
|
-
pydot # additionally required by tensorflow to plot a model
|
|
5
|
-
pyinstaller
|
|
6
|
-
glance
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# pip install python-lsp-server
|
|
10
|
-
# pip install --user pylint
|
|
11
|
-
# pip install --user yapf
|
|
12
|
-
# pip install --user isort
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
CONFIG_PATH=$HOME/.config/machineconfig/default_ve
|
|
4
|
-
|
|
5
|
-
# check below if VIRTUAL_ENV is set
|
|
6
|
-
if [ -z "$VIRTUAL_ENV" ]; then # no active ve ==> activate one.
|
|
7
|
-
if [ -z "$1" ]; then # nothing passed, activate default
|
|
8
|
-
|
|
9
|
-
if [ -f ./.ve_path ]; then # check if there is a .ve_path file in the current directory
|
|
10
|
-
name=$(cat ./.ve_path) # if yes, use it
|
|
11
|
-
# replace ~ with $HOME
|
|
12
|
-
name="${name/#\~/$HOME}"
|
|
13
|
-
source "$name/bin/activate"
|
|
14
|
-
elif [ -f $CONFIG_PATH ]; then # check if there is a default ve stored in ~/.machineconfog/default_ve
|
|
15
|
-
name=$(cat $CONFIG_PATH) # if yes, use it
|
|
16
|
-
source "$name/bin/activate"
|
|
17
|
-
else # no default ve found, using ve and setting it as default
|
|
18
|
-
name="ve"
|
|
19
|
-
source ~/venvs/$name/bin/activate
|
|
20
|
-
mkdir ~/.config/machineconfig -p || true
|
|
21
|
-
if [ -n "$VIRTUAL_ENV" ]; then
|
|
22
|
-
echo $VIRTUAL_ENV > $CONFIG_PATH
|
|
23
|
-
else
|
|
24
|
-
echo "❌ No virtual environment active, cant echo it to $CONFIG_PATH"
|
|
25
|
-
fi
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
else
|
|
29
|
-
name=$1
|
|
30
|
-
source ~/venvs/$name/bin/activate
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
if [ $? -eq 0 ]; then
|
|
34
|
-
echo "✅ Activated Virtual Environment $VIRTUAL_ENV "
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
else # there is an active_ve already.
|
|
38
|
-
if [ -n "$1" ] && [ "$HOME/venvs/$1" != "$VIRTUAL_ENV" ]; then # check if $1 is passed, if yes, activate it
|
|
39
|
-
echo "🔻 Deactivating virtual environment $VIRTUAL_ENV "
|
|
40
|
-
|
|
41
|
-
# if command -v deactivate >/dev/null 2>&1; then
|
|
42
|
-
# deactivate
|
|
43
|
-
# fi
|
|
44
|
-
if command -v deactivate >/dev/null 2>&1; then
|
|
45
|
-
DEACTIVATE_PATH=$(command -v deactivate)
|
|
46
|
-
if [[ $DEACTIVATE_PATH != *"ms-python"* ]]; then
|
|
47
|
-
deactivate
|
|
48
|
-
fi
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
name=$1
|
|
52
|
-
source ~/venvs/$name/bin/activate
|
|
53
|
-
|
|
54
|
-
if [ $? -eq 0 ]; then
|
|
55
|
-
echo "✅ Activated virtual environment $VIRTUAL_ENV "
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
else # user didn't pass anything.
|
|
59
|
-
|
|
60
|
-
if [ -f ./.ve_path ]; then # check if there is a .ve_path file in the current directory
|
|
61
|
-
name=$(cat ./.ve_path) # if yes, use it
|
|
62
|
-
name="${name/#\~/$HOME}" # replace ~ with $HOME
|
|
63
|
-
|
|
64
|
-
if [ "$name" = "$VIRTUAL_ENV" ]; then
|
|
65
|
-
echo "⚠️ Virtual environment $VIRTUAL_ENV already active"
|
|
66
|
-
else
|
|
67
|
-
echo "🔻 Deactivating virtual environment $VIRTUAL_ENV "
|
|
68
|
-
source "$name/bin/activate"
|
|
69
|
-
echo "✅ Activated Virtual Environment $VIRTUAL_ENV "
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
else
|
|
73
|
-
echo "⚠️ Virtual environment $VIRTUAL_ENV already active"
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# check if default is not defined, if so, define it as $VIRTUAL_ENV
|
|
79
|
-
if [ ! -f $CONFIG_PATH ]; then
|
|
80
|
-
mkdir ~/.config/machineconfig -p || true
|
|
81
|
-
if [ -n "$VIRTUAL_ENV" ]; then
|
|
82
|
-
echo $VIRTUAL_ENV > $CONFIG_PATH
|
|
83
|
-
else
|
|
84
|
-
echo "❌ No virtual environment active, cannot echo it to $CONFIG_PATH"
|
|
85
|
-
fi
|
|
86
|
-
fi
|
|
87
|
-
fi
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
from git import Repo
|
|
5
|
-
|
|
6
|
-
# def add_config_for_curor(repo_root: Path, config_f):
|
|
7
|
-
|
|
8
|
-
def add_ai_configs(repo_root: Path):
|
|
9
|
-
import machineconfig as mc
|
|
10
|
-
mc_root = Path(mc.__file__).parent
|
|
11
|
-
|
|
12
|
-
try:
|
|
13
|
-
_repo_obj = Repo(repo_root)
|
|
14
|
-
except Exception as e:
|
|
15
|
-
print(f"Error initializing git repo: {e}")
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
rules_dir = mc_root.joinpath("scripts/python/ai/rules")
|
|
19
|
-
|
|
20
|
-
python_rules_file = rules_dir.joinpath("python/dev.md")
|
|
21
|
-
|
|
22
|
-
tmp = repo_root.joinpath(".cursor/rules/python_dev.mdc")
|
|
23
|
-
tmp.parent.mkdir(parents=True, exist_ok=True)
|
|
24
|
-
tmp.write_text(data=python_rules_file.read_text(), encoding="utf-8")
|
|
25
|
-
|
|
26
|
-
# as per: https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions
|
|
27
|
-
# Copilot Chat on github website chat
|
|
28
|
-
tmp = repo_root.joinpath(".github/copilot-instructions.md")
|
|
29
|
-
tmp.parent.mkdir(parents=True, exist_ok=True)
|
|
30
|
-
tmp.write_text(data=python_rules_file.read_text(), encoding="utf-8")
|
|
31
|
-
|
|
32
|
-
tmp = repo_root.joinpath(".github/instructions/python01.instructions.md")
|
|
33
|
-
tmp.parent.mkdir(parents=True, exist_ok=True)
|
|
34
|
-
tmp.write_text(data=python_rules_file.read_text(), encoding="utf-8")
|
|
35
|
-
|
|
36
|
-
tmp = repo_root.joinpath("CLAUDE.md")
|
|
37
|
-
tmp.write_text(data=python_rules_file.read_text(), encoding="utf-8")
|
|
38
|
-
tmp = repo_root.joinpath("GEMINI.md")
|
|
39
|
-
tmp.write_text(data=python_rules_file.read_text(), encoding="utf-8")
|
|
40
|
-
|
|
41
|
-
dot_ai_dir = repo_root.joinpath(".ai")
|
|
42
|
-
dot_ai_dir.mkdir(parents=True, exist_ok=True)
|
|
43
|
-
dot_git_ignore_path = dot_ai_dir.joinpath(".gitignore")
|
|
44
|
-
if dot_git_ignore_path.exists():
|
|
45
|
-
dot_git_ignore_content = dot_git_ignore_path.read_text(encoding="utf-8")
|
|
46
|
-
to_add: list[str] = []
|
|
47
|
-
if ".links" not in dot_git_ignore_content: to_add.append(".links")
|
|
48
|
-
if "notebooks" not in dot_git_ignore_content: to_add.append("notebooks")
|
|
49
|
-
if ".ai" not in dot_git_ignore_content: to_add.append(".ai")
|
|
50
|
-
# if "*.ipynb"
|
|
51
|
-
if len(to_add) > 0:
|
|
52
|
-
dot_git_ignore_path.write_text(data=dot_git_ignore_content + "\n" + "\n".join(to_add), encoding="utf-8")
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if __name__ == "__main__":
|
|
56
|
-
add_ai_configs(repo_root=Path.cwd())
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Hello
|
|
4
|
-
=====
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Development Environment and tooling:
|
|
8
|
-
* To initialize a python project, use `uv init --python 3.13`
|
|
9
|
-
* To create virtual env, use `uv venv`.
|
|
10
|
-
* Please run any python file using `uv run $file.py`
|
|
11
|
-
* Same for tools, e.g. `un run python pytest blah`
|
|
12
|
-
* To add a package, use `uv add <package_name>`.
|
|
13
|
-
* Please never mention versions of package, so uv will bring the latest.
|
|
14
|
-
* On this note, I have to say that I am seriously concerned about AI using very outdated coding style.
|
|
15
|
-
* Use python 3.13 syntax features.
|
|
16
|
-
* Use modern standards, e.g. Path from pathlib.
|
|
17
|
-
|
|
18
|
-
* Never touch `pyproject.toml` manually, this file is strictly managed by `uv` tool on your behalf.
|
|
19
|
-
* If you are writing a test or any temporary script for discovering or undestanding something as an intermediate step, then,
|
|
20
|
-
please keep all your temp scripts and files under ./.ai/tmp_scripts directory, its included in .gitignore and won't litter the repo.
|
|
21
|
-
Its also nice if you create a subdirectory therein to contain relevant files for the task at hand, to avoid confusion with other files from other ai agents working simulataneously on other things.
|
|
22
|
-
|
|
23
|
-
# Style
|
|
24
|
-
* Please type hint all the code. Use fully quilaified types, not just generics like dict, list, etc, rather dict[str, int], list[float], etc.
|
|
25
|
-
* Use triple quotes and triple double quotes f-strings for string formatting and avoid when possible all goofy escaping when interpolation.
|
|
26
|
-
* Make sure all the code is rigorous, no lazy stuff.
|
|
27
|
-
* For example, always avoid default values in arguments of functions. Those are evil and cause confusion. Always be explicit
|
|
28
|
-
* Please avoid writing READMe files and avoid docstring and comments in code unless absolutely necessary. Use clear naming conventions instead of documenting.
|
|
29
|
-
|
|
30
|
-
# Preferences:
|
|
31
|
-
* If needed, opt for polars not pandas, whenever possible.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
$CONFIG_PATH = "$env:USERPROFILE\.config\machineconfig\default_ve"
|
|
3
|
-
|
|
4
|
-
if (!$env:VIRTUAL_ENV)
|
|
5
|
-
{ # no ve activated ==> activate one.
|
|
6
|
-
if (!$args[0]) { # nothing passed. >> use defaults
|
|
7
|
-
|
|
8
|
-
if (Test-Path ".\.ve_path") {
|
|
9
|
-
$name = Get-Content "./.ve_path" # use default file it exists
|
|
10
|
-
& "$name\Scripts\Activate.ps1"
|
|
11
|
-
}
|
|
12
|
-
elseif (Test-Path $CONFIG_PATH) {
|
|
13
|
-
$name = Get-Content $CONFIG_PATH # use default file it exists
|
|
14
|
-
& "$name\Scripts\Activate.ps1"
|
|
15
|
-
}
|
|
16
|
-
else { # no default file. >> use default name
|
|
17
|
-
$name = "ve"
|
|
18
|
-
mkdir $env:USERPROFILE\.config\machineconfig -ErrorAction SilentlyContinue
|
|
19
|
-
"$env:USERPROFILE\venvs\$name" > $CONFIG_PATH
|
|
20
|
-
& "$env:USERPROFILE\venvs\$name\Scripts\Activate.ps1"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
$name = $args[0]
|
|
26
|
-
& "$env:USERPROFILE\venvs\$name\Scripts\Activate.ps1"
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if ($?) { Write-Host "`u{2705} Activated virtual environment $env:VIRTUAL_ENV" }
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
else {
|
|
34
|
-
|
|
35
|
-
# if $args[0] is passed, it's a new ve to activate
|
|
36
|
-
# echo "$env:USERPROFILE\venvs\$args"
|
|
37
|
-
$ve_name = $args[0]
|
|
38
|
-
if ($args[0] -and "$env:VIRTUAL_ENV" -ne "$env:USERPROFILE\venvs\$ve_name") {
|
|
39
|
-
Write-Output "`u{1F53B} Deactivating virtual environment $env:VIRTUAL_ENV"
|
|
40
|
-
deactivate -ErrorAction SilentlyContinue
|
|
41
|
-
$name = $args[0]
|
|
42
|
-
& "$env:USERPROFILE\venvs\$name\Scripts\Activate.ps1"
|
|
43
|
-
if ($?) { Write-Host "`u{2705} Activated virtual environment $env:VIRTUAL_ENV " }
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
Write-Host "`u{26A0} Virtual environment '$env:VIRTUAL_ENV' is already activated "
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!(Test-Path $CONFIG_PATH)) {
|
|
50
|
-
New-Item -ItemType Directory -Path $env:USERPROFILE\.config\machineconfig -ErrorAction SilentlyContinue
|
|
51
|
-
$env:VIRTUAL_ENV > $CONFIG_PATH
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
File without changes
|
|
File without changes
|