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

Support conversion between num-bigint <-> Python Long #608

Merged
merged 6 commits into from
Oct 7, 2019
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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ libc = "0.2.62"
spin = "0.5.1"
num-traits = "0.2.8"
pyo3cls = { path = "pyo3cls", version = "=0.8.0" }
num-complex = { version = "0.2.3", optional = true }
num-complex = { version = ">= 0.2", optional = true }
num-bigint = { version = ">= 0.2", optional = true }
inventory = "0.1.4"
indoc = "0.3.4"
unindent = "0.1.4"
Expand Down
2 changes: 1 addition & 1 deletion ci/appveyor/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Invoke-Call
}
}

Invoke-Call { cargo test --verbose }
Invoke-Call { cargo test --verbose --features="num-bigint num-complex" }

$examplesDirectory = "examples"

Expand Down
2 changes: 1 addition & 1 deletion ci/travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -ex

# run `cargo test` only if testing against cpython.
if ! [[ $FEATURES == *"pypy"* ]]; then
cargo test --features "$FEATURES num-complex"
cargo test --features "$FEATURES num-bigint num-complex"
( cd pyo3-derive-backend; cargo test )
else
# check that pypy at least builds
Expand Down
2 changes: 2 additions & 0 deletions src/ffi/longobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ extern "C" {
#[cfg(not(Py_LIMITED_API))]
#[cfg_attr(windows, link(name = "pythonXY"))]
extern "C" {
pub fn _PyLong_NumBits(obj: *mut PyObject) -> c_int;

#[cfg_attr(PyPy, link_name = "_PyPyLong_FromByteArray")]
pub fn _PyLong_FromByteArray(
bytes: *const c_uchar,
Expand Down
Loading