Skip to content

Commit

Permalink
Update to pyo3 v0.14
Browse files Browse the repository at this point in the history
test with extension module

Check pipeline

Fix pyo3 pipeline

Try changing shell

Try removing deprecation

Update latest Cargo files
  • Loading branch information
sansyrox committed Aug 10, 2021
1 parent 0551c63 commit 32d475a
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 33 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
args: -i python --release --universal2 --out dist --no-sdist
- name: Install built wheel - universal2
run: |
pip install --force-reinstall dist/robyn*.whl
pip install --force-reinstall dist/robyn*_universal2.whl
cd ~ && python -c 'import robyn'
- name: Upload wheels
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -69,8 +69,9 @@ jobs:
target: ${{ matrix.target }}
args: -i python --release --out dist --no-sdist
- name: Install built wheel
shell: bash
run: |
pip install robyn --no-index --find-links dist --force-reinstall
pip install --force-reinstall dist/robyn*.whl
cd ~ && python -c 'import robyn'
- name: Upload wheels
uses: actions/upload-artifact@v2
Expand Down
66 changes: 43 additions & 23 deletions Cargo.lock

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

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ name = "robyn"
crate-type = ["cdylib", "rlib"]

[dependencies.pyo3]
version = "0.13.2"
features = ["extension-module"]

[dependencies.pyo3-asyncio]
version = "0.13.4"
features = []
version = "0.14.1"
features = ["extension-module", "auto-initialize"]

[dependencies]
tokio = { version = "1.7.0", features = ["full"] }
dashmap = {git = "https://github.com/quake/dashmap", branch = "parking_lot", features = ["parking_lot"]}
pyo3-asyncio = { git = "https://github.com/awestlake87/pyo3-asyncio", rev = "dd6f2cc7838a2990ed15447ff9ef9f93fa51423d", features = ["attributes", "tokio-runtime"] }
anyhow = "1.0.38"
actix-web = "4.0.0-beta.8"
futures-util = "0.3.15"
Expand Down
2 changes: 1 addition & 1 deletion src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn execute_function(
}
None => handler.call0(),
};
pyo3_asyncio::into_future(coro?)
pyo3_asyncio::tokio::into_future(coro?)
})?;
let output = output.await?;
let res = Python::with_gil(|py| -> PyResult<String> {
Expand Down
10 changes: 10 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ impl Server {
});
});

// let asyncio = py.import("asyncio").unwrap();

// let event_loop = asyncio.call_method0("new_event_loop").unwrap();
// asyncio
// .call_method1("set_event_loop", (event_loop,))
// .unwrap();

// event_loop.call_method0("run_forever").unwrap();
// println!("test test_run_forever ... ok");

run_forever(py).unwrap()
}

Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def blocker():

if __name__ == "__main__":
app.add_header("server", "robyn")
app.start(port=5000)
app.start(port=5001)

0 comments on commit 32d475a

Please sign in to comment.