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

Extend README to cover handling non-unified dependencies on semver-incompatible ndarray versions #206

Merged
merged 2 commits into from
Nov 5, 2021
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
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@ You can also automatically specify python version in `setup.py`,
using [setuptools-rust](https://github.com/PyO3/setuptools-rust).


## Dependency on ndarray

This crate uses types from `ndarray` in its public API. `ndarray` is re-exported
in the crate root so that you do not need to specify it as a direct dependency.

Furthermore, this crate is compatible multiple versions of `ndarray` and therefore depends
on a range of semver-incompatible versions, currently `>= 0.13, < 0.16`. Cargo does not
automatically choose a single version of `ndarray` by itself if you depend directly or indirectly
on anything but that exact range. It can therefore be necessary to manually unify these dependencies.

For example, if you specify the following dependencies

```toml
numpy = "0.14"
ndarray = "0.13"
```

this will currently depend on both version `0.13.1` and `0.15.3` of `ndarray` by default
even though `0.13.1` is within the range `>= 0.13, < 0.16`. To fix this, you can run

```sh
cargo update ---package ndarray:0.15.3 --precise 0.13.1
```

to achieve a single dependency on version `0.13.1` of `ndarray`.

## Example


Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ mod readonly;
mod slice_box;
mod sum_products;

pub use ndarray;

pub use crate::array::{
get_array_module, PyArray, PyArray0, PyArray1, PyArray2, PyArray3, PyArray4, PyArray5,
PyArray6, PyArrayDyn,
Expand Down