File: test_imports.sh

package info (click to toggle)
dask 2021.01.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,172 kB
  • sloc: python: 74,608; javascript: 186; makefile: 150; sh: 94
file content (25 lines) | stat: -rw-r--r-- 1,063 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
#!/usr/bin/env bash
set -o errexit


test_import () {
    echo "Create environment: python=$PYTHON_VERSION $1"
    # Create an empty environment
    conda create -q -y -n test-imports -c conda-forge python=$PYTHON_VERSION pyyaml $1
    conda activate test-imports
    pip install -e .
    echo "python -c '$2'"
    python -c "$2"
    conda deactivate
    conda env remove -n test-imports
}

# Note: in setup.py, bag and delayed require cloudpickle, but it's omitted here as it is
# only a dependency for real-life usage and unit tests
test_import ""                                "import dask, dask.multiprocessing, dask.threaded, dask.optimization"
test_import "toolz"                           "import dask.delayed"
test_import "fsspec toolz partd"              "import dask.bag"
test_import "toolz numpy toolz"               "import dask.array"
test_import "fsspec numpy pandas toolz partd" "import dask.dataframe"
test_import "bokeh"                           "import dask.diagnostics"
test_import "distributed"                     "import dask.distributed"