Skip to content
Snippets Groups Projects
Commit b5252068c7a5 authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

ci: allow using pre-releases

pip install --pre mercurial~=5.9.0 doesn't work as expected, so we
extract the versions using the PyPI API.
parent e5997403a826
No related branches found
No related tags found
1 merge request!126NEWS: 0.10.2 release
......@@ -2,6 +2,6 @@
set -e
BUILDDEPENDS="curl gcc gettext musl-dev"
BUILDDEPENDS="curl jq coreutils gcc gettext musl-dev"
RUNDEPENDS="git git-daemon unzip openssh gnupg"
......@@ -6,12 +6,5 @@
RUNDEPENDS="git git-daemon unzip openssh gnupg"
if echo "$HG" | fgrep -q .
then
PIPDEPENDS="mercurial~=$HG.0"
else
PIPDEPENDS="https://foss.heptapod.net/octobus/mercurial-devel/-/archive/branch/$HG.tar.gz"
fi
if echo "$PYTHON" | grep -q ^2
then
PIPDEPENDS="$PIPDEPENDS dulwich~=0.19.0"
......@@ -30,4 +23,24 @@
python -m pip --no-cache-dir install $PIPDEPENDS
# handle pre-release versions
get_version() {
curl -s "https://pypi.org/pypi/$1/json" \
| jq -r '.releases | keys_unsorted | .[]' \
| grep "^$2" \
| sort --version-sort \
| tail -1
}
hgversion=$(get_version mercurial $HG)
if test -n "$hgversion"
then
python -m pip install --pre mercurial==$hgversion
else
# unreleased, so fetch directly from Heptapod itself
python -m pip install \
https://foss.heptapod.net/octobus/mercurial-devel/-/archive/branch/$HG/hg.tar.bz2
fi
apk del $BUILDDEPENDS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment