@@ -13,7 +13,9 @@ set -eu
13
13
cd " $( dirname " $0 " ) "
14
14
BUILD_DIR=" $( pwd) "
15
15
[ -e build ] && BUILD_DIR=" $( pwd) /build"
16
- PYTHON=` grep ^_Python_EXECUTABLE: $BUILD_DIR /CMakeCache.txt | cut -d= -f2`
16
+ if [ -z " ${PYTHON-} " ]; then
17
+ PYTHON=` grep ^_Python_EXECUTABLE: $BUILD_DIR /CMakeCache.txt | cut -d= -f2`
18
+ fi
17
19
18
20
# Build all, except when we called with an option to avoid full compilation:
19
21
# G - only build the program,
@@ -27,31 +29,39 @@ if [ $# = 1 ] && [ $1 = P ]; then
27
29
(cd $BUILD_DIR && make -j4 gemmi_py)
28
30
exit
29
31
fi
30
- if [ $# = 0 ] || [ $1 != n ]; then
32
+ if [ $# != 0 ] && [ $1 = n ]; then
33
+ shift
34
+ else
31
35
(cd $BUILD_DIR && make -j4 all check)
32
36
./tools/cmp-size.py build/gemmi build/gemmi.* .so
33
37
./tools/docs-help.sh
34
38
fi
35
39
(cd docs && make -j4 html SPHINXOPTS=" -q -n" )
36
40
37
41
# Run tests and checks.
38
- export PYTHONPATH=$BUILD_DIR
39
- export PATH=" $BUILD_DIR :$PATH "
42
+ if [ $# = 0 ] || [ $1 != i ]; then
43
+ export PYTHONPATH=$BUILD_DIR
44
+ export PATH=" $BUILD_DIR :$PATH "
45
+ fi
40
46
$PYTHON -m unittest discover -s tests
41
47
./tools/header-list.py > docs/headers.rst
42
- # Where python 2 and 3 output differ, the docs have output from v3.
43
- # So 'make doctest' works only if sphinx-build was installed for python3.
44
- (cd docs && make doctest SPHINXOPTS=" -q -n -E" )
48
+
49
+ if [ -z " ${NO_DOCTEST-} " ]; then
50
+ # 'make doctest' works only if sphinx-build was installed for python3.
51
+ (cd docs && make doctest SPHINXOPTS=" -q -n -E" )
52
+ fi
53
+
45
54
flake8 docs/ examples/ tests/ tools/ setup.py
46
55
# We want to avoid having '::' in pydoc from pybind11.
47
56
$PYTHON -m pydoc gemmi | grep :: || :
48
57
58
+
49
59
# Usually, we stop here. Below are more extensive checks below that are run
50
60
# before making a release. They are run when this script is called with 'a'
51
61
# or with an option corresponding to the check.
52
62
[ $# = 0 ] && exit ;
53
63
54
- if [ $1 = a ]; then
64
+ if [ $1 = i ]; then
55
65
echo ' Check if gemmi package is found by setuptools pkg_resources...'
56
66
$PYTHON -c ' __requires__ = ["gemmi"]; import pkg_resources'
57
67
echo ' OK'
0 commit comments