machineconfig 1.8__py3-none-any.whl → 1.91__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 (56) hide show
  1. machineconfig/__init__.py +4 -2
  2. machineconfig/jobs/python/check_installations.py +8 -6
  3. machineconfig/jobs/python/checkout_version.py +27 -32
  4. machineconfig/jobs/python/create_bootable_media.py +1 -1
  5. machineconfig/jobs/python/python_cargo_build_share.py +2 -2
  6. machineconfig/jobs/python/tasks.py +2 -2
  7. machineconfig/jobs/python_custom_installers/gh.py +53 -0
  8. machineconfig/jobs/python_custom_installers/hx.py +55 -0
  9. machineconfig/profile/create.py +26 -21
  10. machineconfig/profile/create_hardlinks.py +101 -0
  11. machineconfig/profile/shell.py +5 -5
  12. machineconfig/scripts/python/choose_wezterm_theme.py +96 -0
  13. machineconfig/scripts/python/cloud_copy.py +24 -17
  14. machineconfig/scripts/python/cloud_mount.py +20 -10
  15. machineconfig/scripts/python/cloud_repo_sync.py +109 -56
  16. machineconfig/scripts/python/cloud_sync.py +73 -68
  17. machineconfig/scripts/python/croshell.py +23 -14
  18. machineconfig/scripts/python/devops.py +19 -20
  19. machineconfig/scripts/python/devops_backup_retrieve.py +19 -10
  20. machineconfig/scripts/python/devops_devapps_install.py +81 -57
  21. machineconfig/scripts/python/devops_update_repos.py +5 -5
  22. machineconfig/scripts/python/dotfile.py +4 -4
  23. machineconfig/scripts/python/fire_jobs.py +139 -66
  24. machineconfig/scripts/python/ftpx.py +17 -7
  25. machineconfig/scripts/python/gh_models.py +53 -0
  26. machineconfig/scripts/python/mount_nfs.py +1 -1
  27. machineconfig/scripts/python/mount_nw_drive.py +3 -3
  28. machineconfig/scripts/python/mount_ssh.py +2 -3
  29. machineconfig/scripts/python/pomodoro.py +1 -1
  30. machineconfig/scripts/python/repos.py +26 -23
  31. machineconfig/scripts/python/scheduler.py +1 -1
  32. machineconfig/scripts/python/start_slidev.py +10 -4
  33. machineconfig/scripts/python/start_terminals.py +6 -5
  34. machineconfig/scripts/python/wifi_conn.py +34 -42
  35. machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
  36. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +1 -1
  37. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +3 -2
  38. machineconfig/utils/installer.py +167 -60
  39. machineconfig/utils/procs.py +2 -2
  40. machineconfig/utils/scheduling.py +3 -3
  41. machineconfig/utils/utils.py +137 -56
  42. machineconfig/utils/ve.py +171 -100
  43. machineconfig-1.91.dist-info/LICENSE +201 -0
  44. {machineconfig-1.8.dist-info → machineconfig-1.91.dist-info}/METADATA +31 -11
  45. machineconfig-1.91.dist-info/RECORD +69 -0
  46. {machineconfig-1.8.dist-info → machineconfig-1.91.dist-info}/WHEEL +1 -1
  47. machineconfig/jobs/script_installer/azure_data_studio.py +0 -22
  48. machineconfig/jobs/script_installer/bypass_paywall.py +0 -23
  49. machineconfig/jobs/script_installer/code.py +0 -34
  50. machineconfig/jobs/script_installer/docker_desktop.py +0 -41
  51. machineconfig/jobs/script_installer/ngrok.py +0 -29
  52. machineconfig/jobs/script_installer/skim.py +0 -21
  53. machineconfig/jobs/script_installer/wezterm.py +0 -34
  54. machineconfig-1.8.dist-info/RECORD +0 -70
  55. /machineconfig/jobs/{script_installer → python_custom_installers}/__init__.py +0 -0
  56. {machineconfig-1.8.dist-info → machineconfig-1.91.dist-info}/top_level.txt +0 -0
machineconfig/utils/ve.py CHANGED
@@ -2,10 +2,12 @@
2
2
  """python and ve installation related utils
3
3
  """
4
4
 
5
- from crocodile.file_management import P, Struct, modify_text, List
5
+ from crocodile.core import Struct, Save, List
6
+ from crocodile.file_management import P, Read
7
+
6
8
  from machineconfig.utils.utils import LIBRARY_ROOT
