Skip to content

Commit 60bdaad

Browse files
authored
Merge pull request #132 from PyO3/release-0.10
Update PyO3 to 0.11
2 parents 6cf7ad8 + e6112e7 commit 60bdaad

File tree

19 files changed

+120
-193
lines changed

19 files changed

+120
-193
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v1
21+
uses: actions/setup-python@v2
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install Rust
2525
uses: actions-rs/toolchain@v1
2626
with:
27-
toolchain: nightly
27+
toolchain: stable
2828
default: true
2929
- run: rustup set default-host ${{ matrix.platform.rust-target }}
3030
- name: Build without default features

.travis.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language: python
2-
dist: xenial
2+
os: linux
3+
dist: bionic
34

45
cache:
56
pip: true
@@ -8,38 +9,26 @@ cache:
89
matrix:
910
include:
1011
- python: "3.5"
11-
env: FEATURES=python3
1212
- python: "3.6"
13-
env: FEATURES=python3
1413
- python: "3.7"
15-
env: FEATURES=python3
1614
- python: "3.8"
17-
env: FEATURES=python3
15+
env: RUN_LINT=1
1816

1917
env:
2018
global:
21-
- TRAVIS_RUST_VERSION=nightly
19+
- TRAVIS_RUST_VERSION=stable
2220
- RUST_BACKTRACE=1
23-
- FEATURES=python3
2421

2522
addons:
2623
apt:
2724
packages:
28-
- libcurl4-openssl-dev
29-
- libelf-dev
30-
- libdw-dev
31-
- cmake
32-
- gcc
33-
- binutils-dev
34-
- libiberty-dev
3525
- gfortran
3626

3727
before_install:
3828
- source ./ci/travis/setup.sh
3929

4030
install:
41-
- pip install setuptools-rust pytest pytest-benchmark \
42-
tox numpy flake8
31+
- pip install setuptools-rust pytest tox numpy flake8
4332

4433
script:
4534
- flake8 examples/

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ libc = "0.2"
1515
num-complex = "0.2"
1616
num-traits = "0.2"
1717
ndarray = ">=0.13"
18-
pyo3 = "0.10.1"
18+
pyo3 = "0.11.1"
1919

2020
[features]
2121
# In default setting, python version is automatically detected

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ rust-numpy
33
[![Build Status](https://travis-ci.org/pyo3/rust-numpy.svg?branch=master)](https://travis-ci.org/pyo3/rust-numpy)
44
[![Build status](https://ci.appveyor.com/api/projects/status/bjaru43c7t1alx2x/branch/master?svg=true)](https://ci.appveyor.com/project/kngwyu/rust-numpy/branch/master)
55
[![Crate](http://meritbadge.herokuapp.com/numpy)](https://crates.io/crates/numpy)
6+
[![minimum rustc 1.39](https://img.shields.io/badge/rustc-1.39+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
67

78
Rust bindings for the NumPy C-API
89

@@ -12,9 +13,8 @@ Rust bindings for the NumPy C-API
1213

1314

1415
## Requirements
15-
- current nightly rust (see https://github.com/PyO3/pyo3/issues/5 for nightly features, and
16-
https://github.com/PyO3/pyo3/blob/master/build.rs for minimum required version)
17-
- some rust libraries
16+
- Rust 1.39+
17+
- Some Rust libraries
1818
- [ndarray](https://github.com/bluss/ndarray) for rust-side matrix library
1919
- [pyo3](https://github.com/PyO3/pyo3) for cpython binding
2020
- and more (see [Cargo.toml](Cargo.toml))
@@ -57,7 +57,7 @@ using [setuptools-rust](https://github.com/PyO3/setuptools-rust).
5757
name = "numpy-test"
5858

5959
[dependencies]
60-
pyo3 = "0.10.1"
60+
pyo3 = "0.11.1"
6161
numpy = "0.9.0"
6262
```
6363

ci/travis/setup.sh

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,15 @@
22

33
set -e
44

5-
# Find the installed version of a binary, if any
6-
_installed() {
7-
VERSION=$($@ --version 2>/dev/null || echo "$@ none")
8-
echo $VERSION | rev | cut -d' ' -f1 | rev
9-
}
10-
11-
# Find the latest available version of a binary on `crates.io`
12-
_latest() {
13-
VERSION=$(cargo search -q "$@" | grep "$@" | cut -f2 -d"\"")
14-
echo $VERSION
15-
}
16-
175
### Setup Rust toolchain #######################################################
18-
curl -SsL "https://sh.rustup.rs/" | sh -s -- -y --default-toolchain=$TRAVIS_RUST_VERSION
6+
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION --profile=minimal -y
197
export PATH=$PATH:$HOME/.cargo/bin
8+
if [[ $RUN_LINT == 1 ]]; then
9+
rustup component add clippy
10+
rustup component add rustfmt
11+
fi
2012

2113
### Setup python linker flags ##################################################
22-
23-
python -c """
24-
import sysconfig
25-
cfg = sorted(sysconfig.get_config_vars().items())
26-
print('\n'.join(['{}={}'.format(*x) for x in cfg]))
27-
"""
28-
29-
export PYTHON_LIB=$(python -c "import sysconfig as s; print(s.get_config_var('LIBDIR'))")
30-
31-
# find $PYTHON_LIB
32-
export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB"
33-
34-
# delete any possible empty components
35-
# https://github.com/google/pulldown-cmark/issues/122#issuecomment-364948741
36-
LIBRARY_PATH=$(echo $LIBRARY_PATH | sed -E -e 's/^:*//' -e 's/:*$//' -e 's/:+/:/g')
37-
14+
PYTHON_LIB=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
3815
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB:$HOME/rust/lib"
16+
echo ${LD_LIBRARY_PATH}

ci/travis/test.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
set -ex
44

5-
cargo build --verbose --features $FEATURES
6-
cargo test --verbose --features $FEATURES -- --test-threads=1
5+
cargo build --verbose
6+
cargo test --verbose
7+
8+
if [[ $RUN_LINT == 1 ]]; then
9+
cargo fmt --all -- --check
10+
cargo clippy --tests
11+
for example in examples/*; do (cd $$example/; cargo clippy) || exit 1; done
12+
fi
713

814
for example in examples/*; do
915
if [ $example != 'examples/linalg' ]; then

examples/linalg/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ ndarray = ">= 0.13"
1414
ndarray-linalg = { version = "0.12", features = ["openblas"] }
1515

1616
[dependencies.pyo3]
17-
version = "0.10.1"
17+
version = "0.11.1"
1818
features = ["extension-module"]

examples/simple-extension/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ numpy = { path = "../.." }
1313
ndarray = ">= 0.12"
1414

1515
[dependencies.pyo3]
16-
version = "0.10.1"
16+
version = "0.11.1"
1717
features = ["extension-module"]

0 commit comments

Comments
 (0)