-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·42 lines (31 loc) · 829 Bytes
/
build.sh
File metadata and controls
executable file
·42 lines (31 loc) · 829 Bytes
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
#!/bin/sh
set -e
# Create the build directory with inputs (sources) and outputs (binaries).
# Ensure it is empty, to build from clean state.
mkdir -p build
rm -rf build
mkdir -p build
# Copy source files
cp requirements.txt build
cp setup.py build
cp -r src build/tensorfx
# Generate the README expected by PyPI from original markdown
curl --silent http://c.docverter.com/convert \
-F from=markdown \
-F to=rst \
-F input_files[]=@README.md > build/README.rst
# Finally, build
pushd build > /dev/null
python setup.py sdist > setup.log
popd > /dev/null
echo 'Build completed successfully!'
# Copy over tests
cp -r tests build/tests
echo 'Tests copied successfully!'
# Optionally run tests
if [ "$1" == "test" ]; then
pushd build/tests > /dev/null
python main.py
popd > /dev/null
echo 'Tests completed'
fi