arkitekt-next 0.8.42__py3-none-any.whl → 0.8.44__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.

@@ -55,6 +55,7 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
55
55
 
56
56
  chosen_services = registry.service_builders
57
57
 
58
+
58
59
  if services:
59
60
  chosen_services = {
60
61
  key: service
@@ -70,6 +71,19 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
70
71
  chosen_services = {service: chosen_services[service]}
71
72
 
72
73
 
74
+
75
+
76
+ if os.path.exists(config):
77
+ if click.confirm(
78
+ f"GraphQL Config file already exists. Do you want to merge your choices?"
79
+ ):
80
+ file = yaml.load(open(config, "r"), Loader=yaml.FullLoader)
81
+ projects = file.get("projects", {})
82
+ click.echo(f"Merging {','.join(chosen_services.keys())} in {','.join(projects.keys())}...")
83
+
84
+
85
+ has_done_something = False
86
+
73
87
 
74
88
  for key, service in chosen_services.items():
75
89
  try:
@@ -80,6 +94,13 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
80
94
  get_console(ctx).print(f"[red]No schema or project found for {key} [/]")
81
95
  continue
82
96
 
97
+ if key in projects:
98
+ get_console(ctx).print(f"[red]Project {key} already exists [/]")
99
+ if not click.confirm("Do you want to overwrite it?"):
100
+ continue
101
+
102
+ has_done_something = True
103
+
83
104
  if documents:
84
105
  os.makedirs(os.path.join(app_documents, key), exist_ok=True)
85
106
  if seperate_doc_dirs:
@@ -119,15 +140,13 @@ def init(ctx, boring, services, config, documents, schemas, path, seperate_doc_d
119
140
  except Exception as e:
120
141
  raise ClickException(f"Failed to initialize project for {key}. Error: {e}") from e
121
142
 
122
- if os.path.exists(config):
123
- if not click.confirm(
124
- f"GraphQL Config file already exists. Do you want to overwrite?"
125
- ):
126
- click.echo("Aborting...")
127
- ctx.abort()
128
-
129
- graph_config_path = os.path.join(app_directory, config)
130
- yaml.safe_dump(
131
- {"projects": projects}, open(graph_config_path, "w"), sort_keys=False
132
- )
133
- get_console(ctx).print(f"Config file written to {graph_config_path}")
143
+
144
+ if has_done_something:
145
+ graph_config_path = os.path.join(app_directory, config)
146
+ yaml.safe_dump(
147
+ {"projects": projects}, open(graph_config_path, "w"), sort_keys=False
148
+ )
149
+ get_console(ctx).print(f"Config file written to {graph_config_path}")
150
+ else:
151
+ get_console(ctx).print("No projects initialized")
152
+ get_console(ctx).print("Exiting...")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.8.42
3
+ Version: 0.8.44
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -52,7 +52,7 @@ arkitekt_next/cli/commands/call/main.py,sha256=SdxlvSgA17-M_gwItiFU_srbh-CNdHpCT
52
52
  arkitekt_next/cli/commands/call/remote.py,sha256=Id6t1nUdXmERx9wbutEhvryUMAM80_G4HVHkhYZosTE,2097
53
53
  arkitekt_next/cli/commands/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  arkitekt_next/cli/commands/gen/compile.py,sha256=F0rAeBL4WWLdBGQRxVNqe5Bjek_SovhNO5rKrMEhj_4,1457
55
- arkitekt_next/cli/commands/gen/init.py,sha256=QtH7-lUDrlbBSEBR14O6rON7cQaI7oORT-4owe-P1h8,4267
55
+ arkitekt_next/cli/commands/gen/init.py,sha256=EAztQs-C2Ta11_mrAwj5pw7u3NrqQnlkVCeY2tHIhLE,4887
56
56
  arkitekt_next/cli/commands/gen/main.py,sha256=_BdkcsXoWY5_3gmboq2e0pGYM6lAnwqQgBAyxmvdf6U,947
57
57
  arkitekt_next/cli/commands/gen/watch.py,sha256=nf4QckdTJOWxvKoeNRwvC4rXQ4xhIx8LCDDJzpPhcY8,1189
58
58
  arkitekt_next/cli/commands/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -132,8 +132,8 @@ arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
132
132
  arkitekt_next/service_registry.py,sha256=oga1_fy7clwtcQO7XcSzWlyu2d5dna9H79uKLv8fKI0,6119
133
133
  arkitekt_next/tqdm.py,sha256=lQcJI5Q6Py7Gy88hOCiJujjPEEGd8G2k1mOVJJ6oYe8,1531
134
134
  arkitekt_next/utils.py,sha256=QETdzn_GIMSw6LdaXL89bqvqp9MGwEBK8Lj54MpnMwc,2396
135
- arkitekt_next-0.8.42.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
136
- arkitekt_next-0.8.42.dist-info/METADATA,sha256=lkLiU44ZXXP36cyrclqfomQuJOZRKZGB9dHSBMvvo_Y,6210
137
- arkitekt_next-0.8.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
138
- arkitekt_next-0.8.42.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
139
- arkitekt_next-0.8.42.dist-info/RECORD,,
135
+ arkitekt_next-0.8.44.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
136
+ arkitekt_next-0.8.44.dist-info/METADATA,sha256=27zYjGpSGWbvtpVWYhxZj59-jKmBXMmKGCk7Ox40ATA,6210
137
+ arkitekt_next-0.8.44.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
138
+ arkitekt_next-0.8.44.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
139
+ arkitekt_next-0.8.44.dist-info/RECORD,,