shipit-cli 0.15.0__py3-none-any.whl → 0.15.1__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.
shipit/cli.py CHANGED
@@ -153,9 +153,7 @@ class Ctx:
153
153
  commands=commands,
154
154
  prepare=prepare_steps,
155
155
  workers=workers,
156
- mounts=self.get_refs([mount.ref for mount in mounts])
157
- if mounts
158
- else None,
156
+ mounts=self.get_refs([mount.ref for mount in mounts]) if mounts else None,
159
157
  volumes=self.get_refs([volume["ref"] for volume in volumes])
160
158
  if volumes
161
159
  else None,
@@ -206,8 +204,12 @@ class Ctx:
206
204
  serve_path = self.runner.get_serve_mount_path(name)
207
205
  mount = Mount(name, build_path, serve_path)
208
206
  ref = self.add_mount(mount)
209
-
210
- return CtxMount(ref=ref, path=str(build_path.absolute()), serve_path=str(serve_path.absolute()))
207
+
208
+ return CtxMount(
209
+ ref=ref,
210
+ path=str(build_path.absolute()),
211
+ serve_path=str(serve_path.absolute()),
212
+ )
211
213
 
212
214
  def add_volume(self, volume: Volume) -> Optional[str]:
213
215
  self.volumes.append(volume)