7
9
  import platform
8
- from dataclasses import dataclass
10
+ from dataclasses import dataclass, asdict
9
11
  from typing import Optional, Literal
10
12
 
11
13
 
@@ -23,8 +25,9 @@ class VE_INI:
23
25
 
24
26
 
25
27
  def get_ipython_profile(init_path: P):
28
+ """Relies on .ipy_profile"""
26
29
  a_path = init_path
27
- ipy_profile: str = "default"
30
+ ipy_profile: str="default"
28
31
  idx = len(a_path.parts)
29
32
  while idx >= 0:
30
33
  if a_path.joinpath(".ipy_profile").exists():
@@ -36,9 +39,8 @@ def get_ipython_profile(init_path: P):
36
39
  else:
37
40
  print(f"⚠️ Using default IPython: {ipy_profile}")
38
41
  return ipy_profile
39
-
40
-
41
- def get_ve_profile(init_path: P, strict: bool = False):
42
+ def get_ve_profile(init_path: P, strict: bool=False):
43
+ """Relies on .ve_path"""
42
44
  ve = ""
43
45
  tmp = init_path
44
46
  for _ in init_path.parents:
@@ -49,8 +51,21 @@ def get_ve_profile(init_path: P, strict: bool = False):
49
51
  tmp = tmp.parent
50
52
  if ve == "" and strict: raise ValueError("❌ No virtual environment found.")
51
53
  return ve
52
-
53
-
54
+ def get_ve_name_and_ipython_profile(init_path: P):
55
+ ve_name = "ve"
56
+ ipy_profile = "default"
57
+ tmp = init_path
58
+ for _ in init_path.parents:
59
+ if tmp.joinpath(".ve.ini").exists():
60
+ ini = Read.ini(tmp.joinpath(".ve.ini"))
61
+ ve_name = ini["specs"]["ve_name"]
62
+ # py_version = ini["specs"]["py_version"]
63
+ ipy_profile = ini["specs"]["ipy_profile"]
64
+ print(f"✅ Using Virtual Environment: {ve_name}")
65
+ print(f"✅ Using IPython profile: {ipy_profile}")
66
+ break
67
+ tmp = tmp.parent
68
+ return ve_name, ipy_profile
54
69
  def get_current_ve():
55
70
  import sys
56
71
  path = P(sys.executable) # something like ~\\venvs\\ve\\Scripts\\python.exe'
@@ -61,32 +76,32 @@ def get_current_ve():
61
76
  def get_installed_interpreters() -> list[P]:
62
77
  system = platform.system()
63
78
  if system == "Windows":
64
- tmp: list[P] = P.get_env().PATH.search("python.exe").reduce().list[1:]
79
+ tmp: list[P] = P.get_env().PATH.search("python.exe").reduce(func=lambda x, y: x+y).list[1:]
65
80
  else:
66
- tmp = list(set(List(P.get_env().PATH.search("python3*").reduce()).filter(lambda x: not x.is_symlink() and "-" not in x))) # type: ignore
81
+ items: List[P] = P.get_env().PATH.search("python3*").reduce(lambda x, y: x+y)
82
+ tmp = list(set(items.filter(lambda x: not x.is_symlink() and "-" not in x)))
67
83
  List(tmp).print()
68
84
  return list(set([P(x) for x in tmp]))
69
-
70
-
71
85
  def get_ve_specs(ve_path: P) -> dict[str, str]:
72
86
  ini = r"[mysection]\n" + ve_path.joinpath("pyvenv.cfg").read_text()
73
87
  import configparser
74
88
  config = configparser.ConfigParser()
75
89
  config.read_string(ini)
76
90
  res = dict(config['mysection'])
77
- res['version_major_minor'] = ".".join(res['version'].split(".")[0:2])
91
+ # try:
92
+ # res['version_major_minor'] = ".".join(res['version'].split(".")[0:2])
93
+ # except KeyError:
94
+ # # res['version_major_minor'] = ".".join(res['version_info'].split(".")[0:2])
78
95
  return res
79
96
 
80
97
 
