machineconfig 5.37__py3-none-any.whl → 5.39__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/remote/script_execution.py +0 -1
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +2 -4
- machineconfig/jobs/installer/check_installations.py +2 -2
- machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +12 -12
- machineconfig/jobs/installer/installer_data.json +53 -2
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -3
- machineconfig/profile/create_helper.py +26 -0
- machineconfig/profile/{create.py → create_links.py} +6 -6
- machineconfig/profile/{create_frontend.py → create_links_export.py} +6 -10
- machineconfig/profile/{shell.py → create_shell_profile.py} +12 -37
- machineconfig/scripts/linux/{share_cloud.sh → other/share_cloud.sh} +3 -0
- machineconfig/scripts/linux/z_ls +2 -2
- machineconfig/scripts/python/agents.py +0 -1
- machineconfig/scripts/python/ai/initai.py +3 -4
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +0 -1
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +0 -1
- machineconfig/scripts/python/ai/solutions/generic.py +1 -0
- machineconfig/scripts/python/croshell.py +12 -2
- machineconfig/scripts/python/croshell_helpers/start_slidev.py +2 -2
- machineconfig/scripts/python/devops.py +4 -21
- machineconfig/scripts/python/devops_helpers/cli_config.py +8 -8
- machineconfig/scripts/python/devops_helpers/cli_config_dotfile.py +3 -3
- machineconfig/scripts/python/devops_helpers/cli_nw.py +2 -1
- machineconfig/scripts/python/devops_helpers/cli_repos.py +1 -3
- machineconfig/scripts/python/devops_helpers/cli_self.py +22 -9
- machineconfig/scripts/python/devops_helpers/cli_share_server.py +109 -0
- machineconfig/scripts/python/devops_helpers/cli_terminal.py +35 -23
- machineconfig/scripts/python/devops_helpers/devops_status.py +7 -80
- machineconfig/scripts/python/devops_helpers/devops_update_repos.py +64 -45
- machineconfig/scripts/python/devops_helpers/themes/choose_pwsh_theme.ps1 +16 -15
- machineconfig/scripts/python/devops_navigator.py +183 -80
- machineconfig/scripts/python/fire_jobs.py +4 -1
- machineconfig/scripts/python/ftpx.py +0 -1
- machineconfig/scripts/python/helpers_fire/{fire_gemini.py → agentic_frameworks/fire_gemini.py} +12 -9
- machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_qwen.py +43 -0
- machineconfig/scripts/python/helpers_fire/fire_agents_help_launch.py +4 -4
- machineconfig/scripts/python/helpers_fire/template.ps1 +29 -0
- machineconfig/scripts/python/helpers_fire/template.sh +1 -1
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +3 -3
- machineconfig/scripts/python/interactive.py +5 -4
- machineconfig/scripts/python/nw/mount_nfs +1 -1
- machineconfig/scripts/python/nw/mount_nw_drive +1 -2
- machineconfig/scripts/python/repos_helpers/count_lines_frontend.py +1 -1
- machineconfig/scripts/python/repos_helpers/entrypoint.py +2 -2
- machineconfig/scripts/python/repos_helpers/record.py +2 -2
- machineconfig/scripts/python/sessions_helpers/sessions_multiprocess.py +3 -1
- machineconfig/scripts/windows/{mount_nfs.ps1 → mounts/mount_nfs.ps1} +1 -3
- machineconfig/scripts/windows/{mount_ssh.ps1 → mounts/mount_ssh.ps1} +1 -1
- machineconfig/settings/lf/linux/lfrc +4 -7
- machineconfig/settings/lf/windows/lfrc +4 -22
- machineconfig/settings/lvim/windows/archive/config_additional.lua +0 -6
- machineconfig/settings/pistol/pistol.conf +1 -1
- machineconfig/settings/shells/bash/init.sh +9 -8
- machineconfig/settings/shells/pwsh/init.ps1 +10 -4
- machineconfig/settings/svim/linux/init.toml +0 -4
- machineconfig/settings/svim/windows/init.toml +0 -3
- machineconfig/setup_linux/web_shortcuts/interactive.sh +22 -0
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +34 -1
- machineconfig/utils/files/dbms.py +4 -1
- machineconfig/utils/installer_utils/installer.py +12 -0
- machineconfig/utils/installer_utils/installer_abc.py +26 -9
- machineconfig/utils/installer_utils/installer_class.py +1 -1
- machineconfig/utils/io.py +0 -18
- machineconfig/utils/scheduler.py +3 -4
- machineconfig/utils/source_of_truth.py +2 -4
- machineconfig/utils/ssh.py +1 -1
- {machineconfig-5.37.dist-info → machineconfig-5.39.dist-info}/METADATA +8 -4
- {machineconfig-5.37.dist-info → machineconfig-5.39.dist-info}/RECORD +84 -114
- machineconfig/jobs/windows/start_terminal.ps1 +0 -6
- machineconfig/jobs/windows/startup_file.cmd +0 -2
- machineconfig/scripts/cloud/init.sh +0 -105
- machineconfig/scripts/linux/agents +0 -2
- machineconfig/scripts/linux/cloud +0 -2
- machineconfig/scripts/linux/croshell +0 -3
- machineconfig/scripts/linux/devops +0 -2
- machineconfig/scripts/linux/fire +0 -2
- machineconfig/scripts/linux/ftpx +0 -2
- machineconfig/scripts/linux/kill_process +0 -2
- machineconfig/scripts/linux/sessions +0 -2
- machineconfig/scripts/linux/start_terminals +0 -3
- machineconfig/scripts/windows/agents.ps1 +0 -1
- machineconfig/scripts/windows/cloud.ps1 +0 -1
- machineconfig/scripts/windows/croshell.ps1 +0 -1
- machineconfig/scripts/windows/devops.ps1 +0 -1
- machineconfig/scripts/windows/fire.ps1 +0 -1
- machineconfig/scripts/windows/ftpx.ps1 +0 -1
- machineconfig/scripts/windows/gpt.ps1 +0 -1
- machineconfig/scripts/windows/grep.ps1 +0 -2
- machineconfig/scripts/windows/kill_process.ps1 +0 -1
- machineconfig/scripts/windows/nano.ps1 +0 -3
- machineconfig/scripts/windows/pomodoro.ps1 +0 -1
- machineconfig/scripts/windows/reload_path.ps1 +0 -3
- machineconfig/scripts/windows/scheduler.ps1 +0 -1
- machineconfig/scripts/windows/sessions.ps1 +0 -1
- machineconfig/scripts/windows/snapshot.ps1 +0 -1
- machineconfig/scripts/windows/start_slidev.ps1 +0 -1
- machineconfig/scripts/windows/start_terminals.ps1 +0 -1
- machineconfig/scripts/windows/wsl_rdp_windows_port_forwarding.ps1 +0 -46
- machineconfig/scripts/windows/wsl_ssh_windows_port_forwarding.ps1 +0 -76
- machineconfig/setup_linux/machineconfig.sh +0 -20
- machineconfig/setup_windows/machineconfig.ps1 +0 -27
- /machineconfig/scripts/linux/{share_nfs → other/share_nfs} +0 -0
- /machineconfig/scripts/linux/{share_smb → other/share_smb} +0 -0
- /machineconfig/scripts/linux/{start_docker → other/start_docker} +0 -0
- /machineconfig/scripts/linux/{switch_ip → other/switch_ip} +0 -0
- /machineconfig/scripts/{windows/share_nfs.ps1 → python/helpers_fire/agentic_frameworks/__init__.py} +0 -0
- /machineconfig/scripts/python/helpers_fire/{fire_crush.json → agentic_frameworks/fire_crush.json} +0 -0
- /machineconfig/scripts/python/helpers_fire/{fire_crush.py → agentic_frameworks/fire_crush.py} +0 -0
- /machineconfig/scripts/python/helpers_fire/{fire_cursor_agents.py → agentic_frameworks/fire_cursor_agents.py} +0 -0
- /machineconfig/scripts/windows/{mount_nw.ps1 → mounts/mount_nw.ps1} +0 -0
- /machineconfig/scripts/windows/{mount_smb.ps1 → mounts/mount_smb.ps1} +0 -0
- /machineconfig/scripts/windows/{share_cloud.cmd → mounts/share_cloud.cmd} +0 -0
- /machineconfig/scripts/windows/{share_smb.ps1 → mounts/share_smb.ps1} +0 -0
- /machineconfig/scripts/windows/{unlock_bitlocker.ps1 → mounts/unlock_bitlocker.ps1} +0 -0
- {machineconfig-5.37.dist-info → machineconfig-5.39.dist-info}/WHEEL +0 -0
- {machineconfig-5.37.dist-info → machineconfig-5.39.dist-info}/entry_points.txt +0 -0
- {machineconfig-5.37.dist-info → machineconfig-5.39.dist-info}/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ def analyze_repo_development(repo_path: str = typer.Argument(..., help="Path to
|
|
|
6
6
|
from machineconfig.scripts.python.repos_helpers import count_lines
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
count_lines_path = Path(count_lines.__file__)
|
|
9
|
-
# --project $HOME/code/machineconfig --group plot
|
|
9
|
+
# --project $HOME/code/ machineconfig --group plot
|
|
10
10
|
cmd = f"""uv run --python 3.13 --with machineconfig[plot] {count_lines_path} analyze-over-time {repo_path}"""
|
|
11
11
|
from machineconfig.utils.code import run_shell_script
|
|
12
12
|
run_shell_script(cmd)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
from typing import Optional
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from machineconfig.utils.source_of_truth import
|
|
6
|
+
from machineconfig.utils.source_of_truth import CONFIG_ROOT, DEFAULTS_PATH
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
9
|
|
|
@@ -39,7 +39,7 @@ def resolve_spec_path(directory: Optional[str], cloud: Optional[str]) -> Path:
|
|
|
39
39
|
repos_root = resolve_directory(directory)
|
|
40
40
|
from machineconfig.utils.path_extended import PathExtended
|
|
41
41
|
if not repos_root.exists() or repos_root.name != "repos.json":
|
|
42
|
-
candidate = Path(
|
|
42
|
+
candidate = Path(CONFIG_ROOT).joinpath("repos").joinpath(PathExtended(repos_root).rel2home()).joinpath("repos.json")
|
|
43
43
|
repos_root = candidate
|
|
44
44
|
if not repos_root.exists():
|
|
45
45
|
cloud_name: Optional[str]
|
|
@@ -3,7 +3,7 @@ from pathlib import Path
|
|
|
3
3
|
from machineconfig.utils.schemas.repos.repos_types import GitVersionInfo, RepoRecordDict, RepoRemote
|
|
4
4
|
|
|
5
5
|
from machineconfig.utils.schemas.repos.repos_types import RepoRecordFile
|
|
6
|
-
from machineconfig.utils.source_of_truth import
|
|
6
|
+
from machineconfig.utils.source_of_truth import CONFIG_ROOT
|
|
7
7
|
from machineconfig.utils.io import save_json
|
|
8
8
|
|
|
9
9
|
from typing import Optional
|
|
@@ -242,7 +242,7 @@ def main(repos_root: Path):
|
|
|
242
242
|
tree_structure = build_tree_structure(repo_records, repos_root)
|
|
243
243
|
print(tree_structure)
|
|
244
244
|
|
|
245
|
-
save_path =
|
|
245
|
+
save_path = CONFIG_ROOT.joinpath("repos").joinpath(repos_root.rel2home()).joinpath("repos.json")
|
|
246
246
|
save_json(obj=res, path=save_path, indent=4)
|
|
247
247
|
pprint(f"📁 Result saved at {PathExtended(save_path)}")
|
|
248
248
|
print(">>>>>>>>> Finished Recording")
|
|
@@ -36,8 +36,10 @@ def create_from_function(
|
|
|
36
36
|
ve_root_from_file, ipy_profile = get_ve_path_and_ipython_profile(choice_file)
|
|
37
37
|
if ipy_profile is None:
|
|
38
38
|
ipy_profile = "default"
|
|
39
|
+
if ve_root_from_file is None:
|
|
40
|
+
raise ValueError(f"Could not determine virtual environment for file {choice_file}. Please ensure it is within a recognized project structure.")
|
|
39
41
|
|
|
40
|
-
_activate_ve_line = get_ve_activate_line(ve_root=ve_root_from_file
|
|
42
|
+
_activate_ve_line = get_ve_activate_line(ve_root=ve_root_from_file)
|
|
41
43
|
|
|
42
44
|
# ========================= choosing function to run
|
|
43
45
|
if function is None or function.strip() == "":
|
|
@@ -17,10 +17,8 @@ $sharePath=''
|
|
|
17
17
|
$driveLetter=''
|
|
18
18
|
$options = "rw,sec=sys,no_subtree_check"
|
|
19
19
|
|
|
20
|
-
# . activate_ve
|
|
21
|
-
. $HOME/code/machineconfig/.venv/Scripts/activate.ps1
|
|
22
20
|
|
|
23
|
-
python -m machineconfig.scripts.python.mount_nfs
|
|
21
|
+
uv run python -m machineconfig.scripts.python.mount_nfs
|
|
24
22
|
. $HOME/tmp_results/shells/python_return_command.ps1
|
|
25
23
|
|
|
26
24
|
# Configure NFS server
|
|
@@ -7,7 +7,7 @@ $user = ''
|
|
|
7
7
|
$sharePath = ''
|
|
8
8
|
$driveLetter = ''
|
|
9
9
|
|
|
10
|
-
uv run --python 3.13 --
|
|
10
|
+
uv run --python 3.13 --with machineconfig python -m machineconfig.scripts.python.mount_ssh
|
|
11
11
|
|
|
12
12
|
net use T: \\sshfs.kr\$user@$host.local
|
|
13
13
|
# this worked: net use T: \\sshfs\alex@alex-p51s-5.local
|
|
@@ -14,8 +14,8 @@ set number true # show line numbers
|
|
|
14
14
|
|
|
15
15
|
set preview true # preview file on the right pane
|
|
16
16
|
# set previewer chafa --format sixel --work 9 --optimize 9 --stretch --zoom --size 140x80
|
|
17
|
-
set previewer
|
|
18
|
-
set cleaner
|
|
17
|
+
set previewer $HOME/.config/machineconfig/settings/lf/linux/exe/previewer.sh
|
|
18
|
+
set cleaner $HOME/.config/machineconfig/settings/lf/linux/exe/cleaner.sh
|
|
19
19
|
# set previewer pistol
|
|
20
20
|
|
|
21
21
|
# set sixels true
|
|
@@ -48,7 +48,7 @@ set ratios '1:2:3' # ratio of pane widths
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
# test image viewer
|
|
51
|
-
map Q
|
|
51
|
+
map Q !$HOME/.config/machineconfig/settings/lf/linux/exe/previewer.sh "$f"
|
|
52
52
|
|
|
53
53
|
# key bindings
|
|
54
54
|
map vmap v # default is invert
|
|
@@ -70,7 +70,6 @@ map <c-u> # half-up
|
|
|
70
70
|
# e edit
|
|
71
71
|
map e # edit modal key.
|
|
72
72
|
map eh $hx $f
|
|
73
|
-
map eH !source ~/code/machineconfig/.venv/bin/activate;hx $f
|
|
74
73
|
map en $nano $f
|
|
75
74
|
map el $lvim $f
|
|
76
75
|
map ev $nvim $f
|
|
@@ -86,7 +85,7 @@ map ww bash
|
|
|
86
85
|
# map wp $powershell
|
|
87
86
|
map wr $~/scripts/croshell
|
|
88
87
|
# map wm $cmd
|
|
89
|
-
map i
|
|
88
|
+
map i !~/.config/machineconfig/settings/lf/linux/exe/previewer.sh $f
|
|
90
89
|
map I !cat $f | gum pager
|
|
91
90
|
map R $~/scripts/croshell -r $f
|
|
92
91
|
map O $~/scripts/croshell -rj $f
|
|
@@ -116,10 +115,8 @@ map jc cd ~/code
|
|
|
116
115
|
map jd cd ~/data
|
|
117
116
|
map jD cd ~/Downloads
|
|
118
117
|
map jx cd ~/dotfiles
|
|
119
|
-
# map jm cd ~/code/machineconfig/src/machineconfig
|
|
120
118
|
map jh cd ~
|
|
121
119
|
map jj $~/scripts/croshell -j --read $f
|
|
122
|
-
# map jj $lvim ~/code/machineconfig/src/machineconfig/settings/lf/linux/lfrc
|
|
123
120
|
|
|
124
121
|
# from https://github.com/gokcehan/lf/wiki/Integrations#zoxide
|
|
125
122
|
cmd zi ${{
|
|
@@ -24,8 +24,6 @@ set ifs "\n"
|
|
|
24
24
|
# see this: https://github.com/ahrm/dotfiles/tree/main/lf-windows/lf_scripts
|
|
25
25
|
# https://github.com/NikitaIvanovV/ctpv
|
|
26
26
|
|
|
27
|
-
# set previewer ~/code/machineconfig/src/machineconfig/settings/lf/leftpane_previewer.ps1
|
|
28
|
-
# set previewer ~\AppData\Local\Microsoft\WindowsApps\bat.exe --color=always --theme=base16
|
|
29
27
|
# also see pistol file previewer.
|
|
30
28
|
# set shell pwsh # too slow.
|
|
31
29
|
# set ignorecase true
|
|
@@ -75,7 +73,7 @@ map ww $powershell
|
|
|
75
73
|
map wp $pwsh
|
|
76
74
|
map wc $~/scripts/croshell.ps1
|
|
77
75
|
map wm $cmd
|
|
78
|
-
map i
|
|
76
|
+
map i $~/.config/machineconfig/settings/lf/windows/previewer.ps1 $env:f
|
|
79
77
|
map R $powershell $env:USERPROFILE/scripts/croshell.ps1 -r $env:f
|
|
80
78
|
|
|
81
79
|
# o file/folder Operations
|
|
@@ -103,31 +101,15 @@ map jc cd ~/code
|
|
|
103
101
|
map jd cd ~/data
|
|
104
102
|
map jD cd ~/Downloads
|
|
105
103
|
map jx cd ~/dotfiles
|
|
106
|
-
map jm cd ~/code/machineconfig/src/machineconfig
|
|
107
104
|
map jh cd ~
|
|
108
105
|
map ja cd $env:LOCALAPPDATA
|
|
109
106
|
map jA cd $env:APPDATA
|
|
110
|
-
map jj $pwsh -File $env:USERPROFILE/.local/bin/lvim.ps1 -- $
|
|
107
|
+
map jj $pwsh -File $env:USERPROFILE/.local/bin/lvim.ps1 -- $HOME/.config/machineconfig/settings/lf/windows/lfrc
|
|
111
108
|
|
|
112
109
|
|
|
113
110
|
|
|
114
111
|
# m make
|
|
115
112
|
map m
|
|
116
|
-
map md
|
|
117
|
-
map mf
|
|
118
|
-
|
|
119
|
-
# =================== JUNK ======================
|
|
120
|
-
# Find and Jump
|
|
121
|
-
#cmd fzfg $~/scripts/fzfg.ps1 $args[0]
|
|
122
|
-
map J push :$~/scripts/fzfg<space>
|
|
123
|
-
map F $~/code/machineconfig/src/machineconfig/settings/lf/windows/fzf_edit.ps1
|
|
124
|
-
map S cd $~/code/machineconfig/src/machineconfig/settings/lf/windows/tst.ps1
|
|
125
|
-
map T $~/code/machineconfig/src/machineconfig/settings/lf/windows/cd_tere.ps1
|
|
126
|
-
map Z $~/code/machineconfig/src/machineconfig/settings/lf/windows/cd_zoxide2.ps1
|
|
127
|
-
|
|
128
|
-
cmd doc $lf -doc | bat
|
|
129
|
-
|
|
130
|
-
# cmd pre-cd $~/code/machineconfig/src/machineconfig/settings/lf/windows/precd.ps1
|
|
131
|
-
# cmd on-cd $~/code/machineconfig/src/machineconfig/settings/lf/windows/oncd.ps1
|
|
132
|
-
# cmd on-quit ~/code/machineconfig/src/machineconfig/settings/lf/windows/onquit.ps1
|
|
113
|
+
map md $~/.config/machineconfig/settings/lf/windows/mkdir.ps1
|
|
114
|
+
map mf $~/.config/machineconfig/settings/lf/windows/mkfile.ps1
|
|
133
115
|
|
|
@@ -5,4 +5,4 @@ inode/directory lsd -la %pistol-filename%
|
|
|
5
5
|
|
|
6
6
|
fpath /var/src/my-bash-project/bin/[^/]+$ bat --map-syntax :bash --paging=never --color=always %pistol-filename%
|
|
7
7
|
|
|
8
|
-
image/.* /home/alex/
|
|
8
|
+
image/.* /home/alex/.config/machineconfig/settings/lf/linux/exe/previewer.sh %pistol-filename% %pistol-extra0% %pistol-extra1% %pistol-extra2% %pistol-extra3%
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# 🛠️ Bash Shell Configuration and Initialization
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
# export PATH="~/.local/bin:~/code/machineconfig/src/machineconfig/scripts/linux:~/dotfiles/scripts/linux:~/.nix-profile/bin:/usr/games:$PATH"
|
|
6
|
-
|
|
7
4
|
add_to_path_if_not_already() {
|
|
8
5
|
for dir in "$@"; do
|
|
9
6
|
if [[ ! $PATH =~ (^|:)"${dir}"(:|$) ]]; then
|
|
@@ -11,12 +8,13 @@ add_to_path_if_not_already() {
|
|
|
11
8
|
fi
|
|
12
9
|
done
|
|
13
10
|
}
|
|
11
|
+
CONFIG_ROOT="$HOME/.config/machineconfig"
|
|
14
12
|
|
|
15
13
|
# 📂 Add directories to PATH
|
|
16
14
|
add_to_path_if_not_already \
|
|
17
15
|
"$HOME/.local/bin" \
|
|
18
16
|
"$HOME/.cargo/bin" \
|
|
19
|
-
"$
|
|
17
|
+
"$CONFIG_ROOT/scripts/linux" \
|
|
20
18
|
"$HOME/dotfiles/scripts/linux" \
|
|
21
19
|
"$HOME/.nix-profile/bin" \
|
|
22
20
|
"/home/linuxbrew/.linuxbrew/bin" \
|
|
@@ -26,10 +24,13 @@ add_to_path_if_not_already \
|
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
# echo "Sourcing scripts ..."
|
|
29
|
-
|
|
30
|
-
. $
|
|
31
|
-
. $
|
|
32
|
-
|
|
27
|
+
. $CONFIG_ROOT/settings/broot/br.sh
|
|
28
|
+
. $CONFIG_ROOT/settings/lf/linux/exe/lfcd.sh
|
|
29
|
+
. $CONFIG_ROOT/settings/tere/terecd.sh
|
|
30
|
+
|
|
31
|
+
if [ -d $CONFIG_ROOT ]; then
|
|
32
|
+
source $CONFIG_ROOT/settings/shells/bash/commands.sh
|
|
33
|
+
fi
|
|
33
34
|
|
|
34
35
|
# set alias l to lsd -la
|
|
35
36
|
alias l='lsd -la'
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
$MAC_ROOT = "$HOME\code\machineconfig"
|
|
4
|
+
|
|
3
5
|
function Add-ToPathIfNotAlready {
|
|
4
6
|
param (
|
|
5
7
|
[Parameter(Mandatory=$true)]
|
|
@@ -14,7 +16,7 @@ function Add-ToPathIfNotAlready {
|
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
Add-ToPathIfNotAlready -Directories @(
|
|
17
|
-
"$
|
|
19
|
+
"$MAC_ROOT\src\machineconfig\scripts\windows",
|
|
18
20
|
"$HOME\dotfiles\scripts\windows",
|
|
19
21
|
"C:\Program Files (x86)\GnuWin32\bin",
|
|
20
22
|
"C:\Program Files\CodeBlocks\MinGW\bin",
|
|
@@ -27,9 +29,13 @@ Add-ToPathIfNotAlready -Directories @(
|
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
# sources ================================================================
|
|
30
|
-
. $
|
|
31
|
-
. $
|
|
32
|
-
. $
|
|
32
|
+
. $MAC_ROOT\src\machineconfig\settings\broot\brootcd.ps1
|
|
33
|
+
. $MAC_ROOT\src\machineconfig\settings\lf\windows\lfcd.ps1
|
|
34
|
+
. $MAC_ROOT\src\machineconfig\settings\tere\terecd.ps1
|
|
35
|
+
|
|
36
|
+
if (Test-Path "$MAC_ROOT" -PathType Container) {
|
|
37
|
+
. "$MAC_ROOT\src\machineconfig\settings\shells\pwsh\commands.ps1"
|
|
38
|
+
}
|
|
33
39
|
|
|
34
40
|
function lsdla { lsd -la }
|
|
35
41
|
Set-Alias -Name l -Value lsdla -Option AllScope
|
|
@@ -3,4 +3,26 @@
|
|
|
3
3
|
devops() {
|
|
4
4
|
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig devops "$@"
|
|
5
5
|
}
|
|
6
|
+
agents() {
|
|
7
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig agents "$@"
|
|
8
|
+
}
|
|
9
|
+
cloud() {
|
|
10
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig cloud "$@"
|
|
11
|
+
}
|
|
12
|
+
croshell() {
|
|
13
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig croshell "$@"
|
|
14
|
+
}
|
|
15
|
+
fire() {
|
|
16
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig fire "$@"
|
|
17
|
+
}
|
|
18
|
+
ftpx() {
|
|
19
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig ftpx "$@"
|
|
20
|
+
}
|
|
21
|
+
kill_process() {
|
|
22
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig kill_process "$@"
|
|
23
|
+
}
|
|
24
|
+
sessions() {
|
|
25
|
+
"$HOME/.local/bin/uv" run --python 3.13 --with machineconfig sessions "$@"
|
|
26
|
+
}
|
|
27
|
+
|
|
6
28
|
echo "devops command is now defined in this shell session."
|
|
@@ -4,4 +4,37 @@ iex (iwr "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/s
|
|
|
4
4
|
function devops {
|
|
5
5
|
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig devops $args
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
function cloud {
|
|
9
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig cloud $args
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function croshell {
|
|
13
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig croshell $args
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function agents {
|
|
17
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig agents $args
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function fire {
|
|
21
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig fire $args
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ftpx {
|
|
25
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig ftpx $args
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function sessions {
|
|
29
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig sessions $args
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function kill_process {
|
|
33
|
+
& "$HOME\.local\bin\uv.exe" run --python 3.13 --with machineconfig kill_process $args
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# DONT use this line in combination with activated virtual enviroment.
|
|
38
|
+
# $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
39
|
+
# uv run --python 3.13 --no-dev --with machineconfig start_slidev $args
|
|
40
|
+
# uv run --python 3.13 --no-dev --with machineconfig pomodoro $args
|
|
@@ -167,7 +167,10 @@ class DBMS:
|
|
|
167
167
|
url = path
|
|
168
168
|
else:
|
|
169
169
|
path_str = str(P(path))
|
|
170
|
-
|
|
170
|
+
if path_str.endswith('.duckdb'):
|
|
171
|
+
url = f'duckdb:///{path_str}'
|
|
172
|
+
else:
|
|
173
|
+
url = f'sqlite:///{path_str}'
|
|
171
174
|
connect_args = {}
|
|
172
175
|
if share_across_threads and 'sqlite' in url:
|
|
173
176
|
connect_args['check_same_thread'] = False
|
|
@@ -180,6 +180,18 @@ def install_clis(clis_names: list[str]):
|
|
|
180
180
|
return None
|
|
181
181
|
|
|
182
182
|
|
|
183
|
+
def install_if_missing(which: str):
|
|
184
|
+
# uv run --python 3.13 --with machineconfig devops install ttyd
|
|
185
|
+
from machineconfig.utils.installer_utils.installer_abc import check_tool_exists
|
|
186
|
+
exists = check_tool_exists(which)
|
|
187
|
+
if exists:
|
|
188
|
+
print(f"✅ {which} is already installed.")
|
|
189
|
+
return
|
|
190
|
+
print(f"⏳ {which} not found. Installing...")
|
|
191
|
+
from machineconfig.utils.installer_utils.installer import main
|
|
192
|
+
main(which=which)
|
|
193
|
+
|
|
194
|
+
|
|
183
195
|
if __name__ == "__main__":
|
|
184
196
|
from machineconfig.utils.schemas.installer.installer_types import InstallerData
|
|
185
197
|
from machineconfig.utils.installer_utils.installer_class import Installer
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
from machineconfig.utils.path_extended import PathExtended
|
|
3
2
|
from machineconfig.utils.source_of_truth import WINDOWS_INSTALL_PATH, LINUX_INSTALL_PATH, INSTALL_VERSION_ROOT
|
|
4
3
|
|
|
@@ -9,7 +8,7 @@ import platform
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def find_move_delete_windows(downloaded_file_path: PathExtended, exe_name: Optional[str] = None, delete: bool = True, rename_to: Optional[str] = None):
|
|
12
|
-
print(
|
|
11
|
+
print("🔍 PROCESSING WINDOWS EXECUTABLE 🔍")
|
|
13
12
|
if exe_name is not None and ".exe" in exe_name:
|
|
14
13
|
exe_name = exe_name.replace(".exe", "")
|
|
15
14
|
if downloaded_file_path.is_file():
|
|
@@ -54,7 +53,7 @@ def find_move_delete_windows(downloaded_file_path: PathExtended, exe_name: Optio
|
|
|
54
53
|
|
|
55
54
|
|
|
56
55
|
def find_move_delete_linux(downloaded: PathExtended, tool_name: str, delete: Optional[bool] = True, rename_to: Optional[str] = None):
|
|
57
|
-
print(
|
|
56
|
+
print("🔍 PROCESSING LINUX EXECUTABLE 🔍")
|
|
58
57
|
if downloaded.is_file():
|
|
59
58
|
exe = downloaded
|
|
60
59
|
print(f"📄 Found direct executable file: {exe}")
|
|
@@ -114,14 +113,32 @@ def find_move_delete_linux(downloaded: PathExtended, tool_name: str, delete: Opt
|
|
|
114
113
|
|
|
115
114
|
def check_tool_exists(tool_name: str) -> bool:
|
|
116
115
|
if platform.system() == "Windows":
|
|
117
|
-
|
|
118
|
-
res1 = any([Path(WINDOWS_INSTALL_PATH).joinpath(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
tool_name_exe = tool_name.replace(".exe", "") + ".exe"
|
|
117
|
+
res1 = any([Path(WINDOWS_INSTALL_PATH).joinpath(tool_name_exe).is_file(), Path.home().joinpath("AppData/Roaming/npm").joinpath(tool_name_exe).is_file()])
|
|
118
|
+
if res1:
|
|
119
|
+
return True
|
|
120
|
+
tool_name_no_exe = tool_name.replace(".exe", "")
|
|
121
|
+
res2 = any([Path(WINDOWS_INSTALL_PATH).joinpath(tool_name_no_exe).is_file(), Path.home().joinpath("AppData/Roaming/npm").joinpath(tool_name_no_exe).is_file()])
|
|
122
|
+
return res2
|
|
122
123
|
elif platform.system() in ["Linux", "Darwin"]:
|
|
123
124
|
root_path = Path(LINUX_INSTALL_PATH)
|
|
124
|
-
|
|
125
|
+
standard_checks = [
|
|
126
|
+
Path("/usr/local/bin").joinpath(tool_name).is_file(),
|
|
127
|
+
Path("/usr/bin").joinpath(tool_name).is_file(),
|
|
128
|
+
root_path.joinpath(tool_name).is_file()
|
|
129
|
+
]
|
|
130
|
+
if any(standard_checks):
|
|
131
|
+
return True
|
|
132
|
+
# Check for npm packages via nvm
|
|
133
|
+
npm_check = False
|
|
134
|
+
try:
|
|
135
|
+
result = subprocess.run(["node", "--version"], capture_output=True, text=True, check=True)
|
|
136
|
+
version = result.stdout.strip().lstrip('v')
|
|
137
|
+
nvm_bin_path = Path.home() / ".nvm" / "versions" / "node" / f"v{version}" / "bin" / tool_name
|
|
138
|
+
npm_check = nvm_bin_path.is_file()
|
|
139
|
+
except subprocess.CalledProcessError:
|
|
140
|
+
pass
|
|
141
|
+
return npm_check
|
|
125
142
|
else:
|
|
126
143
|
raise NotImplementedError(f"platform {platform.system()} not implemented")
|
|
127
144
|
def is_executable_in_path(executable_name: str) -> bool:
|
|
@@ -30,7 +30,7 @@ class Installer:
|
|
|
30
30
|
|
|
31
31
|
def _get_exe_name(self) -> str:
|
|
32
32
|
"""Derive executable name from app name by converting to lowercase and removing spaces."""
|
|
33
|
-
return self.installer_data["appName"].lower().replace(" ", "").replace("-", "")
|
|
33
|
+
return self.installer_data["appName"].lower().replace(" ", "") # .replace("-", "")
|
|
34
34
|
|
|
35
35
|
def install_robust(self, version: Optional[str]) -> str:
|
|
36
36
|
try:
|
machineconfig/utils/io.py
CHANGED
|
@@ -35,24 +35,6 @@ def save_json(obj: Any, path: PathLike, indent: Optional[int] = None, verbose: b
|
|
|
35
35
|
return Path(path_obj)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
# def save_toml(obj: Mapping[str, Any], path: PathLike, verbose: bool = False) -> Path:
|
|
39
|
-
# path_obj = _ensure_parent(path)
|
|
40
|
-
# with open(path_obj, "w", encoding="utf-8") as fh:
|
|
41
|
-
# toml.dump(obj, fh)
|
|
42
|
-
# if verbose:
|
|
43
|
-
# print(f"Saved toml -> {path_obj}")
|
|
44
|
-
# return Path(path_obj)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# def save_yaml(obj: Any, path: PathLike, verbose: bool = False) -> Path:
|
|
48
|
-
# path_obj = _ensure_parent(path)
|
|
49
|
-
# with open(path_obj, "w", encoding="utf-8") as fh:
|
|
50
|
-
# yaml.safe_dump(obj, fh, sort_keys=False)
|
|
51
|
-
# if verbose:
|
|
52
|
-
# print(f"Saved yaml -> {path_obj}")
|
|
53
|
-
# return Path(path_obj)
|
|
54
|
-
|
|
55
|
-
|
|
56
38
|
def save_ini(path: PathLike, obj: Mapping[str, Mapping[str, Any]], verbose: bool = False) -> Path:
|
|
57
39
|
cp = configparser.ConfigParser()
|
|
58
40
|
for section, values in obj.items():
|
machineconfig/utils/scheduler.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
from pathlib import Path
|
|
3
|
-
from typing import Callable, Optional, Union, Any,
|
|
3
|
+
from typing import Callable, Optional, Union, Any, Protocol, List, TypeVar
|
|
4
4
|
import logging
|
|
5
5
|
import time
|
|
6
6
|
from datetime import datetime, timezone, timedelta
|
|
@@ -144,18 +144,17 @@ class Scheduler:
|
|
|
144
144
|
raise ex
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
T = TypeVar("T")
|
|
147
|
+
# T = TypeVar("T")
|
|
148
148
|
T2 = TypeVar("T2")
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
def to_pickle(obj: Any, path: Path) -> None:
|
|
152
152
|
import pickle
|
|
153
|
-
|
|
154
153
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
155
154
|
path.write_bytes(pickle.dumps(obj))
|
|
156
155
|
|
|
157
156
|
|
|
158
|
-
class Cache
|
|
157
|
+
class Cache[T](): # This class helps to accelrate access to latest data coming from expensive function. The class has two flavours, memory-based and disk-based variants."""
|
|
159
158
|
def __init__(
|
|
160
159
|
self, source_func: Callable[[], T], expire: timedelta, logger: LoggerTemplate, path: Optional[Path] = None, saver: Callable[[T, Path], Any] = to_pickle, reader: Callable[[Path], T] = from_pickle, name: Optional[str] = None
|
|
161
160
|
) -> None:
|
|
@@ -6,14 +6,12 @@ import machineconfig
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
EXCLUDE_DIRS = [".links", ".ai", ".venv", ".git", ".idea", ".vscode", "node_modules", "__pycache__", ".mypy_cache"]
|
|
9
|
-
|
|
10
9
|
LIBRARY_ROOT = Path(machineconfig.__file__).resolve().parent
|
|
11
|
-
REPO_ROOT = LIBRARY_ROOT.parent.parent
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
CONFIG_ROOT = Path.home().joinpath(".config/machineconfig")
|
|
14
12
|
DEFAULTS_PATH = Path.home().joinpath("dotfiles/machineconfig/defaults.ini")
|
|
15
13
|
|
|
16
|
-
INSTALL_VERSION_ROOT =
|
|
14
|
+
INSTALL_VERSION_ROOT = CONFIG_ROOT.joinpath("cli_tools_installers/versions")
|
|
17
15
|
INSTALL_TMP_DIR = Path.home().joinpath("tmp_results", "tmp_installers")
|
|
18
16
|
|
|
19
17
|
# LINUX_INSTALL_PATH = '/usr/local/bin'
|
machineconfig/utils/ssh.py
CHANGED
|
@@ -219,7 +219,7 @@ class SSH: # inferior alternative: https://github.com/fabric/fabric
|
|
|
219
219
|
assert '"' not in cmd, 'Avoid using `"` in your command. I dont know how to handle this when passing is as command to python in pwsh command.'
|
|
220
220
|
if not return_obj:
|
|
221
221
|
return self.run(
|
|
222
|
-
cmd=f"""$HOME/.local/bin/
|
|
222
|
+
cmd=f"""$HOME/.local/bin/devops self run-python -c "{cmd}\n""" + '"',
|
|
223
223
|
desc=desc or f"run_py on {self.get_remote_repr()}",
|
|
224
224
|
verbose=verbose,
|
|
225
225
|
strict_err=strict_err,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: machineconfig
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.39
|
|
4
4
|
Summary: Dotfiles management package
|
|
5
5
|
Author-email: Alex Al-Saffar <programmer@usa.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -9,7 +9,7 @@ Project-URL: Bug Tracker, https://github.com/thisismygitrepo/machineconfig/issue
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python:
|
|
12
|
+
Requires-Python: <3.14,>=3.13
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
Requires-Dist: cryptography>=44.0.2
|
|
15
15
|
Requires-Dist: fire>=0.7.0
|
|
@@ -24,9 +24,9 @@ Requires-Dist: gitpython>=3.1.44
|
|
|
24
24
|
Requires-Dist: pyfzf>=0.3.1
|
|
25
25
|
Requires-Dist: rclone-python>=0.1.23
|
|
26
26
|
Requires-Dist: pyjson5>=1.6.9
|
|
27
|
-
Requires-Dist: typer-slim>=0.19.2
|
|
28
27
|
Requires-Dist: questionary>=2.1.1
|
|
29
|
-
Requires-Dist: typer>=0.19.2
|
|
28
|
+
Requires-Dist: typer-slim>=0.19.2
|
|
29
|
+
Requires-Dist: euporie>=2.8.14
|
|
30
30
|
Provides-Extra: windows
|
|
31
31
|
Requires-Dist: pywin32; extra == "windows"
|
|
32
32
|
Provides-Extra: plot
|
|
@@ -86,5 +86,9 @@ iex (iwr bit.ly/cfgwindows).Content
|
|
|
86
86
|
# Author
|
|
87
87
|
Alex Al-Saffar. [email](mailto:programmer@usa.com)
|
|
88
88
|
|
|
89
|
+
# Contributor
|
|
90
|
+
Ruby Chan. [email](mailto:ruby.chan@sa.gov.au)
|
|
91
|
+
|
|
92
|
+
|
|
89
93
|
[](https://github.com/ashutosh00710/github-readme-activity-graph)
|
|
90
94
|
|