shipit-cli 0.2.2__tar.gz → 0.3.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.
Files changed (23) hide show
  1. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/PKG-INFO +1 -1
  2. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/pyproject.toml +1 -1
  3. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/cli.py +28 -40
  4. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/hugo.py +1 -1
  5. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/python.py +28 -7
  6. shipit_cli-0.3.0/src/shipit/version.py +5 -0
  7. shipit_cli-0.2.2/src/shipit/version.py +0 -5
  8. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/.gitignore +0 -0
  9. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/README.md +0 -0
  10. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/__init__.py +0 -0
  11. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/assets/php/php.ini +0 -0
  12. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/generator.py +0 -0
  13. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/base.py +0 -0
  14. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/gatsby.py +0 -0
  15. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/laravel.py +0 -0
  16. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/mkdocs.py +0 -0
  17. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/node_static.py +0 -0
  18. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/php.py +0 -0
  19. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/registry.py +0 -0
  20. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/src/shipit/providers/staticfile.py +0 -0
  21. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/tests/test_examples_build.py +0 -0
  22. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/tests/test_generate_shipit_examples.py +0 -0
  23. {shipit_cli-0.2.2 → shipit_cli-0.3.0}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shipit-cli
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Add your description here
5
5
  Project-URL: homepage, https://wasmer.io
6
6
  Project-URL: repository, https://github.com/wasmerio/shipit
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "shipit-cli"
3
- version = "0.2.2"
3
+ version = "0.3.0"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -696,7 +696,7 @@ class WasmerBuilder:
696
696
  self.src_dir = src_dir
697
697
  self.inner_builder = inner_builder
698
698
  # The path where we store the directory of the wasmer app in the inner builder
699
- self.wasmer_dir_path = Path(self.src_dir / ".shipit" / "wasmer")
699
+ self.wasmer_dir_path = self.src_dir / ".shipit" / "wasmer"
700
700
  self.wasmer_registry = registry
701
701
  self.wasmer_token = token
702
702
  self.bin = bin.absolute() if bin else "wasmer"
@@ -873,32 +873,22 @@ class WasmerBuilder:
873
873
  console.print(manifest_panel, markup=False, highlight=True)
874
874
  (self.wasmer_dir_path / "wasmer.toml").write_text(manifest)
875
875
 
876
- # Crete app.yaml
877
- yaml_config = {
878
- "kind": "wasmer.io/App.v0",
879
- "package": ".",
880
- # "capabilities": {
881
- # "database": {
882
- # "engine": "mysql"
883
- # }
884
- # },
885
- # "volumes": [
886
- # {
887
- # "name": "wp-content",
888
- # "mount": "/app/wp-content"
889
- # }
890
- # ]
891
- }
876
+ original_app_yaml_path = self.src_dir / "app.yaml"
877
+ if original_app_yaml_path.exists():
878
+ console.print(f"[bold]Using original app.yaml found in source directory[/bold]")
879
+ yaml_config = yaml.safe_load(original_app_yaml_path.read_text())
880
+ else:
881
+ yaml_config = {
882
+ "kind": "wasmer.io/App.v0",
883
+ }
884
+ # Update the app to use the new package
885
+ yaml_config["package"] = "."
892
886
 
893
887
  app_yaml = yaml.dump(yaml_config)
894
888
  (self.wasmer_dir_path / "app.yaml").write_text(app_yaml)
895
889
 
896
890
  # self.inner_builder.build_serve(serve)
897
891
 
898
- @property
899
- def wasmer_path(self) -> Path:
900
- return self.wasmer_dir_path.read_text()
901
-
902
892
  def run_serve_command(
903
893
  self, command: str, extra_args: Optional[List[str]] = None
904
894
  ) -> None:
@@ -934,36 +924,34 @@ class WasmerBuilder:
934
924
  def deploy(
935
925
  self, app_owner: Optional[str] = None, app_name: Optional[str] = None
936
926
  ) -> str:
937
- if not app_owner or not app_name:
938
- raise Exception("app_owner and app_name must be set")
939
927
  extra_args = []
940
928
  if self.wasmer_registry:
941
929
  extra_args += ["--registry", self.wasmer_registry]
942
930
  if self.wasmer_token:
943
931
  extra_args += ["--token", self.wasmer_token]
944
- self.run_command(
945
- self.bin,
946
- [
947
- "package",
948
- "push",
949
- self.wasmer_path,
950
- "--namespace",
951
- app_owner,
952
- "--non-interactive",
953
- *extra_args,
954
- ],
955
- )
932
+ if app_owner:
933
+ extra_args += ["--owner", app_owner]
934
+ if app_name:
935
+ extra_args += ["--app-name", app_name]
936
+ # self.run_command(
937
+ # self.bin,
938
+ # [
939
+ # "package",
940
+ # "push",
941
+ # self.wasmer_dir_path,
942
+ # "--namespace",
943
+ # app_owner,
944
+ # "--non-interactive",
945
+ # *extra_args,
946
+ # ],
947
+ # )
956
948
  return self.run_command(
957
949
  self.bin,
958
950
  [
959
951
  "deploy",
960
952
  "--publish-package",
961
953
  "--dir",
962
- self.wasmer_path,
963
- "--app-name",
964
- app_name,
965
- "--owner",
966
- app_owner,
954
+ self.wasmer_dir_path,
967
955
  "--non-interactive",
968
956
  *extra_args,
969
957
  ],
@@ -43,5 +43,5 @@ class HugoProvider(StaticFileProvider):
43
43
  def build_steps(self, path: Path) -> list[str]:
44
44
  return [
45
45
  'copy(".", ".", ignore=[".git"])',
46
- 'run("hugo build", outputs=["public"], group="build")',
46
+ 'run("hugo build --destination={}".format(app["build"]), group="build")',
47
47
  ]
@@ -63,16 +63,37 @@ class PythonProvider:
63
63
  )
