-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·50 lines (37 loc) · 1.04 KB
/
setup.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
PYVER=1.6
msg(){
echo
echo $1
echo "========================="
}
cmd=$1
msg "Setup Project resource data"
ant setup
# Python setup.
msg "Build Python libraries"
unset PYTHONPATH
PYSRC=$PWD/src/main/python
if [ -d "$PYSRC/dist" ]; then
rm -f $PYSRC/dist/*
fi
(cd $PYSRC && python3.9 ./setup.py sdist)
msg "Install Python resources"
pip3 install -U --target ../piplib lxml bs4 arrow requests pyshp pycountry \
./src/main/python/dist/opensextant-${PYVER}*.tar.gz
if [ "$cmd" = "pydoc" ]; then
export PYTHONPATH=$PYSRC:$PWD/../piplib
mkdir -p ./doc/python
pushd ./doc/python
pydoc3 -w opensextant \
opensextant.xlayer opensextant.utility \
opensextant.phonetics opensextant.advas_phonetics \
opensextant.gazetteer opensextant.extractors \
opensextant.TaxCat opensextant.FlexPat
fi
msg Done
cat <<EOF
If you are developing libraries here remove the installed opensextant lib, e.g.,
../piplib/opensextant*
or adjust your venv or PYTHONPATH to use the project source first in path: ./src/main/python/
EOF