81
- def get_ve_install_script(ve_name: Optional[str] = None, py_version: Optional[str] = None, install_crocodile_and_machineconfig: Optional[bool] = None,
82
- delete_if_exists: bool = True,
83
- system: Optional[Literal["Windows", "Linux"]] = None) -> str:
98
+ def get_ve_install_script(ve_name: Optional[str] = None, py_version: Optional[str] = None,
99
+ install_crocodile_and_machineconfig: Optional[bool] = None,
100
+ delete_if_exists: bool=True,
101
+ # system: Optional[Literal["Windows", "Linux"]] = None
102
+ ) -> str:
84
103
  from rich.console import Console
85
- if system is None:
86
- system_: str = platform.system()
87
- else: system_ = system
88
104
  console = Console()
89
-
90
105
  if py_version is None:
91
106
  print("\n\n")
92
107
  console.rule("Existing Python versions", style="bold red")
@@ -94,129 +109,185 @@ def get_ve_install_script(ve_name: Optional[str] = None, py_version: Optional[st
94
109
  List(res).print()
95
110
  print("\n\n")
96
111
  dotted_py_version = input("Enter python version (3.11): ") or "3.11"
97
- else: dotted_py_version = py_version
112
+ else:
113
+ dotted_py_version = py_version
98
114
 
99
115
  if ve_name is None:
100
- console.rule(f"Existing virtual environments")
116
+ console.rule("Existing virtual environments")
101
117
  for ve_path in P.home().joinpath("venvs").search("*", files=False):
102
- ve_specs = get_ve_specs(ve_path)
103
- # console.print(Panel(str(ve_specs), title=ve_path.stem, style="bold blue"))
118
+ try:
119
+ ve_specs = get_ve_specs(ve_path)
120
+ except Exception as _e:
121
+ continue
104
122
  Struct(ve_specs).print(title=ve_path.stem, as_config=True)
105
123
  ve_name = input("Enter virtual environment name (tst): ") or "tst"
106
124
 
107
- if install_crocodile_and_machineconfig is None: croco_mac = input("Install essential repos? (y/[n]): ") == "y"
108
- else: croco_mac = install_crocodile_and_machineconfig
125
+ if install_crocodile_and_machineconfig is None:
126
+ essential_repos = input("Install essential repos? (y/[n]): ") == "y"
127
+ other_repos = input("Input space separated other packages: ")
128
+ else:
129
+ essential_repos = install_crocodile_and_machineconfig
130
+ other_repos = ""
109
131
 
110
132
  env_path = P.home().joinpath("venvs", ve_name)
111
133
  if delete_if_exists and env_path.exists():
112
134
  sure = input(f"An existing environment found. Are you sure you want to delete {env_path} before making new one? (y/[n]): ") == "y"
113
- console.rule(f"Deleting existing enviroment with similar name")
135
+ console.rule("Deleting existing enviroment with similar name")
114
136
  env_path.delete(sure=sure)
115
137
 
116
- scripts = LIBRARY_ROOT.joinpath(f"setup_{system_.lower()}/ve.{'ps1' if system_ == 'Windows' else 'sh'}").read_text()
117
-
118
- variable_prefix = "$" if system_ == "Windows" else ""
119
- line1 = f"{variable_prefix}ve_name='{ve_name}'"
120
- line2 = f"{variable_prefix}py_version='{dotted_py_version}'"
121
- line_start = "# --- Define ve name and python version here ---"
122
- line_end = "# --- End of user defined variables ---"
123
- assert line_start in scripts and line_end in scripts, "Script template was mutated beyond recognition."
124
- scripts = scripts.split(line_start)[0] + "\n".join([line_start, line1, line2, line_end]) + scripts.split(line_end)[1]
125
-
126
- if croco_mac: # TODO make this more robust by removing sections of the script as opposed to word placeholders.
127
- text = LIBRARY_ROOT.joinpath(f"setup_{system_.lower()}/repos.{'ps1' if system_ == 'Windows' else 'sh'}").read_text()
128
- text = modify_text(txt_raw=text, txt_search="ve_name=", txt_alt=f"{variable_prefix}ve_name='{ve_name}'", replace_line=True)
129
- scripts += text
130
-
131
- # ve_ini_specs = VE_Specs(ve_name=ve_name, py_version=dotted_py_version, ipy_profile="default", os=system_)
132
- # ve_ini = VE_INI(specs=ve_ini_specs)
133
- return scripts
138
+ system = platform.system()
139
+ if system == "Windows":
140
+ script = get_ps1_ve_install_script(ve_name=ve_name, py_version=dotted_py_version, use_web=False, system=system)
141
+ elif system == "Linux":
142
+ script = get_bash_ve_install_script(ve_name=ve_name, py_version=dotted_py_version, use_web=False, system=system)
143
+ else:
144
+ raise NotImplementedError(f"System {system} not supported.")
134
145
 
146
+ if essential_repos:
147
+ if system == "Windows":
148
+ script += "\n" + get_ps1_repos_install_script(ve_name=ve_name, use_web=False, system=system)
149
+ elif system == "Linux":
150
+ script += "\n" + get_bash_repos_install_script(ve_name=ve_name, use_web=False, system=system)
151
+ else:
152
+ raise NotImplementedError(f"System {system} not supported.")
153
+
154
+ if other_repos != "":
155
+ # TODO: check the quivalent full path of uv on windows $HOME/.local/bin/
156
+ script += "\nuv pip install " + other_repos
157
+ # target = repo_root.joinpath(".venv")
158
+ # source = P.home().joinpath("venvs", ve_name)
159
+ # if system == "Windows": cmd = f'New-Item -ItemType SymbolicLink -Path "{target}" -Target "{source}"'
160
+ # elif system == "Linux": cmd = f'ln -s "{source}" "{target}"'
161
+ # else: raise NotImplementedError(f"System {system} not supported.")
162
+ # script += f"\n{cmd}"
163
+
164
+ link_ve: str=input("Create symlinks? [y/[n]] ") == "y"
165
+ if link_ve: create_symlinks(repo_root=P.cwd(), ve_name=ve_name, dotted_py_version=dotted_py_version, system=system, ipy_profile="default")
166
+ make_installation_recipe(repo_root=P.cwd(), ve_name=ve_name, py_version=dotted_py_version)
167
+ return script
135
168
 
136
- def get_ve_install_script_from_specs(repo_root: str, system: Literal["Windows", "Linux"]):
137
- from crocodile.file_management import Read, Save
138
- ini_file = P(repo_root).joinpath(".ve.ini")
139
- assert ini_file.exists(), f"File {ini_file} does not exist."
140
- ini = Read.ini(ini_file)
141
- ve_name = ini["specs"]["ve_name"]
142
- py_version = ini["specs"]["py_version"]
143
- ipy_profile = ini["specs"]["ipy_profile"]
144
169
 
145
- # repo_root = ini_file.with_name("requirements.txt").parent
170
+ def create_symlinks(repo_root: P, ve_name: str, dotted_py_version: str, system: Literal["Windows", "Linux"], ipy_profile: str):
171
+ from machineconfig.utils.utils import symlink_func
172
+ source = repo_root.joinpath(".venv")
173
+ target = P.home().joinpath("venvs", ve_name)
174
+ target.mkdir(exist_ok=True, parents=True) # if ve not created yet, make up a folder at least, so that symlink can be created, then this folder is either populated or recreated by ve creation script.
175
+ symlink_func(this=source, to_this=target)
146
176
 
147
177
  # for backward compatibility:
148
- ini_file.with_name(".ve_path").write_text(f"~/venvs/{ve_name}")
149
- ini_file.with_name(".ipy_profile").write_text(ipy_profile)
150
-
151
- # vscode:
152
- if not system == "Windows": # symlinks on windows require admin rights.
153
- P(repo_root).joinpath(".venv").symlink_to(P.home().joinpath("venvs", ve_name))
154
-
155
- vscode_settings = P(repo_root).joinpath(".vscode/settings.json")
156
- if vscode_settings.exists():
157
- settings = Read.json(vscode_settings)
178
+ repo_root.joinpath(".ve_path").write_text(f"~/venvs/{ve_name}")
179
+ repo_root.joinpath(".ipy_profile").write_text(ipy_profile)
180
+
181
+ ve_ini_specs = VE_Specs(ve_name=ve_name, py_version=dotted_py_version, ipy_profile="default", os=system)
182
+ ve_ini = VE_INI(specs=ve_ini_specs)
183
+ Save.ini(obj=asdict(ve_ini), path=repo_root.joinpath(".ve.ini"))
184
+ vscode = repo_root.joinpath(".vscode/settings.json")
185
+ if vscode.exists():
186
+ settings = Read.json(vscode)
158
187
  else:
159
188
  settings = {}
160
189
  if system == "Windows":
161
- settings["python.defaultInterpreterPath"] = f"~/venvs/{ve_name}/Scripts/python.exe"
190
+ settings["python.defaultInterpreterPath"] = P.home().joinpath("venvs", ve_name, "Scripts", "python.exe").as_posix()
162
191
  elif system == "Linux":
163
- settings["python.defaultInterpreterPath"] = f"~/venvs/{ve_name}/bin/python"
164
- pass
192
+ settings["python.defaultInterpreterPath"] = P.home().joinpath("venvs", ve_name, "bin", "python").as_posix()
165
193
  else:
166
194
  raise NotImplementedError(f"System {system} not supported.")
167
- Save.json(obj=settings, path=vscode_settings, indent=4)
195
+ Save.json(obj=settings, path=vscode, indent=4)
168
196
 
169
- base_path = P(repo_root).joinpath("versions", "init").create()
170
- if system == "Windows":
171
- script = get_ps1_install_template(ve_name=ve_name, py_version=py_version)
172
- base_path.joinpath("install_ve.ps1").write_text(script)
173
- elif system == "Linux":
174
- script = get_bash_install_template(ve_name=ve_name, py_version=py_version)
175
- base_path.joinpath("install_ve.sh").write_text(script)
176
- else:
177
- raise NotImplementedError(f"System {system} not supported.")
178
197
 
179
- base_path.joinpath("install_requirements.ps1").write_text(get_install_requirements_template(repo_root=P(repo_root)))
180
- base_path.joinpath("install_requirements.sh").write_text(get_install_requirements_template(repo_root=P(repo_root)))
198
+ def make_installation_recipe(repo_root: str, ve_name: str, py_version: str):
199
+ subpath = "versions/init"
200
+ base_path = P(repo_root).joinpath(subpath).create()
181
201
 
182
- return script
202
+ system = "Windows"
203
+ path3 = base_path.joinpath("install_requirements.ps1")
204
+ if path3.exists(): print(f"❌ File already exists @ {path3}, skipping.")
205
+ else:
206
+ install_ve_script = get_ps1_ve_install_script(ve_name=ve_name, py_version=py_version, use_web=True, system=system)
207
+ install_req_script = get_install_requirements_template(repo_root=P(repo_root), requirements_subpath=subpath, ve_name=ve_name, system=system)
208
+ path3.write_text(install_ve_script + "\n" + install_req_script)
209
+
210
+ system= "Linux"
211
+ path4 = base_path.joinpath("install_requirements.sh")
212
+ if path4.exists(): print(f"❌ File already exists @ {path4}, skipping.")
213
+ else:
214
+ install_ve_script = get_bash_ve_install_script(ve_name=ve_name, py_version=py_version, use_web=True, system=system)
215
+ install_req_script = get_install_requirements_template(repo_root=P(repo_root), requirements_subpath=subpath, ve_name=ve_name, system=system)
216
+ path4.write_text(install_ve_script + "\n" + install_req_script)
217
+ return None
183
218
 
184
219
 
185
- def get_ps1_install_template(ve_name: str, py_version: str):
220
+ def get_ps1_ve_install_script(ve_name: str, py_version: str, use_web: bool, system: Literal["Windows", "Linux"]):
221
+ if use_web:
222
+ install_line = """(Invoke-WebRequest https://bit.ly/cfgvewindows).Content | Invoke-Expression"""
223
+ else:
224
+ install_line = LIBRARY_ROOT.joinpath(f"setup_{system.lower()}/ve.{'ps1' if system == 'Windows' else 'sh'}").read_text()
186
225
  template = f"""
187
226
  $ve_name = '{ve_name}'
188
227
  $py_version = '{py_version}' # type: ignore
189
- (Invoke-WebRequest https://bit.ly/cfgvewindows).Content | Invoke-Expression
228
+ {install_line}
190
229
  . $HOME/scripts/activate_ve $ve_name
191
230
  """
192
231
  return template
193
- def get_bash_install_template(ve_name: str, py_version: str):
232
+ def get_bash_ve_install_script(ve_name: str, py_version: str, use_web: bool, system: Literal["Windows", "Linux"]):
233
+ if use_web: install_line = """curl -L https://bit.ly/cfgvelinux | bash"""
234
+ else:
235
+ install_line = LIBRARY_ROOT.joinpath(f"setup_{system.lower()}/ve.{'ps1' if system == 'Windows' else 'sh'}").read_text()
194
236
  template = f"""
195
237
  export ve_name='{ve_name}'
196
238
  export py_version='{py_version}' # type: ignore
197
- curl -L https://bit.ly/cfgvelinux | bash
239
+ {install_line}
198
240
  . $HOME/scripts/activate_ve $ve_name
241
+ """
242
+ return template
243
+ def get_ps1_repos_install_script(ve_name: str, use_web: bool, system: Literal["Windows", "Linux"]):
244
+ if use_web: install_line = """(Invoke-WebRequest https://bit.ly/cfgreposwindows).Content | Invoke-Expression"""
245
+ else:
246
+ install_line = LIBRARY_ROOT.joinpath(f"setup_{system.lower()}/repos.{'ps1' if system == 'Windows' else 'sh'}").read_text()
247
+ template = f"""
248
+ $ve_name = '{ve_name}'
249
+ . $HOME/scripts/activate_ve $ve_name
250
+ {install_line}
199
251
  """
200
252
  return template
201
253
 
202
-
203
- def get_install_requirements_template(repo_root: P):
254
+ def get_bash_repos_install_script(ve_name: str, use_web: bool, system: Literal["Windows", "Linux"]):
255
+ if use_web: install_line = """curl -L https://bit.ly/cfgreposlinux | bash"""
256
+ else:
257
+ install_line = LIBRARY_ROOT.joinpath(f"setup_{system.lower()}/repos.{'ps1' if system == 'Windows' else 'sh'}").read_text()
258
+ template = f"""
259
+ export ve_name='{ve_name}'
260
+ . $HOME/scripts/activate_ve $ve_name
261
+ {install_line}
262
+ """
263
+ return template
264
+ def get_install_requirements_template(repo_root: P, requirements_subpath: str, ve_name: str, system: Literal["Windows", "Linux"]):
265
+ if system == 'Windows':
266
+ set_e_equivalent = 'Set-StrictMode -Version Latest' # PowerShell equivalent
267
+ install_line = """(Invoke-WebRequest https://bit.ly/cfgreposwindows).Content | Invoke-Expression"""
268
+ activate_ve = fr"""$HOME\venvs\{ve_name}\Scripts\Activate.ps1 -ErrorAction Stop """
269
+ elif system == 'Linux':
270
+ set_e_equivalent = 'set -e' # Bash equivalent
271
+ install_line = """curl -L https://bit.ly/cfgreposlinux | bash"""
272
+ activate_ve = fr""". $HOME/venvs/{ve_name}/bin/activate """
273
+ else: raise NotImplementedError(f"System {system} not supported.")
204
274
  return f"""
275
+
205
276
  # This is a template that is meant to be modified manually to install requirements.txt and editable packages.
206
277
  # one can dispense with this and install libraries manually and on adhoc-basis and then use version_checkout utility.
207
- cd $HOME/{repo_root.as_posix()}
208
- . $HOME/scripts/activate_ve
209
- pip install -r requirements.txt
210
- pip install -e .
211
-
212
- # cd ~/code; git clone https://github.com/thisismygitrepo/crocodile.git --origin origin
213
- # cd ~/code/crocodile; git remote set-url origin https://github.com/thisismygitrepo/crocodile.git
214
- # cd ~/code/crocodile; git remote add origin https://github.com/thisismygitrepo/crocodile.git
215
- # cd ~/code/crocodile; pip install -e .
216
-
217
- # cd ~/code; git clone https://github.com/thisismygitrepo/machineconfig --origin origin
218
- # cd ~/code/machineconfig; git remote set-url origin https://github.com/thisismygitrepo/machineconfig
219
- # cd ~/code/machineconfig; git remote add origin https://github.com/thisismygitrepo/machineconfig
220
- # cd ~/code/machineconfig; pip install -e .
278
+
279
+ # mkdir -p $HOME/{repo_root.rel2home().as_posix()}
280
+ # cd $HOME/{repo_root.rel2home().as_posix()}
281
+ # git clone URL --depth 2
282
+
283
+ {set_e_equivalent}
284
+
285
+ cd $HOME/{repo_root.rel2home().as_posix()}
286
+
287
+ {activate_ve}
288
+
289
+ # {install_line}
290
+ pip install -r {requirements_subpath}/requirements.txt
291
+ # pip install -e .
221
292
 
222
293
  """
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.