File: test_imports.sh

package info (click to toggle)
dask 1.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,856 kB
  • sloc: python: 51,266; sh: 178; makefile: 142
file content (35 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
test_import () {
    # Install dependencies
    if [[ -n "$2" ]]; then
        output=$(conda install -c conda-forge $2)
        if [[ $? -eq 1 ]]; then
            echo $output
            echo "$1 install failed" >&2
            exit 1
        fi
    fi
    # Check import
    python -c "$3"
    if [[ $? -eq 1 ]]; then
        echo "$1 import failed" >&2
        exit 1
    else
        echo "$1 import succeeded"
    fi
    # Uninstall dependencies
    if [[ -n "$2" ]]; then
        output=$(conda uninstall $2)
    fi
}

# Create an empty environment
conda create -n test-imports python=$PYTHON
source activate test-imports

(test_import "Core" "" "import dask, dask.threaded, dask.optimization") && \
(test_import "Delayed" "toolz" "import dask.delayed") && \
(test_import "Bag" "toolz partd cloudpickle" "import dask.bag") && \
(test_import "Array" "toolz numpy" "import dask.array") && \
(test_import "Dataframe" "numpy pandas toolz partd cloudpickle" "import dask.dataframe") && \
(test_import "Distributed" "distributed s3fs" "import dask.distributed")