docs/tutorial/testlib/pythonpath.sh
author Boris Feld <boris.feld@octobus.net>
Wed, 18 Dec 2019 14:10:49 +0100
changeset 5227 b24de4b465ea
parent 3376 aad37ffd7d58
permissions -rw-r--r--
ci: Add CI job for building the documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3376
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
# utility to setup pythonpath to point into the tested repository
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
5227
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
     3
SRCDIR=$(dirname "$(dirname "$TESTDIR")");
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
     4
export SRCDIR;
3376
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     5
if [ -n "$PYTHONPATH" ]; then
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
    export HGTEST_ORIG_PYTHONPATH=$PYTHONPATH
5227
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
     7
    if uname -o | grep -q Msys; then
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
     8
        export PYTHONPATH="$SRCDIR;$PYTHONPATH"
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
     9
    else
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
    10
        export PYTHONPATH=$SRCDIR:$PYTHONPATH
b24de4b465ea ci: Add CI job for building the documentation
Boris Feld <boris.feld@octobus.net>
parents: 3376
diff changeset
    11
    fi
3376
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
else
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
    export PYTHONPATH=$SRCDIR
aad37ffd7d58 doc: import the training support
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
fi