64
64
 
65
65
  def build_steps(self, path: Path) -> list[str]:
66
- return [
67
- "workdir(app[\"build\"])",
68
- "env(UV_PROJECT_ENVIRONMENT=local_venv[\"build\"] if cross_platform else venv[\"build\"])",
69
- "run(f\"uv sync --compile --python python{python_version} --locked --no-managed-python\", inputs=[\"pyproject.toml\", \"uv.lock\"], outputs=[\".\"], group=\"install\")",
70
- "run(f\"uv pip compile pyproject.toml --python-version={python_version} --universal --extra-index-url {python_extra_index_url} --index-url=https://pypi.org/simple --emit-index-url --only-binary :all: -o cross-requirements.txt\", inputs=[\"pyproject.toml\"], outputs=[\"cross-requirements.txt\"]) if cross_platform else None",
71
- "run(f\"uvx pip install -r cross-requirements.txt --target {python_cross_packages_path} --platform {cross_platform} --only-binary=:all: --python-version={python_version} --compile\", outputs=[\".\"]) if cross_platform else None",
72
- "run(\"rm cross-requirements.txt\") if cross_platform else None",
66
+ steps = [
67
+ "workdir(app[\"build\"])"
68
+ ]
69
+
70
+ if _exists(path, "pyproject.toml"):
71
+ input_files = ["pyproject.toml"]
72
+ if _exists(path, "uv.lock"):
73
+ input_files.append("uv.lock")
74
+ inputs = ", ".join([f"\"{input}\"" for input in input_files])
75
+ steps += [
76
+ "env(UV_PROJECT_ENVIRONMENT=local_venv[\"build\"] if cross_platform else venv[\"build\"])",
77
+ f"run(f\"uv sync --compile --python python{{python_version}} --locked --no-managed-python\", inputs=[{inputs}], group=\"install\")",
78
+ "run(f\"uv pip compile pyproject.toml --python-version={python_version} --universal --extra-index-url {python_extra_index_url} --index-url=https://pypi.org/simple --emit-index-url --only-binary :all: -o cross-requirements.txt\", inputs=[\"pyproject.toml\"], outputs=[\"cross-requirements.txt\"]) if cross_platform else None",
79
+ "run(f\"uvx pip install -r cross-requirements.txt --target {python_cross_packages_path} --platform {cross_platform} --only-binary=:all: --python-version={python_version} --compile\") if cross_platform else None",
80
+ "run(\"rm cross-requirements.txt\") if cross_platform else None",
81
+ ]
82
+ if _exists(path, "requirements.txt"):
83
+ steps += [
84
+ "env(UV_PROJECT_ENVIRONMENT=local_venv[\"build\"] if cross_platform else venv[\"build\"])",
85
+ "run(\"uv init --no-managed-python --python python{{python_version}}\", inputs=[], outputs=[\"uv.lock\"], group=\"install\")",
86
+ "run(f\"uv add -r requirements.txt\", inputs=[\"requirements.txt\"], group=\"install\")",
87
+ "run(f\"uv pip compile pyproject.toml --python-version={python_version} --universal --extra-index-url {python_extra_index_url} --index-url=https://pypi.org/simple --emit-index-url --only-binary :all: -o cross-requirements.txt\", inputs=[\"pyproject.toml\"], outputs=[\"cross-requirements.txt\"]) if cross_platform else None",
88
+ "run(f\"uvx pip install -r cross-requirements.txt --target {python_cross_packages_path} --platform {cross_platform} --only-binary=:all: --python-version={python_version} --compile\") if cross_platform else None",
89
+ "run(\"rm cross-requirements.txt\") if cross_platform else None",
90
+ ]
91
+
92
+ steps += [
73
93
  "path((local_venv[\"build\"] if cross_platform else venv[\"build\"]) + \"/bin\")",
74
94
  "copy(\".\", \".\", ignore=[\".venv\", \".git\", \"__pycache__\"])",
75
95
  ]
96
+ return steps
76
97
 
77
98
  def prepare_steps(self, path: Path) -> Optional[list[str]]:
78
99
  return [
@@ -0,0 +1,5 @@
1
+ __all__ = ["version", "version_info"]
2
+
3
+
4
+ version = "0.3.0"
5
+ version_info = (0, 3, 0, "final", 0)
@@ -1,5 +0,0 @@
1
- __all__ = ["version", "version_info"]
2
-
3
-
4
- version = "0.2.2"
5
- version_info = (0, 2, 2, "final", 0)
File without changes
File without changes