making-with-code-cli 1.3.0__tar.gz → 2.0.0__tar.gz
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.
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/PKG-INFO +1 -1
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/setup/__init__.py +1 -4
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/setup/tasks.py +8 -32
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/pyproject.toml +1 -1
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/README.md +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/cli.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/curriculum.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/errors.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/git_backend/__init__.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/git_backend/base_backend.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/git_backend/mwc_backend.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/git_wrapper.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/helpers.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/mwc_accounts_api.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/settings.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/styles.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/submit.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/__init__.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/check.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/gitea_api/api.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/gitea_api/exceptions.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/log.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/setup.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/status.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/student_repo_functions.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/student_repos.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/test/__init__.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/test/test_module.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/update.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/update/__init__.py +0 -0
- {making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/version.py +0 -0
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/setup/__init__.py
RENAMED
|
@@ -29,7 +29,6 @@ from making_with_code_cli.setup.tasks import (
|
|
|
29
29
|
choose_course,
|
|
30
30
|
choose_editor,
|
|
31
31
|
MWCShellConfig,
|
|
32
|
-
InstallCurl,
|
|
33
32
|
InstallHomebrew,
|
|
34
33
|
InstallXCode,
|
|
35
34
|
WriteShellConfig,
|
|
@@ -85,8 +84,6 @@ def setup(ctx, config, debug):
|
|
|
85
84
|
|
|
86
85
|
task_classes = [
|
|
87
86
|
MWCShellConfig,
|
|
88
|
-
InstallCurl,
|
|
89
|
-
InstallHomebrew,
|
|
90
87
|
InstallXCode,
|
|
91
88
|
InstallPoetry,
|
|
92
89
|
WriteShellConfig,
|
|
@@ -106,7 +103,7 @@ def setup(ctx, config, debug):
|
|
|
106
103
|
except Exception as e:
|
|
107
104
|
errors.append(task)
|
|
108
105
|
click.echo(error('-' * 80))
|
|
109
|
-
click.echo(error(f"{task.
|
|
106
|
+
click.echo(error(f"{task.description} failed"))
|
|
110
107
|
if debug:
|
|
111
108
|
click.echo(debug_fmt(traceback.format_exc(), preformatted=True))
|
|
112
109
|
if errors:
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/setup/tasks.py
RENAMED
|
@@ -51,14 +51,11 @@ class PlatformNotSupported(Exception):
|
|
|
51
51
|
class Platform(Flag):
|
|
52
52
|
MAC = auto()
|
|
53
53
|
UBUNTU = auto()
|
|
54
|
-
REPLIT = auto()
|
|
55
54
|
SUPPORTED = MAC | UBUNTU | REPLIT
|
|
56
55
|
UNSUPPORTED = 0
|
|
57
56
|
|
|
58
57
|
@classmethod
|
|
59
58
|
def detect(cls):
|
|
60
|
-
if os.environ.get('REPL_ID'):
|
|
61
|
-
return cls.REPLIT
|
|
62
59
|
system_name = platform.system()
|
|
63
60
|
if system_name == "Darwin":
|
|
64
61
|
return cls.MAC
|
|
@@ -79,9 +76,7 @@ class Platform(Flag):
|
|
|
79
76
|
else:
|
|
80
77
|
return "brew install "
|
|
81
78
|
elif platform == cls.UBUNTU:
|
|
82
|
-
return "
|
|
83
|
-
elif platform == cls.REPLIT:
|
|
84
|
-
return "nix-env -iA nixpkgs."
|
|
79
|
+
return "brew install "
|
|
85
80
|
else:
|
|
86
81
|
raise cls.NotSupported()
|
|
87
82
|
|
|
@@ -268,21 +263,6 @@ class MWCShellConfig(SetupTask):
|
|
|
268
263
|
fh.write(f'export PATH="$PATH:{mwcpath}"\n')
|
|
269
264
|
fh.write(f"source {get_mwc_rc_path()}\n")
|
|
270
265
|
|
|
271
|
-
class InstallHomebrew(SetupTask):
|
|
272
|
-
description = "Install homebrew"
|
|
273
|
-
platform = Platform.MAC
|
|
274
|
-
|
|
275
|
-
def is_complete(self):
|
|
276
|
-
return self.executable_on_path("brew")
|
|
277
|
-
|
|
278
|
-
def run_task(self):
|
|
279
|
-
click.echo(address("Installing homebrew... (this may take a while)"))
|
|
280
|
-
cmd = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
|
|
281
|
-
run(cmd, shell=True, check=True)
|
|
282
|
-
with platform_rc_file().open('a') as fh:
|
|
283
|
-
fh.write('\nPATH="/usr/local/bin:$PATH"\n')
|
|
284
|
-
sys.path.append("/usr/local/bin")
|
|
285
|
-
|
|
286
266
|
class InstallXCode(SetupTask):
|
|
287
267
|
description = "Install XCode"
|
|
288
268
|
platform = Platform.MAC
|
|
@@ -305,15 +285,13 @@ class InstallPoetry(SetupTask):
|
|
|
305
285
|
return self.executable_on_path("poetry")
|
|
306
286
|
|
|
307
287
|
def run_task(self):
|
|
308
|
-
shell = get_shell_name()
|
|
309
288
|
click.echo(address("Installing poetry..."))
|
|
310
|
-
run("
|
|
289
|
+
run("pipx install poetry", shell=True, check=True)
|
|
311
290
|
click.echo(address("Installing poetry tab completions..."))
|
|
291
|
+
shell = get_shell_name()
|
|
312
292
|
try:
|
|
313
293
|
if shell == "bash":
|
|
314
|
-
|
|
315
|
-
tab_completion_dir.mkdir(exist_ok=True)
|
|
316
|
-
run("poetry completions bash > /etc/bash_completion.d/poetry", shell=True, check=True)
|
|
294
|
+
run("poetry completions bash > ~/.bash_completion", shell=True, check=True)
|
|
317
295
|
if shell == "zsh":
|
|
318
296
|
tab_completion_dir = Path("~/.zfunc")
|
|
319
297
|
tab_completion_dir.mkdir(exist_ok=True)
|
|
@@ -341,13 +319,15 @@ class WriteShellConfig(SetupTask):
|
|
|
341
319
|
f = ""
|
|
342
320
|
shell = get_shell_name()
|
|
343
321
|
f += "# Making With Code RC File\n\n"
|
|
344
|
-
f += "## Add Poetry to $PATH\n"
|
|
345
|
-
f += 'export PATH="$HOME/.local/bin:$PATH"\n\n'
|
|
346
322
|
if Platform.detect() == Platform.MAC:
|
|
347
323
|
if self.settings['editor'] == "subl":
|
|
348
324
|
f += "## Add subl to $PATH\n"
|
|
349
325
|
subldir = "/Applications/Sublime Text.app/Contents/SharedSupport/bin"
|
|
350
326
|
f += f'export PATH="{subldir}:$PATH"\n\n'
|
|
327
|
+
shell = get_shell_name()
|
|
328
|
+
if shell == "zsh":
|
|
329
|
+
f += "fpath+=~/.zfunc\n"
|
|
330
|
+
f += "autoload -Uz compinit && compinit\n"
|
|
351
331
|
return f
|
|
352
332
|
|
|
353
333
|
class InstallPackage(SetupTask):
|
|
@@ -384,10 +364,6 @@ class InstallPackage(SetupTask):
|
|
|
384
364
|
self.debug_log(f"Running: {package_manager}{package_name}")
|
|
385
365
|
run(f"{package_manager}{package_name}", shell=True, check=True)
|
|
386
366
|
|
|
387
|
-
class InstallCurl(InstallPackage):
|
|
388
|
-
platform = Platform.UBUNTU
|
|
389
|
-
executable_name = apt_name = "curl"
|
|
390
|
-
|
|
391
367
|
class InstallGit(InstallPackage):
|
|
392
368
|
platform = Platform.MAC | Platform.UBUNTU
|
|
393
369
|
executable_name = brew_name = apt_name = "git"
|
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/curriculum.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/git_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/mwc_accounts_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/__init__.py
RENAMED
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/check.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/setup.py
RENAMED
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/teach/update.py
RENAMED
|
File without changes
|
{making_with_code_cli-1.3.0 → making_with_code_cli-2.0.0}/making_with_code_cli/update/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|