arkitekt-next 0.7.27__py3-none-any.whl → 0.7.28__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 arkitekt-next might be problematic. Click here for more details.

@@ -4,7 +4,8 @@ from arkitekt_next.cli.utils import build_relative_dir
4
4
  import rich_click as click
5
5
  from click import Context
6
6
  from rich import get_console
7
- from arkitekt_next.utils import create_arkitekt_next_folder
7
+ from arkitekt_next.cli.vars import get_manifest
8
+ from arkitekt_next.utils import create_arkitekt_next_folder, create_devcontainer_file
8
9
  import yaml
9
10
  from rich.panel import Panel
10
11
 
@@ -38,9 +39,16 @@ import os
38
39
  default="vanilla",
39
40
  type=click.Choice(compile_dockerfiles()),
40
41
  )
42
+ @click.option(
43
+ "--devcontainer",
44
+ "-d",
45
+ help="Shouwld we create a devcontainer.json file?",
46
+ is_flag=True,
47
+ default=False,
48
+ )
41
49
  @click.pass_context
42
50
  def init(
43
- ctx: Context, description: str, overwrite: bool, flavour: str, template: str
51
+ ctx: Context, description: str, overwrite: bool, flavour: str, template: str, devcontainer: bool
44
52
  ) -> None:
45
53
  """Runs the port wizard to generate a dockerfile to be used with port"""
46
54
 
@@ -57,6 +65,8 @@ def init(
57
65
  config_file = os.path.join(flavour_folder, "config.yaml")
58
66
  dockerfile = os.path.join(flavour_folder, "Dockerfile")
59
67
 
68
+ manifest = get_manifest(ctx)
69
+
60
70
  fl = Flavour(
61
71
  selectors=[],
62
72
  description=description,
@@ -72,6 +82,11 @@ def init(
72
82
  with open(dockerfile, "w") as f:
73
83
  f.write(dockerfile_content)
74
84
 
85
+
86
+ if devcontainer or click.confirm("Do you want to create a devcontainer.json file?"):
87
+ create_devcontainer_file(manifest, flavour, dockerfile)
88
+
89
+
75
90
  panel = Panel(
76
91
  title=f"Created new flavour [bold]{flavour}[/bold]\n",
77
92
  renderable="You can now edit the Dockerfile and add selectors to the config.yaml file\n"
arkitekt_next/utils.py CHANGED
@@ -1,4 +1,6 @@
1
1
  import os
2
+ from arkitekt_next.model import Manifest
3
+ import json
2
4
 
3
5
 
4
6
  def create_arkitekt_next_folder(with_cache: bool = True) -> str:
@@ -36,3 +38,37 @@ def create_arkitekt_next_folder(with_cache: bool = True) -> str:
36
38
  )
37
39
 
38
40
  return os.path.abspath(".arkitekt_next")
41
+
42
+
43
+
44
+ def create_devcontainer_file(manifest: Manifest, flavour: str, docker_file_path, devcontainer_path=".devcontainer", ) -> None:
45
+ """Creates a devcontainer.json file in the flavour folder.
46
+
47
+ Parameters
48
+ ----------
49
+ flavour_folder : str
50
+ The path to the flavour folder.
51
+ """
52
+
53
+ os.makedirs(devcontainer_path, exist_ok=True)
54
+
55
+ flavour_container = os.path.join(devcontainer_path, flavour)
56
+ os.makedirs(os.path.join(devcontainer_path, flavour), exist_ok=True)
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+ devcontainer_file = os.path.join(flavour_container, "devcontainer.json")
65
+
66
+
67
+ devcontainer_content = {}
68
+ devcontainer_content["name"] = f"{manifest.identifier} {flavour} Devcontainer"
69
+ devcontainer_content["build"] = {}
70
+ devcontainer_content["build"]["dockerfile"] = os.path.join("..", docker_file_path)
71
+ devcontainer_content["build"]["context"] = "../.." # This is the root of the project
72
+ devcontainer_content["runArgs"] = ["--network=host"]
73
+
74
+ json.dump(devcontainer_content, open(devcontainer_file, "w"), indent=4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.7.27
3
+ Version: 0.7.28
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -36,7 +36,7 @@ arkitekt_next/cli/commands/inspect/templates.py,sha256=U99SLBYWiD-ZiIYV7pVWhQK3X
36
36
  arkitekt_next/cli/commands/inspect/variables.py,sha256=LonDlbS2qH1v-jD6RfEhTv-mxmgeBMKqD3oO2iDJRjE,2698
37
37
  arkitekt_next/cli/commands/kabinet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  arkitekt_next/cli/commands/kabinet/build.py,sha256=A1C84ZNRtD1nMv5erJGQPx9DDx493VxDR7SRd2__7IA,8548
39
- arkitekt_next/cli/commands/kabinet/init.py,sha256=NNEb5SITLNM1TBED0moyBhE-JGkkr0cvNh33A4OGnfc,2525
39
+ arkitekt_next/cli/commands/kabinet/init.py,sha256=0BoQLBqtyXegBVAPY_flNyEsBi8yxjIHDZXipBTAjlQ,2951
40
40
  arkitekt_next/cli/commands/kabinet/main.py,sha256=U5EWekRTsMZZ34abWFfwilhzrd-zZtpZbl8RsLN_bC8,1008
41
41
  arkitekt_next/cli/commands/kabinet/publish.py,sha256=zbjnoMliowje1nEuKFolFX5pZA2D_DzLjXlSxBbD88k,3596
42
42
  arkitekt_next/cli/commands/kabinet/stage.py,sha256=eK_FgqTbGvaphmOH6jnllYWCkv0pI3qJaEnfWHoBvYs,1985
@@ -113,9 +113,9 @@ arkitekt_next/qt/magic_bar.py,sha256=xo4_ReVYtpCwnRFTMBYvBEcVvY3JnNFbqYYY_-ez6vM
113
113
  arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
114
114
  arkitekt_next/service_registry.py,sha256=pczUuP_Nve7OYwB7-oDBLIw6bkjZPnzL3xFca5TF1io,3405
115
115
  arkitekt_next/tqdm.py,sha256=DlrxPluHao7TvW-Cqgt0UokRS-fM2_ZNiWiddqvCqCc,1488
116
- arkitekt_next/utils.py,sha256=WA3AtqQFcz2h-yOadAsQkkr0qKJmKcGMi2aclxaVI_o,1278
117
- arkitekt_next-0.7.27.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
118
- arkitekt_next-0.7.27.dist-info/METADATA,sha256=YoyGkDPwfHMyldgY6EQ6c-GoK43bq0x27CAMsh90oEA,5500
119
- arkitekt_next-0.7.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
120
- arkitekt_next-0.7.27.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
121
- arkitekt_next-0.7.27.dist-info/RECORD,,
116
+ arkitekt_next/utils.py,sha256=gmKWy9M51vimohmmaoIpAJ0CaB22TFP0w3JszRrwiak,2379
117
+ arkitekt_next-0.7.28.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
118
+ arkitekt_next-0.7.28.dist-info/METADATA,sha256=KckwpUPVlXgxwysshp1s6rt7LexSgvz88NPFUy1Ce_w,5500
119
+ arkitekt_next-0.7.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
120
+ arkitekt_next-0.7.28.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
121
+ arkitekt_next-0.7.28.dist-info/RECORD,,