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

@@ -7,7 +7,6 @@ from pathlib import Path
7
7
  def get_fire_command_and_artifact_files(func: FunctionType):
8
8
  from machineconfig.utils.meta import function_to_script
9
9
  py_script = function_to_script(func)
10
- from pathlib import Path
11
10
  from machineconfig.utils.accessories import randstr
12
11
  py_script_path = Path.home().joinpath("tmp_results", "tmp_py_scripts", f"tmp_{randstr(10)}.py")
13
12
  py_script_path.parent.mkdir(parents=True, exist_ok=True)
@@ -21,8 +20,9 @@ def get_fire_command_and_artifact_files(func: FunctionType):
21
20
  return tab_config, py_script_path
22
21
  def get_fire_command_and_artifact_files_v2(func: FunctionType):
23
22
  import inspect
24
- path = inspect.getfile(func)
25
- command_to_run = f"""$HOME/.local/bin/fire {path} {func.__name__} """
23
+ path = Path(inspect.getfile(func))
24
+ path_relative = path.relative_to(Path.home())
25
+ command_to_run = f"""$HOME/.local/bin/fire {path_relative} {func.__name__} """
26
26
  tab_config: TabConfig = {
27
27
  "command": command_to_run,
28
28
  "startDir": "$HOME",
@@ -37,17 +37,11 @@ class Read:
37
37
  raise ImportError(err) from err2
38
38
  @staticmethod
39
39
  def json(path: 'Path', r: bool = False, **kwargs: Any) -> Any: # return could be list or dict etc
40
- import json
41
- try:
42
- mydict = json.loads(Path(path).read_text(encoding='utf-8'), **kwargs)
43
- except Exception:
44
- import pyjson5
45
- mydict = pyjson5.loads(Path(path).read_text(encoding='utf-8'), **kwargs) # file has C-style comments.
46
- _ = r
47
- return mydict
40
+ from machineconfig.utils.io import read_json
41
+ return read_json(path, r=r, **kwargs)
48
42
  @staticmethod
49
43
  def yaml(path: 'Path', r: bool = False) -> Any: # return could be list or dict etc
50
- import yaml # type: ignore
44
+ import yaml
51
45
  with open(str(path), "r", encoding="utf-8") as file:
52
46
  mydict = yaml.load(file, Loader=yaml.FullLoader)
53
47
  _ = r
machineconfig/utils/io.py CHANGED
@@ -61,9 +61,14 @@ def read_json(path: "Path", r: bool = False, **kwargs: Any) -> Any: # return co
61
61
  try:
62
62
  mydict = json.loads(Path(path).read_text(encoding="utf-8"), **kwargs)
63
63
  except Exception:
64
- import pyjson5
65
-
66
- mydict = pyjson5.loads(Path(path).read_text(encoding="utf-8"), **kwargs) # file has C-style comments.
64
+ import re
65
+ def remove_comments(text: str) -> str:
66
+ # remove all // single-line comments
67
+ text = re.sub(r'//.*', '', text)
68
+ # remove all /* … */ block comments (non-greedy)
69
+ text = re.sub(r'/\*.*?\*/', '', text, flags=re.DOTALL)
70
+ return text
71
+ mydict = json.loads(remove_comments(Path(path).read_text(encoding="utf-8")), **kwargs)
67
72
  _ = r
68
73
  return mydict
69
74
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: machineconfig
3
- Version: 6.31
3
+ Version: 6.33
4
4
  Summary: Dotfiles management package
5
5
  Author-email: Alex Al-Saffar <programmer@usa.com>
6
6
  License: Apache 2.0
@@ -23,7 +23,6 @@ Requires-Dist: psutil>=7.0.0
23
23
  Requires-Dist: gitpython>=3.1.44
24
24
  Requires-Dist: pyfzf>=0.3.1
25
25
  Requires-Dist: rclone-python>=0.1.23
26
- Requires-Dist: pyjson5>=1.6.9
27
26
  Requires-Dist: questionary>=2.1.1
28
27
  Requires-Dist: typer-slim>=0.19.2
29
28
  Requires-Dist: typer>=0.19.2
@@ -25,7 +25,7 @@ machineconfig/cluster/sessions_managers/zellij_remote_manager.py,sha256=xzih0y8_
25
25
  machineconfig/cluster/sessions_managers/helpers/enhanced_command_runner.py,sha256=3vcQVg-HHa_WTxBGPtKMAdoSqJVa2EO5KAtrY8a6I3c,5264
26
26
  machineconfig/cluster/sessions_managers/helpers/load_balancer_helper.py,sha256=i5TRittC1IWTgMZNyG8AR5qq-3WrGp3xgIx2m5ktT7g,7526
27
27
  machineconfig/cluster/sessions_managers/utils/load_balancer.py,sha256=Y4RQmhROY6o7JXSJXRrBTkoAuEmu1gvmvN_7JKPw5sc,3178
28
- machineconfig/cluster/sessions_managers/utils/maker.py,sha256=HlMAWB0z8iMR-VRjvEHpjE8-Q5Wt7Bl86fBWvYLk-Cs,2074
28
+ machineconfig/cluster/sessions_managers/utils/maker.py,sha256=CeV9XrF5OhgNZe-qa916hNuy7mD9w-9TLOL3nLPXENs,2110
29
29
  machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py,sha256=OA50j16uUS9ZTjL38TLuR3jufIOln_EszMZpbWyejTo,6972
30
30
  machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py,sha256=Mitm7mKiKl5lT0OiEUHAqVg2Q21RjsKO1-hpJTHJ5lM,15196
31
31
  machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py,sha256=lApUy67_WhfaBXqt0meZSx_QvwiXjN0YLdyE3c7kP_s,6744
@@ -386,7 +386,7 @@ machineconfig/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
386
386
  machineconfig/utils/accessories.py,sha256=W_9dLzjwNTW5JQk_pe3B2ijQ1nA2-8Kdg2r7VBtzgQs,4340
387
387
  machineconfig/utils/code.py,sha256=f0K5abTIBBurK5pSM_VRtW_npFjK18UvIG_BEyzOv40,8912
388
388
  machineconfig/utils/installer.py,sha256=puFcMe-oNAeqTW0jz1NAEil8HRtxY4B6Z0VAeq_jH-o,10493
389
- machineconfig/utils/io.py,sha256=rzEwAnq-gyT29Y4CDHHGxAA6ddIIFOCxrqZ6dn0ALa4,2255
389
+ machineconfig/utils/io.py,sha256=4dSieoqZO8Vvi4vW8lLoITDHBvmFp4dtl3kyeZHQ6Co,2528
390
390
  machineconfig/utils/links.py,sha256=KM6vIn3hag9FYEzLSHP5MAM9tU_RStw2mCq2_OvmmZA,23672
391
391
  machineconfig/utils/meta.py,sha256=fDn7cpq6iqAPzX2eKLSK9DZb0870rluR7eLDx5NgNaw,5994
392
392
  machineconfig/utils/notifications.py,sha256=tuXIudcip0tEioG-bm8BbLr3FMDve4f6BktlznBhKxM,9013
@@ -409,7 +409,7 @@ machineconfig/utils/cloud/onedrive/transaction.py,sha256=m-aNcnWj_gfZVvJOSpkdIqj
409
409
  machineconfig/utils/files/ascii_art.py,sha256=cNJaJC07vx94fS44-tzgfbfBeCwXVrgpnWGBLUnfC38,5212
410
410
  machineconfig/utils/files/dbms.py,sha256=B7Mns8g774kfeXZwcuGWUpRnSgiOtS6khn8faRH5rQs,11390
411
411
  machineconfig/utils/files/headers.py,sha256=F-sudsZ1JyAcmZNO4FdcyhoClbCdb2vMlqceT36zfhE,3717
412
- machineconfig/utils/files/read.py,sha256=R1bvIIdiFX9N0JyzUISqVfewYFq30cY3z0kqSlKGtuA,4566
412
+ machineconfig/utils/files/read.py,sha256=QDxLEIYi0NcgAys97IVB6IUl4S9CiFP6TKGxUxRBJOM,4330
413
413
  machineconfig/utils/files/ouch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
414
414
  machineconfig/utils/files/ouch/decompress.py,sha256=7qPaEkMerBBXzeZyFn8hLODHZJv1aty-yGgwBxLgVys,1413
415
415
  machineconfig/utils/installer_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -422,8 +422,8 @@ machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoS
422
422
  machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
423
423
  machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
424
424
  machineconfig/utils/ssh_utils/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
425
- machineconfig-6.31.dist-info/METADATA,sha256=T8RD3gAr2SEH8yUy18IfZE73l3rSWo7yGTh25b8VHrc,3012
426
- machineconfig-6.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
427
- machineconfig-6.31.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
428
- machineconfig-6.31.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
429
- machineconfig-6.31.dist-info/RECORD,,
425
+ machineconfig-6.33.dist-info/METADATA,sha256=yIeBcgTsrlSHX1HobsVLU8Y89wCd3l52zxWxkCptfqk,2982
426
+ machineconfig-6.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
427
+ machineconfig-6.33.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
428
+ machineconfig-6.33.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
429
+ machineconfig-6.33.dist-info/RECORD,,