machineconfig 1.96__py3-none-any.whl → 1.97__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/scripts/linux/mcinit +27 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/init.py +56 -0
- machineconfig/scripts/python/ai/rules/python/dev.md +31 -0
- machineconfig/scripts/python/fire_jobs.py +8 -2
- machineconfig/scripts/windows/mcinit.ps1 +4 -0
- {machineconfig-1.96.dist-info → machineconfig-1.97.dist-info}/METADATA +1 -1
- {machineconfig-1.96.dist-info → machineconfig-1.97.dist-info}/RECORD +12 -7
- {machineconfig-1.96.dist-info → machineconfig-1.97.dist-info}/WHEEL +0 -0
- {machineconfig-1.96.dist-info → machineconfig-1.97.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
. $HOME/scripts/activate_ve 've'
|
|
4
|
+
|
|
5
|
+
# Generate random string of length 5
|
|
6
|
+
random_str=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
|
|
7
|
+
export op_script=$HOME/tmp_results/shells/$random_str/python_return_command.sh
|
|
8
|
+
# op_script=$HOME/tmp_results/shells/$random_str/python_return_command.sh
|
|
9
|
+
|
|
10
|
+
if [ -f "$op_script" ]; then
|
|
11
|
+
rm $op_script
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
python -m machineconfig.scripts.python.ai.init "$@"
|
|
16
|
+
|
|
17
|
+
if [ -f "$op_script" ]; then
|
|
18
|
+
echo "Running $op_script"
|
|
19
|
+
chmod +x $op_script
|
|
20
|
+
set -- # clear all positional parameters
|
|
21
|
+
source $op_script # sourcing the script means the args passed to the this script are passed to the sourced script which cofuses the sources script as it contains activate_ve and it doesn't understand first.sh arguments.
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if [ -n "$VIRTUAL_ENV" ]; then
|
|
26
|
+
deactivate || true
|
|
27
|
+
fi
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,56 @@
|
|
|
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())
|
|
@@ -0,0 +1,31 @@
|
|
|
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.
|
|
@@ -30,7 +30,8 @@ def main() -> None:
|
|
|
30
30
|
parser = argparse.ArgumentParser()
|
|
31
31
|
parser.add_argument("path", nargs='?', type=str, help="The directory containing the jobs", default=".")
|
|
32
32
|
parser.add_argument("function", nargs='?', type=str, help="Fuction to run", default=None)
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
parser.add_argument("--init", "-I", type=str, help="init this repo", default="")
|
|
34
35
|
parser.add_argument("--ve", "-v", type=str, help="virtual enviroment name", default="")
|
|
35
36
|
parser.add_argument("--cmd", "-B", action="store_true", help="Create a cmd fire command to launch the the job asynchronously.")
|
|
36
37
|
parser.add_argument("--interactive", "-i", action="store_true", help="Whether to run the job interactively using IPython")
|
|
@@ -57,7 +58,12 @@ def main() -> None:
|
|
|
57
58
|
print(f"❌ Failed to parse arguments: {ex}")
|
|
58
59
|
parser.print_help()
|
|
59
60
|
raise ex
|
|
60
|
-
path_obj = sanitize_path(PathExtended(
|
|
61
|
+
path_obj = sanitize_path(PathExtended.cwd())
|
|
62
|
+
|
|
63
|
+
if args.init != "":
|
|
64
|
+
from machineconfig.scripts.python.ai.init import add_ai_configs
|
|
65
|
+
add_ai_configs(repo_root=path_obj)
|
|
66
|
+
|
|
61
67
|
if not path_obj.exists():
|
|
62
68
|
path_obj = match_file_name(sub_string=args.path, search_root=PathExtended.cwd())
|
|
63
69
|
else: pass
|
|
@@ -152,6 +152,7 @@ machineconfig/scripts/linux/fzfg,sha256=ClGnJZUsIk4y0qs3W5iXGo-nd0FaqAHMsnh8uoXQ
|
|
|
152
152
|
machineconfig/scripts/linux/fzfrga,sha256=xSdws6ae28ZXkkqz_uupZ0MYw_vxE2qpLT2DLS3WITM,460
|
|
153
153
|
machineconfig/scripts/linux/gh_models,sha256=dcq6BLN5kU9Q_BSbXQJay0aFgKqnXnTZwlp9HZ-SMfE,167
|
|
154
154
|
machineconfig/scripts/linux/kill_process,sha256=lZ6LDzBPonQrVxCoc0R4HWW9x9hb5L5KjBhWugnxDNU,213
|
|
155
|
+
machineconfig/scripts/linux/mcinit,sha256=Oa1glh79q85Tx5ewI_dryHNH20KmMi58RlqQ0sczTg0,832
|
|
155
156
|
machineconfig/scripts/linux/mount_drive,sha256=zemKofv7hOmRN_V3qK0q580GkfWw3VdikyVVQyiu8j8,3514
|
|
156
157
|
machineconfig/scripts/linux/mount_nfs,sha256=HLWF7ocUjuDXaFFtOzEA9JlROTcsbDEhgosBdBpBUUA,2061
|
|
157
158
|
machineconfig/scripts/linux/mount_nw_drive,sha256=fZWV2x7Slne2c0NU-65qXBmTIeJNvjAHY-NqkDgoq1U,2527
|
|
@@ -189,7 +190,7 @@ machineconfig/scripts/python/devops_devapps_install.py,sha256=xddA4qmdYoMKnSR2eR
|
|
|
189
190
|
machineconfig/scripts/python/devops_update_repos.py,sha256=B6p9hCV4nVYGqYsWnu4i-Myne0k0V3rpXYqkTEl6gsQ,3921
|
|
190
191
|
machineconfig/scripts/python/dotfile.py,sha256=qq59lrE2JWCsD79cSqhbAy2IqCw2s-gWA_8YWKYi8Jc,2169
|
|
191
192
|
machineconfig/scripts/python/fire_agents.py,sha256=zSQ_ap7ToVzAcdGinAPdRWa50gJzpFMJa5JFnIOydJQ,3241
|
|
192
|
-
machineconfig/scripts/python/fire_jobs.py,sha256=
|
|
193
|
+
machineconfig/scripts/python/fire_jobs.py,sha256=ooZZkh-TMB_jmxuU-to-aDmP9rCbcpCSWSXlsGR8_a8,19729
|
|
193
194
|
machineconfig/scripts/python/ftpx.py,sha256=EGslb07y4fVVTlm5MFwQUJWej7ucN9TuISi4Vzph1gM,9691
|
|
194
195
|
machineconfig/scripts/python/get_zellij_cmd.py,sha256=6irkwgbeC18OWBnTBAF4i0klqZ6GlwagXaQIUBRFxVQ,596
|
|
195
196
|
machineconfig/scripts/python/gh_models.py,sha256=EE8U4mMIOeiLKlqDCVcr4BXwSUJ_yKaZV_7tQ_tqAyo,5396
|
|
@@ -212,16 +213,19 @@ machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc,sha256=CrRHLNL
|
|
|
212
213
|
machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc,sha256=ofEjvoXvuGSMnfm2ISBSKAyW8IG8eJwfjxEmKusFV1M,13591
|
|
213
214
|
machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc,sha256=Ww9YQ61mkCgLoXzyfWCYJwy4E2Q8erpILzZoF0AXUBQ,9365
|
|
214
215
|
machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc,sha256=Xa-bn9m5eGugaqmBiPIHhUOJT47SXtYswQYL4nhAW4A,5060
|
|
215
|
-
machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc,sha256=
|
|
216
|
+
machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc,sha256=uXED5tp8k3s1XYX1NoJEXup363eAk9zo0qm2rKy6BzY,11528
|
|
216
217
|
machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc,sha256=EQ2ryP_0dbQ9R6bLzcUnijxyLZsEjinAVDGY1uxD5w4,13287
|
|
217
218
|
machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc,sha256=Bo--NSxW10D7iO-VubPbwH_P-SJsb4hULXAwtx3WhFc,10426
|
|
218
219
|
machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc,sha256=mSfuG3ehhkbtZnU5PMDv9mS4LcMhj5NDKQBi882nFlc,10162
|
|
219
220
|
machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc,sha256=lqrkZtc8WDeFWf2KkU0AYD2hce-dtKQxHyRpYGPByqo,6590
|
|
220
221
|
machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc,sha256=N1AkkdkjZ7rtAbUB_xWnV8BypychQSw2eOJoEqNjiH8,5589
|
|
221
|
-
machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc,sha256=
|
|
222
|
+
machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc,sha256=nXHfprUt_TQb7plJ_e8Ab-XIyRmIDz8-fOLP3g61-Qs,21969
|
|
222
223
|
machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc,sha256=wMwq9RL120uZ2j6Zex8-SVubEFnaFZantHF2lcW6IwY,20181
|
|
223
224
|
machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc,sha256=vDgQ-_22m3AyNJKjrXHZEPOOFiZ4Zh2z9NtdQvCWdXY,891
|
|
224
225
|
machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc,sha256=ka0LHOdCwCu8R1RPCMBkndJrXXewG3UthfZl_l9gOZA,17583
|
|
226
|
+
machineconfig/scripts/python/ai/init.py,sha256=kDOP0SRz5fPftkUA2KCLIpDO-WvkmlpwDuqaPPPEJ-0,2202
|
|
227
|
+
machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc,sha256=eCeXgwIQcCxy_OY3SHGd3MqkKLDWBOB7t3Gc0elC9Rg,3522
|
|
228
|
+
machineconfig/scripts/python/ai/rules/python/dev.md,sha256=vfQGgq3g4d-BFD4vsan8p2NEOMZkmyREoOSiESSvye4,1860
|
|
225
229
|
machineconfig/scripts/python/archive/im2text.py,sha256=WLyic89vxi_pqQMzo-MOrGf39JEZjCdvDrXYUMVvZNY,1163
|
|
226
230
|
machineconfig/scripts/python/archive/tmate_conn.py,sha256=bUztIO87JReVFzcm7RsOokDXI6wD6u6cTSSWTBwO0Ec,1251
|
|
227
231
|
machineconfig/scripts/python/archive/tmate_start.py,sha256=UcgOxkTegHomeaZp0PeXuubJerzAA2mMzS_wxA1K074,1530
|
|
@@ -257,6 +261,7 @@ machineconfig/scripts/windows/fzfrga.bat,sha256=rU_KBMO6ii2EZ0akMnmDk9vpuhKSUZqk
|
|
|
257
261
|
machineconfig/scripts/windows/gpt.ps1,sha256=78oqOADLMuIZ7uY18lhcp_-IAIj57dkFh0uieanscjU,359
|
|
258
262
|
machineconfig/scripts/windows/grep.ps1,sha256=sUP_cXtqPEWLQ8_TdGJX7_-CO6CQYTP4pA-ZmkdPLdY,49
|
|
259
263
|
machineconfig/scripts/windows/kill_process.ps1,sha256=EESikl97AC3Wpjy8flS6tuSCso1FxDhLjwrvyCO21TM,189
|
|
264
|
+
machineconfig/scripts/windows/mcinit.ps1,sha256=9eqnE8_K0izDCEPU30FZyKnFPML-YSrUgmmOx6DQNA4,132
|
|
260
265
|
machineconfig/scripts/windows/mount_nfs.ps1,sha256=wGIxPe62AE3tLzjSIeYJGva4D_HiMCEsGUa8BsMyDkI,2073
|
|
261
266
|
machineconfig/scripts/windows/mount_nw.ps1,sha256=puxcfZc3ZCJerm8pj8OZGVoTYkhzp-h7oV-MrksSqIE,454
|
|
262
267
|
machineconfig/scripts/windows/mount_smb.ps1,sha256=PzYWpIO9BpwXjdWlUQL9pnMRnOGNSkxfh4bHukJFme8,69
|
|
@@ -431,7 +436,7 @@ machineconfig/utils/cloud/onedrive/transaction.py,sha256=AZljZsooDbHC6Qx494J8Sxl
|
|
|
431
436
|
machineconfig/utils/installer_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
432
437
|
machineconfig/utils/installer_utils/installer_abc.py,sha256=GrAzsCAq7C2JMgmIuodc2n8gBofQd87PFoZD9mPiTYM,5051
|
|
433
438
|
machineconfig/utils/installer_utils/installer_class.py,sha256=4_bibp2I9EDsYWEIS3zX35ksWwtZPiUdB_FfDzRm9Eg,16167
|
|
434
|
-
machineconfig-1.
|
|
435
|
-
machineconfig-1.
|
|
436
|
-
machineconfig-1.
|
|
437
|
-
machineconfig-1.
|
|
439
|
+
machineconfig-1.97.dist-info/METADATA,sha256=z_lJ-U1QunWY1lRmqa2oJt39eSkB6wgKsSHbznWSyOU,6987
|
|
440
|
+
machineconfig-1.97.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
441
|
+
machineconfig-1.97.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
442
|
+
machineconfig-1.97.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|