shipit-cli 0.2.3__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.3 → shipit_cli-0.3.0}/PKG-INFO +1 -1
  2. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/pyproject.toml +1 -1
  3. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/cli.py +26 -34
  4. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/hugo.py +1 -1
  5. {shipit_cli-0.2.3 → 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.3/src/shipit/version.py +0 -5
  8. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/.gitignore +0 -0
  9. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/README.md +0 -0
  10. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/__init__.py +0 -0
  11. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/assets/php/php.ini +0 -0
  12. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/generator.py +0 -0
  13. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/base.py +0 -0
  14. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/gatsby.py +0 -0
  15. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/laravel.py +0 -0
  16. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/mkdocs.py +0 -0
  17. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/node_static.py +0 -0
  18. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/php.py +0 -0
  19. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/registry.py +0 -0
  20. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/src/shipit/providers/staticfile.py +0 -0
  21. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/tests/test_examples_build.py +0 -0
  22. {shipit_cli-0.2.3 → shipit_cli-0.3.0}/tests/test_generate_shipit_examples.py +0 -0
  23. {shipit_cli-0.2.3 → 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.3
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.3"
3
+ version = "0.3.0"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -873,22 +873,16 @@ 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)
@@ -930,25 +924,27 @@ class WasmerBuilder:
930
924
  def deploy(
931
925
  self, app_owner: Optional[str] = None, app_name: Optional[str] = None
932
926
  ) -> str:
933
- if not app_owner or not app_name:
934
- raise Exception("app_owner and app_name must be set")
935
927
  extra_args = []
936
928
  if self.wasmer_registry:
937
929
  extra_args += ["--registry", self.wasmer_registry]
938
930
  if self.wasmer_token:
939
931
  extra_args += ["--token", self.wasmer_token]
940
- self.run_command(
941
- self.bin,
942
- [
943
- "package",
944
- "push",
945
- self.wasmer_dir_path,
946
- "--namespace",
947
- app_owner,
948
- "--non-interactive",
949
- *extra_args,
950
- ],
951
- )
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
+ # )
952
948
  return self.run_command(
953
949
  self.bin,
954
950
  [
@@ -956,10 +952,6 @@ class WasmerBuilder:
956
952
  "--publish-package",
957
953
  "--dir",
958
954
  self.wasmer_dir_path,
959
- "--app-name",
960
- app_name,
961
- "--owner",
962
- app_owner,
963
955
  "--non-interactive",
964
956
  *extra_args,
965
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.3"
5
- version_info = (0, 2, 3, "final", 0)
File without changes
File without changes