-
Notifications
You must be signed in to change notification settings - Fork 15
/
build_and_package.sh
executable file
·49 lines (28 loc) · 1.13 KB
/
build_and_package.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -x
set -e
echo "Installing python requirements"
pip install -r requirements.txt
echo "Checking if spacy 'en' is installed otherwise download it"
python -c "import spacy;spacy.load('en_core_web_sm')" || python -m spacy download en_core_web_sm && python -c "import spacy;spacy.load('en_core_web_sm')"
echo "Checking scala style issues"
./build/sbt scalastyle
echo "Checking python style issues"
flake8 --ignore=E402,F405,F401,F403 sparklingml/
echo "Building JVM code"
./build/sbt clean pack assembly
echo "Copying assembly jar to python loadable directory"
mkdir -p ./sparklingml/jar
cp target/scala-2.11/sparklingml-assembly-0.0.1-SNAPSHOT.jar ./sparklingml/jar/sparklingml.jar
echo "Testing Python code"
nosetests --logging-level=INFO --detailed-errors --verbosity=2 --with-coverage --cover-html-dir=./htmlcov --cover-package=sparklingml --with-doctest --doctest-options=+ELLIPSIS,+NORMALIZE_WHITESPACE
echo "Testing pip install of Python code"
pip install .
mkdir /tmp/abcd
pushd /tmp/abcd
python -c "import sparklingml"
popd
echo "Testing JVM code"
# Skip for now due to gateway issues.
# ./build/sbt test
echo "Finished"