Skip to content

Commit

Permalink
Trac #20736: Upgrade patchbot to 2.6.1 as a system package
Browse files Browse the repository at this point in the history
The patchbot is currently installing in a very not kosher way, as
explained in

sagemath/sage-patchbot#79

This ticket will change completely the installation mode. The patchbot
will become a python package, to be installed using pip in
the system python as explained below.

This ticket also updates the patchbot, in particular to cope with the
new https trac.

New tarball for patchbot: http://www-irma.u-strasbg.fr/~chapoton/sage-
patchbot-2.6.1.tar.gz

installation (two equivalent methods at your disposal):
1. Download the tarball and then
{{{
pip install --user sage-patchbot-2.6.1.tar.gz
}}}

2. (recommended)
{{{
pip install --user git+https://github.com/sagemath/sage-
patchbot.git@2.6.1
}}}

There are now two possible ways to launch the patchbot:
1.
{{{
python -m sage_patchbot.patchbot --sage-root=XXXX
}}}
or
2. Checkout the branch here and run
{{{
make && ./sage --patchbot
}}}

URL: https://trac.sagemath.org/20736
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Mar 4, 2017
2 parents fd5f71a + c9c4101 commit 7feb1fb
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/bin/sage
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,26 @@ fi
# an unclobbered environment before testing unsafe tickets.
if [ "$1" = '-patchbot' -o "$1" = "--patchbot" ]; then
shift
cd "$SAGE_ROOT"
exec local/bin/patchbot/patchbot.py "$@"
# We ask the Python from Sage where the patchbot is installed.
# We set PYTHONPATH to that directory such that the system Python
# should also find the sage_patchbot package.
cmd='import sage_patchbot as p; import os; print(os.path.dirname(p.__path__[0]))'
export PYTHONPATH=`"$SAGE_ROOT/sage" --python -c "$cmd"`
if [ -z "$PYTHONPATH" ]; then
# Something went wrong, assume that the patchbot is not installed
echo >&2 "Error: cannot find installation path for sage_patchbot"
echo >&2 "See https://wiki.sagemath.org/buildbot for instructions"
exit 1
fi

# Try "python2.7", then "python2", then "python"
shopt -s execfail # Do not exit if "exec" fails
exec python2.7 -m sage_patchbot.patchbot "$@"
exec python2 -m sage_patchbot.patchbot "$@"
exec python -m sage_patchbot.patchbot "$@"
echo >&2 "Error: cannot find a suitable Python program."
echo >&2 "The SageMath patchbot requires a system Python installation."
exit 127
fi

# Check for '--upgrade' before sourcing sage-env: the top-level "make"
Expand Down

0 comments on commit 7feb1fb

Please sign in to comment.