Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aarch64 wheels and some minor cleanup #7

Merged
merged 1 commit into from
Jan 23, 2024
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
19 changes: 11 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- main
- master
tags:
- '*'
- "*"
pull_request:
workflow_dispatch:

Expand All @@ -35,6 +35,10 @@ jobs:
manylinux: manylinux2014
target: armv7
interpreter: 3.8 3.9 3.10 3.11 3.12
- os: linux
manylinux: manylinux_2_28
target: aarch64
interpreter: 3.8 3.9 3.10 3.11 3.12
- os: linux
manylinux: manylinux2014
target: ppc64le
Expand All @@ -46,7 +50,7 @@ jobs:
- os: linux
manylinux: manylinux2014
target: x86_64
interpreter: pypy3.9 pypy3.10
interpreter: 3.8 3.9 3.10 3.11 3.12 pypy3.9 pypy3.10

# musllinux
- os: linux
Expand All @@ -59,7 +63,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: "3.8"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -74,7 +78,6 @@ jobs:
name: wheels
path: dist


windows:
runs-on: windows-latest
environment: publishing
Expand All @@ -85,14 +88,14 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: "3.8"
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -109,13 +112,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: "3.8"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cuatrorpc_rs"
version = "0.7.1"
version = "0.7.2"
edition = "2021"
authors = ["bleach86 <tux@ghostbyjohnmcafee.com>"]
description = "Fast RPC client library for Python in rust."
Expand All @@ -27,6 +27,7 @@ ureq = { version = "2.8.0", features = ["json"] }
pyo3 = { version = "0.20.2", features = ["extension-module"] }
pythonize = "0.20.0"


serde = { version = "1.0.166", features = ["derive"] }
serde_json = "1.0.100"

Expand Down
2 changes: 1 addition & 1 deletion python/cuatrorpc/cuatrorpc_rs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class RpcClientCLI:
def callrpc(
self,
method: str,
call_args: Optional[List[Any]] = None,
params: Optional[List[Any]] = None,
wallet: Optional[str] = "",
) -> Any: ...
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ impl RpcClient {
) -> PyResult<Option<PyObject>> {
let agent: Agent = AgentBuilder::new()
.timeout_read(Duration::from_secs(self.rpc_timeout))
.timeout(Duration::from_secs(self.rpc_timeout))
.build();

let params_value: Vec<Value> =
Expand Down Expand Up @@ -126,7 +127,7 @@ impl RpcClientCLI {
}

fn callrpc(
&mut self,
&self,
py: Python<'_>,
method: &str,
params: Option<&PyList>,
Expand Down Expand Up @@ -191,8 +192,10 @@ impl RpcClientCLI {
} else {
let error_message: std::borrow::Cow<'_, str> =
String::from_utf8_lossy(&result.stderr);
let err_res: String = error_message.replace("\n", "");
Err(PyErr::new::<PyRuntimeError, _>(format!("{}", err_res)))
Err(PyErr::new::<PyRuntimeError, _>(format!(
"{}",
error_message
)))
}
}
Err(e) => Err(PyErr::new::<PyRuntimeError, _>(format!(
Expand Down