@@ -257,7 +259,7 @@ def evaluate_shipit(
257
259
  raise ValueError(f"No serve definition found in {shipit_file}")
258
260
  assert len(ctx.serves) <= 1, "Only one serve is allowed for now"
259
261
  serve = next(iter(ctx.serves.values()))
260
-
262
+
261
263
  # Now we apply the custom commands (start, after_deploy, build, install)
262
264
  if provider_config.commands.start:
263
265
  serve.commands["start"] = provider_config.commands.start
@@ -271,11 +273,23 @@ def evaluate_shipit(
271
273
  has_done_install = False
272
274
  for step in serve.build:
273
275
  if isinstance(step, RunStep):
274
- if step.group == "build" and not has_done_build and provider_config.commands.build:
275
- new_build.append(RunStep(provider_config.commands.build, group="build"))
276
+ if (
277
+ step.group == "build"
278
+ and not has_done_build
279
+ and provider_config.commands.build
280
+ ):
281
+ new_build.append(
282
+ RunStep(provider_config.commands.build, group="build")
283
+ )
276
284
  has_done_build = True
277
- elif step.group == "install" and not has_done_install and provider_config.commands.install:
278
- new_build.append(RunStep(provider_config.commands.install, group="install"))
285
+ elif (
286
+ step.group == "install"
287
+ and not has_done_install
288
+ and provider_config.commands.install
289
+ ):
290
+ new_build.append(
291
+ RunStep(provider_config.commands.install, group="install")
292
+ )
279
293
  has_done_install = True
280
294
  else:
281
295
  new_build.append(step)
@@ -288,10 +302,14 @@ def evaluate_shipit(
288
302
  serve.build = new_build
289
303
 
290
304
  if serve.commands.get("start"):
291
- serve.commands["start"] = serve.commands["start"].replace("$PORT", str(provider_config.port or "8080"))
292
-
305
+ serve.commands["start"] = serve.commands["start"].replace(
306
+ "$PORT", str(provider_config.port or "8080")
307
+ )
308
+
293
309
  if serve.commands.get("after_deploy"):
294
- serve.commands["after_deploy"] = serve.commands["after_deploy"].replace("$PORT", str(provider_config.port or "8080"))
310
+ serve.commands["after_deploy"] = serve.commands["after_deploy"].replace(
311
+ "$PORT", str(provider_config.port or "8080")
312
+ )
295
313
 
296
314
  return ctx, serve
297
315
 
@@ -406,6 +424,9 @@ def auto(
406
424
  help="The port to use (defaults to 8080).",
407
425
  ),
408
426
  ):
427
+ # We assume wasmer as an active flag if we pass wasmer deploy or wasmer deploy config
428
+ wasmer = wasmer or wasmer_deploy or (wasmer_deploy_config is not None)
429
+
409
430
  if not path.exists():
410
431
  raise Exception(f"The path {path} does not exist")
411
432
 
@@ -440,7 +461,7 @@ def auto(
440
461
  install_command=install_command,
441
462
  build_command=build_command,
442
463
  start_command=start_command,
443
- wasmer=(wasmer or wasmer_deploy),
464
+ wasmer=wasmer,
444
465
  docker=docker,
445
466
  docker_client=docker_client,
446
467
  skip_docker_if_safe_build=skip_docker_if_safe_build,
@@ -522,7 +543,9 @@ def generate(
522
543
  if build_command:
523
544
  base_config.commands.build = build_command
524
545
  provider_cls = load_provider(path, base_config, use_provider=provider)
525
- provider_config = load_provider_config(provider_cls, path, base_config, config=config)
546
+ provider_config = load_provider_config(
547
+ provider_cls, path, base_config, config=config
548
+ )
526
549
  provider = provider_cls(path, provider_config)
527
550
  content = generate_shipit(path, provider)
528
551
  config_json = provider_config.model_dump_json(indent=2, exclude_defaults=True)
@@ -616,6 +639,9 @@ def serve(
616
639
  help="Save the output of the Wasmer build to a json file",
617
640
  ),
618
641
  ) -> None:
642
+ # We assume wasmer as an active flag if we pass wasmer deploy or wasmer deploy config
643
+ wasmer = wasmer or wasmer_deploy or (wasmer_deploy_config is not None)
644
+
619
645
  if not path.exists():
620
646
  raise Exception(f"The path {path} does not exist")
621
647
 
@@ -626,8 +652,7 @@ def serve(
626
652
  else:
627
653
  build_backend = LocalBuildBackend(path, ASSETS_PATH)
628
654
 
629
- needs_wasmer = wasmer or wasmer_deploy or wasmer_deploy_config
630
- if needs_wasmer:
655
+ if wasmer:
631
656
  runner: Runner = WasmerRunner(
632
657
  build_backend,
633
658
  path,
@@ -783,7 +808,9 @@ def plan(
783
808
  if serve_port:
784
809
  base_config.port = serve_port
785
810
  provider_cls = load_provider(path, base_config, use_provider=provider)
786
- provider_config = load_provider_config(provider_cls, path, base_config, config=config)
811
+ provider_config = load_provider_config(
812
+ provider_cls, path, base_config, config=config
813
+ )
787
814
  # provider_config = runner.prepare_config(provider_config)
788
815
  ctx, serve = evaluate_shipit(shipit_file, build_backend, runner, provider_config)
789
816
 
@@ -811,9 +838,7 @@ def plan(
811
838
  provider_config.commands.build = build_command
812
839
  plan_output = {
813
840
  "provider": provider_cls.name(),
814
- "config": json.loads(
815
- provider_config.model_dump_json(exclude_defaults=True)
816
- ),
841
+ "config": json.loads(provider_config.model_dump_json(exclude_defaults=True)),
817
842
  "services": [
818
843
  {"name": svc.name, "provider": svc.provider}
819
844
  for svc in (serve.services or [])
@@ -936,11 +961,11 @@ def build(
936
961
  base_config.port = serve_port
937
962
 
938
963
  provider_cls = load_provider(path, base_config, use_provider=provider)
939
- provider_config = load_provider_config(provider_cls, path, base_config, config=config)
940
- provider_config = runner.prepare_config(provider_config)
941
- ctx, serve = evaluate_shipit(
942
- shipit_file, build_backend, runner, provider_config
964
+ provider_config = load_provider_config(
965
+ provider_cls, path, base_config, config=config
943
966
  )
967
+ provider_config = runner.prepare_config(provider_config)
968
+ ctx, serve = evaluate_shipit(shipit_file, build_backend, runner, provider_config)
944
969
  env = {
945
970
  "PATH": "",
946
971
  "COLORTERM": os.environ.get("COLORTERM", ""),
@@ -986,7 +1011,9 @@ def build(
986
1011
  env_vars = dotenv_values(path / f".env.{env_name}")
987
1012
  serve.env.update(env_vars)
988
1013
 
989
- assert serve.commands.get("start"), "No start command could be found, please provide a start command"
1014
+ assert serve.commands.get("start"), (
1015
+ "No start command could be found, please provide a start command"
1016
+ )
990
1017
 
991
1018
  # Build and serve
992
1019
  build_backend.build(serve.name, env, serve.mounts or [], serve.build)
shipit/version.py CHANGED
@@ -1,5 +1,5 @@
1
1
  __all__ = ["version", "version_info"]
2
2
 
3
3
 
4
- version = "0.15.0"
5
- version_info = (0, 15, 0, "final", 0)
4
+ version = "0.15.1"
5
+ version_info = (0, 15, 1, "final", 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shipit-cli
3
- Version: 0.15.0
3
+ Version: 0.15.1
4
4
  Summary: Shipit CLI is the best way to build, serve and deploy your projects anywhere.
5
5
  Project-URL: homepage, https://wasmer.io
6
6
  Project-URL: repository, https://github.com/wasmerio/shipit
@@ -1,11 +1,11 @@
1
1
  shipit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- shipit/cli.py,sha256=YPEyl6yjk2CH2YnjB1wmF3m_ZbJ0_Ktr2mmpFFLrsS4,33825
2
+ shipit/cli.py,sha256=vh1vjJ-RjS-fCYp4ErF7L0xALV9jA1mUW6eUe5o9OFM,34390
3
3
  shipit/generator.py,sha256=CyAwWmwcd0JrRSlcux9X1ZWuAnzJK3QBjN5yKgmKVqQ,7526
4
4
  shipit/procfile.py,sha256=bjsdG8aSbRhKvrN96OiSOh0xjJHnlZg42eadtlsLc0M,1129
5
5
  shipit/shipit_types.py,sha256=wQzuYOIJMlovOq56ropf2T3j_Ye6Y8BYYdAuXfEGHbM,2062
6
6
  shipit/ui.py,sha256=vqtuAYXwB_PqlcOchrPFTQ3yoCXRBqV_GnB5R2u-1-k,243
7
7
  shipit/utils.py,sha256=XaiuaT_5mnzlXD9i1PAkaVc162y5Y_wj_oo1z2gUQBI,248
8
- shipit/version.py,sha256=QJqEGC_YsFig0b6PsnwwJQh_zE-YL49JPlItpKrgL-U,97
8
+ shipit/version.py,sha256=q8SlRWdsvng7MZpPYDKxyoGYK8uOMP4KzryloyqqOfc,97
9
9
  shipit/assets/php/php.ini,sha256=SaR3wvssSROtxTY_CQ5-BspM_47_I971V5X2dsqe8sU,2579
10
10
  shipit/assets/wordpress/install.sh,sha256=8sNe4w9F9y97JR-w5Q0ZHVgZvNm_vnd1CacY5fQjewI,3087
11
11
  shipit/assets/wordpress/wp-config.php,sha256=q7KHB_TyLrodXzbg8EEPm42XWDIevtwL6wk3L0kbVrs,4809
@@ -28,7 +28,7 @@ shipit/runners/__init__.py,sha256=s1kICs9W8Z5buF0dalgNNx2AzGAsiTw8OzCIgYiN_ps,15
28
28
  shipit/runners/base.py,sha256=edXGW_4lngQS_Q110yy_6UnyOSKLbxxJm5vDIu8ge7Y,582
29
29
  shipit/runners/local.py,sha256=OFWyI_IO_7q_QZrbEnXFRUVbNCwNYuxZTdA1PI2Icp4,4138
30
30
  shipit/runners/wasmer.py,sha256=d2oL7x74yU6_q1cMYuu3M19XyGzDKnJZHirf1SBuF_k,17202
31
- shipit_cli-0.15.0.dist-info/METADATA,sha256=RJ0Om2Z_PBlwYa7O6jG4F2aIFaEQK2xXPAs6NQ9hPkk,3773
32
- shipit_cli-0.15.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
33
- shipit_cli-0.15.0.dist-info/entry_points.txt,sha256=7AE1NjSrHaSDfbfsRRO50KKnHFTbB0Imsccd1WynzAQ,72
34
- shipit_cli-0.15.0.dist-info/RECORD,,
31
+ shipit_cli-0.15.1.dist-info/METADATA,sha256=dQCRPs5oKZzgOzJrdG-Ji_gYNk7GXv7ojZm02ngQg1k,3773
32
+ shipit_cli-0.15.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
33
+ shipit_cli-0.15.1.dist-info/entry_points.txt,sha256=7AE1NjSrHaSDfbfsRRO50KKnHFTbB0Imsccd1WynzAQ,72
34
+ shipit_cli-0.15.1.dist-info/RECORD,,