making-with-code-cli 1.3.1__tar.gz → 2.0.1__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.
Files changed (31) hide show
  1. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/PKG-INFO +1 -1
  2. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/setup/__init__.py +0 -3
  3. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/setup/tasks.py +7 -31
  4. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/pyproject.toml +1 -1
  5. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/README.md +0 -0
  6. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/cli.py +0 -0
  7. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/curriculum.py +0 -0
  8. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/errors.py +0 -0
  9. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/git_backend/__init__.py +0 -0
  10. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/git_backend/base_backend.py +0 -0
  11. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/git_backend/mwc_backend.py +0 -0
  12. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/git_wrapper.py +0 -0
  13. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/helpers.py +0 -0
  14. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/mwc_accounts_api.py +0 -0
  15. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/settings.py +0 -0
  16. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/styles.py +0 -0
  17. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/submit.py +0 -0
  18. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/__init__.py +0 -0
  19. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/check.py +0 -0
  20. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/gitea_api/api.py +0 -0
  21. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/gitea_api/exceptions.py +0 -0
  22. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/log.py +0 -0
  23. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/setup.py +0 -0
  24. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/status.py +0 -0
  25. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/student_repo_functions.py +0 -0
  26. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/student_repos.py +0 -0
  27. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/test/__init__.py +0 -0
  28. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/test/test_module.py +0 -0
  29. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/teach/update.py +0 -0
  30. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/update/__init__.py +0 -0
  31. {making_with_code_cli-1.3.1 → making_with_code_cli-2.0.1}/making_with_code_cli/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: making-with-code-cli
3
- Version: 1.3.1
3
+ Version: 2.0.1
4
4
  Summary: Courseware for Making With Code
5
5
  Home-page: https://github.com/cproctor/making-with-code-courseware
6
6
  License: MIT
@@ -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,
@@ -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
@@ -80,8 +77,6 @@ class Platform(Flag):
80
77
  return "brew install "
81
78
  elif platform == cls.UBUNTU:
82
79
  return "sudo apt install "
83
- elif platform == cls.REPLIT:
84
- return "nix-env -iA nixpkgs."
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("curl -sSL https://install.python-poetry.org | python3 -", shell=True, check=True)
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
- tab_completion_dir = Path("/etc/bash_completion.d")
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"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "making-with-code-cli"
3
- version = "1.3.1"
3
+ version = "2.0.1"
4
4
  description = "Courseware for Making With Code"
5
5
  authors = ["Chris Proctor <chris@chrisproctor.net>"]
6
6
  license = "MIT"