Skip to content

Commit 452c0fe

Browse files
committed
Update to napi v3
1 parent 542064f commit 452c0fe

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ http-handler = { git = "ssh://git@github.com/platformatic/http-handler.git" }
2525
http-rewriter = { git = "ssh://git@github.com/platformatic/http-rewriter.git" }
2626
# http-rewriter = { path = "../http-rewriter" }
2727
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
28-
napi = { version = "3.0.0-beta.8", default-features = false, features = ["napi4"], optional = true }
29-
napi-derive = { version = "3.0.0-beta.8", optional = true }
28+
napi = { version = "3", default-features = false, features = ["napi4"], optional = true }
29+
napi-derive = { version = "3", optional = true }
3030
pyo3 = { version = "0.25.1", features = ["experimental-async"] }
3131
pyo3-async-runtimes = { version = "0.25.0", features = ["tokio-runtime"] }
3232
thiserror = "2.0.12"
3333
tokio = { version = "1.45.1", features = ["full"] }
3434

3535
[build-dependencies]
36-
napi-build = { version = "2.2.1", optional = true }
36+
napi-build = { version = "2", optional = true }
3737

3838
[profile.release]
3939
lto = true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"license": "MIT",
1717
"devDependencies": {
18-
"@napi-rs/cli": "3.0.0-alpha.89",
18+
"@napi-rs/cli": "^3.0.1",
1919
"@oxc-node/core": "^0.0.23",
2020
"oxlint": "^0.16.0"
2121
},

src/asgi/http.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ mod tests {
527527

528528
#[test]
529529
fn test_http_connection_scope_into_pyobject() {
530+
pyo3::prepare_freethreaded_python();
530531
Python::with_gil(|py| {
531532
let scope = HttpConnectionScope {
532533
http_version: HttpVersion::V1_1,
@@ -576,6 +577,7 @@ mod tests {
576577

577578
#[test]
578579
fn test_http_receive_message_into_pyobject() {
580+
pyo3::prepare_freethreaded_python();
579581
Python::with_gil(|py| {
580582
let message = HttpReceiveMessage::Request {
581583
body: vec![1, 2, 3],
@@ -594,6 +596,7 @@ mod tests {
594596

595597
#[test]
596598
fn test_http_send_message_from_pyobject() {
599+
pyo3::prepare_freethreaded_python();
597600
Python::with_gil(|py| {
598601
let dict = PyDict::new(py);
599602
dict.set_item("type", "http.response.start").unwrap();

0 commit comments

Comments
 (0)