File tree Expand file tree Collapse file tree 19 files changed +120
-193
lines changed Expand file tree Collapse file tree 19 files changed +120
-193
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ jobs:
18
18
steps :
19
19
- uses : actions/checkout@v2
20
20
- name : Set up Python ${{ matrix.python-version }}
21
- uses : actions/setup-python@v1
21
+ uses : actions/setup-python@v2
22
22
with :
23
23
python-version : ${{ matrix.python-version }}
24
24
- name : Install Rust
25
25
uses : actions-rs/toolchain@v1
26
26
with :
27
- toolchain : nightly
27
+ toolchain : stable
28
28
default : true
29
29
- run : rustup set default-host ${{ matrix.platform.rust-target }}
30
30
- name : Build without default features
Original file line number Diff line number Diff line change 1
1
language : python
2
- dist : xenial
2
+ os : linux
3
+ dist : bionic
3
4
4
5
cache :
5
6
pip : true
8
9
matrix :
9
10
include :
10
11
- python : " 3.5"
11
- env : FEATURES=python3
12
12
- python : " 3.6"
13
- env : FEATURES=python3
14
13
- python : " 3.7"
15
- env : FEATURES=python3
16
14
- python : " 3.8"
17
- env : FEATURES=python3
15
+ env : RUN_LINT=1
18
16
19
17
env :
20
18
global :
21
- - TRAVIS_RUST_VERSION=nightly
19
+ - TRAVIS_RUST_VERSION=stable
22
20
- RUST_BACKTRACE=1
23
- - FEATURES=python3
24
21
25
22
addons :
26
23
apt :
27
24
packages :
28
- - libcurl4-openssl-dev
29
- - libelf-dev
30
- - libdw-dev
31
- - cmake
32
- - gcc
33
- - binutils-dev
34
- - libiberty-dev
35
25
- gfortran
36
26
37
27
before_install :
38
28
- source ./ci/travis/setup.sh
39
29
40
30
install :
41
- - pip install setuptools-rust pytest pytest-benchmark \
42
- tox numpy flake8
31
+ - pip install setuptools-rust pytest tox numpy flake8
43
32
44
33
script :
45
34
- flake8 examples/
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ libc = "0.2"
15
15
num-complex = " 0.2"
16
16
num-traits = " 0.2"
17
17
ndarray = " >=0.13"
18
- pyo3 = " 0.10 .1"
18
+ pyo3 = " 0.11 .1"
19
19
20
20
[features ]
21
21
# In default setting, python version is automatically detected
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ rust-numpy
3
3
[ ![ Build Status] ( https://travis-ci.org/pyo3/rust-numpy.svg?branch=master )] ( https://travis-ci.org/pyo3/rust-numpy )
4
4
[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/bjaru43c7t1alx2x/branch/master?svg=true )] ( https://ci.appveyor.com/project/kngwyu/rust-numpy/branch/master )
5
5
[ ![ 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 )
6
7
7
8
Rust bindings for the NumPy C-API
8
9
@@ -12,9 +13,8 @@ Rust bindings for the NumPy C-API
12
13
13
14
14
15
## 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
18
18
- [ ndarray] ( https://github.com/bluss/ndarray ) for rust-side matrix library
19
19
- [ pyo3] ( https://github.com/PyO3/pyo3 ) for cpython binding
20
20
- and more (see [ Cargo.toml] ( Cargo.toml ) )
@@ -57,7 +57,7 @@ using [setuptools-rust](https://github.com/PyO3/setuptools-rust).
57
57
name = " numpy-test"
58
58
59
59
[dependencies ]
60
- pyo3 = " 0.10 .1"
60
+ pyo3 = " 0.11 .1"
61
61
numpy = " 0.9.0"
62
62
```
63
63
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
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
-
17
5
# ## 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
19
7
export PATH=$PATH :$HOME /.cargo/bin
8
+ if [[ $RUN_LINT == 1 ]]; then
9
+ rustup component add clippy
10
+ rustup component add rustfmt
11
+ fi
20
12
21
13
# ## 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'))" )
38
15
export LD_LIBRARY_PATH=" $LD_LIBRARY_PATH :$PYTHON_LIB :$HOME /rust/lib"
16
+ echo ${LD_LIBRARY_PATH}
Original file line number Diff line number Diff line change 2
2
3
3
set -ex
4
4
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
7
13
8
14
for example in examples/* ; do
9
15
if [ $example != ' examples/linalg' ]; then
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ ndarray = ">= 0.13"
14
14
ndarray-linalg = { version = " 0.12" , features = [" openblas" ] }
15
15
16
16
[dependencies .pyo3 ]
17
- version = " 0.10 .1"
17
+ version = " 0.11 .1"
18
18
features = [" extension-module" ]
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ numpy = { path = "../.." }
13
13
ndarray = " >= 0.12"
14
14
15
15
[dependencies .pyo3 ]
16
- version = " 0.10 .1"
16
+ version = " 0.11 .1"
17
17
features = [" extension-module" ]
You can’t perform that action at this time.
0 commit comments