Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,238 changes: 1,376 additions & 862 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ rust-version = "1.91"
members = ["sdk", "sdk/macro"]

[dependencies]
anyhow = "1.0.75"
anyhow = "1.0.101"
async-trait = "0.1"
clap = { version = "3.1.15", features = ["derive", "env"] }
clap = { version = "4", features = ["derive", "env"] }
serde = "1.0"
spin-factors = { git = "https://github.com/spinframework/spin", tag = "v3.6.3" }
spin-runtime-factors = { git = "https://github.com/spinframework/spin", tag = "v3.6.3" }
spin-trigger = { git = "https://github.com/spinframework/spin", tag = "v3.6.3" }
spin-factors = { git = "https://github.com/spinframework/spin", rev = "5f3aa19c50d1609592f7ea2f6362209a04da52ac" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be tag = "v4.0.0"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's the commit so it doesn't really matter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we could. We're pretty good about not changing tags.

spin-runtime-factors = { git = "https://github.com/spinframework/spin", rev = "5f3aa19c50d1609592f7ea2f6362209a04da52ac" }
spin-trigger = { git = "https://github.com/spinframework/spin", rev = "5f3aa19c50d1609592f7ea2f6362209a04da52ac" }
tokio = { version = "1.37", features = ["full"] }
tokio-cron-scheduler = "0.13"
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.7", features = ["env-filter"] }
wasmtime = { version = "42.0.2" }
wasmtime = { version = "43" }

[target.'cfg(target_os = "linux")'.dependencies]
# This needs to be an explicit dependency to enable
# '--features openssl/vendored', which is used for Linux releases.
openssl = { version = "0.10" }

[workspace.dependencies]
wit-bindgen = "0.51.0"
wit-bindgen = "0.54.0"
4 changes: 2 additions & 2 deletions cron.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fermyon:spin-cron@2.0.0;
package spin:cron@3.0.0;

interface cron-types {
record metadata {
Expand All @@ -12,7 +12,7 @@ interface cron-types {

world spin-cron {
use cron-types.{metadata, error};
export handle-cron-event: func(metadata: metadata) -> result<_, error>;
export handle-cron-event: async func(metadata: metadata) -> result<_, error>;
}

world spin-cron-sdk {
Expand Down
1 change: 1 addition & 0 deletions guest-python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bindings
4 changes: 1 addition & 3 deletions guest-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ pip3 install -r requirements.txt
To generate bindings to use with intellisense

```bash
componentize-py -d ../cron.wit -w spin-cron bindings bindings
mv bindings/spin_cron ./
rm -r bindings
componentize-py -d ../cron.wit -w spin:cron/spin-cron@3.0.0 bindings bindings
```


Expand Down
8 changes: 4 additions & 4 deletions guest-python/app.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import spin_cron
from spin_cron.imports import cron_types
from spin_cron.imports.spin_cron_cron_types_3_0_0 import Metadata
from spin_sdk import variables

class SpinCron(spin_cron.SpinCron):
def handle_cron_event(self, metadata: cron_types.Metadata) -> None:
temp = variables.get("something")
print("[" + str(metadata.timestamp) +"] " + "Hello every " + temp)
async def handle_cron_event(self, metadata: Metadata) -> None:
temp = await variables.get("something")
print("[" + str(metadata.timestamp) +"] " + "Hello every " + temp)
4 changes: 2 additions & 2 deletions guest-python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
spin-sdk==2.0.0
componentize-py==0.12.0
spin-sdk @ git+https://github.com/spinframework/spin-python-sdk@main
componentize-py==0.23.0
4 changes: 2 additions & 2 deletions guest-python/spin.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spin_manifest_version = 2

[application]
name = "cron-sampl-py"
name = "cron-sample-py"
authors = ["The Spin authors"]
version = "0.1.0"

Expand All @@ -12,6 +12,6 @@ cron_expression = "1/2 * * * * *"
[component.every2seconds]
source = "app.wasm"
[component.every2seconds.build]
command = "componentize-py -d ../cron.wit -w spin-cron componentize -m spin_sdk=spin-imports app -o app.wasm"
command = "componentize-py --world-module spin_cron -d ../cron.wit -w spin:cron/spin-cron@3.0.0 -w spin:up/platform@4.0.0 componentize app -o app.wasm"
[component.every2seconds.variables]
something = "2s"
Loading
Loading