Skip to content
Open
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
456 changes: 216 additions & 240 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Pytest configuration for Fastly Compute tests."""

# Enable the fastly_compute pytest plugin for automatic viceroy output on failures
pytest_plugins = ["fastly_compute.pytest_plugin"]
2 changes: 1 addition & 1 deletion crates/fastly-compute-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ wit-parser = "0.244"
wit-component = "0.244"
wasm-metadata = { version = "0.245", default-features = false }
tempfile = "3"
componentize-py = { git = "https://github.com/bytecodealliance/componentize-py", rev = "81d582a2333198cff13c0b56de35d72c25a652e7" }
componentize-py = { git = "https://github.com/bytecodealliance/componentize-py", tag = "v0.23.0" }
futures = { version = "0.3", default-features = false, features = ["executor"] }
pyo3 = { version = "0.28.3", features = ["abi3-py312"], optional = true }
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/fastly-compute-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub fn generate_bindings(
log::debug!(" Output dir: {}", output_dir.display());

componentize_py::BindingsGenerator {
wit_path: &[wit_path],
wit_paths: &[wit_path],
worlds,
features: &[],
all_features: false,
Expand Down Expand Up @@ -194,7 +194,7 @@ pub fn build(output: PathBuf, entry_name: String, virtualenv: Option<PathBuf>) -
log::info!(" Componentizing Python application...");
futures::executor::block_on(async {
componentize_py::ComponentGenerator {
wit_path: &[merged_wit_path.as_path()],
wit_paths: &[merged_wit_path.as_path()],
worlds: &["fastly:compute/service@0.1.0"],
features: &[],
all_features: false,
Expand Down
2 changes: 1 addition & 1 deletion examples/backend-requests/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/bottle-app/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/flask-app/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/game-of-life/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"host": "http-me.fastly.dev",
"content-type": "",
"connection": "keep-alive",
"user-agent": "python-requests/2.33.1",
"user-agent": "python-requests/2.34.2",
"accept-encoding": "gzip, defla...
''',
'status_code': 200,
Expand Down
3 changes: 0 additions & 3 deletions fastly_compute/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
"""Pytest configuration for Fastly Compute tests."""

# Enable the fastly_compute pytest plugin for automatic viceroy output on failures
pytest_plugins = ["fastly_compute.pytest_plugin"]
23 changes: 11 additions & 12 deletions fastly_compute/tests/test_wasm_metadata.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for Wasm producers metadata embedded in the built component.

Verifies that all top-level producers section fields written by
inject_fastly_metadata() are present and correct:
inject_fastly_metadata() are present and correct. For example:

- language: Python 3.14
- sdk: fastly-compute-py 0.1.0
Expand All @@ -23,8 +23,8 @@
WASM_PATH = Path("build/bottle-app.composed.wasm")

# NOTE: these will need to be updated at times but serves as a sanity check
FASTLY_COMPUTE_PY_VERSION = "0.1.0"
COMPONENTIZE_PY_VERSION = "0.22.1"
FASTLY_COMPUTE_PY_VERSION_RE = re.compile(r"0\.\d+\.\d+")
COMPONENTIZE_PY_VERSION_RE = re.compile(r"0\.\d+\.\d+")
PYTHON_VERSION = "3.14"


Expand Down Expand Up @@ -89,20 +89,19 @@ def test_language_python_version_matches_libpython(producers, metadata):


def test_sdk_fastly_compute_py(producers):
assert (
producers.get("sdk", {}).get("fastly-compute-py") == FASTLY_COMPUTE_PY_VERSION
)
sdk_version = producers.get("sdk", {}).get("fastly-compute-py", "")
assert FASTLY_COMPUTE_PY_VERSION_RE.fullmatch(sdk_version) is not None


def test_processed_by_componentize_py(producers):
assert (
producers.get("processed-by", {}).get("componentize-py")
== COMPONENTIZE_PY_VERSION
componentize_py_version = producers.get("processed-by", {}).get(
"componentize-py", ""
)
assert COMPONENTIZE_PY_VERSION_RE.fullmatch(componentize_py_version) is not None


def test_processed_by_fastly_compute_py(producers):
assert (
producers.get("processed-by", {}).get("fastly-compute-py")
== FASTLY_COMPUTE_PY_VERSION
fastly_compute_py_version = producers.get("processed-by", {}).get(
"fastly-compute-py", ""
)
assert FASTLY_COMPUTE_PY_VERSION_RE.fullmatch(fastly_compute_py_version) is not None
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = []
[project.optional-dependencies]
test = [
"bottle (>=0.12.25)",
"pytest (>=8.4.0,<9.0.0)",
"pytest (>=9.0.3,<10.0.0)",
"requests (>=2.32.5,<3.0.0)",
"tomli-w (>=1.0.0,<2.0.0)",
"syrupy (==5.0.0)",
Expand Down
Loading
Loading