]> arthur.barton.de Git - bup.git/blobdiff - dev/prep-for-freebsd-build
cirrus freebsd: install pytest via pip for python 2
[bup.git] / dev / prep-for-freebsd-build
index e56425984ae0070f2d2ae87f3c5e1d8c978e09bd..9631b412cf2d284027f17db4cc2322881899769f 100755 (executable)
@@ -1,11 +1,36 @@
 #!/bin/sh
 
-set -ex
+set -exu
+
+usage()
+{
+    echo "Usage: prep-for-freebsd-build [python2|python3]"
+}
+
+pyver="${1:-python2}"
 
 # Install build deps
 export ASSUME_ALWAYS_YES=yes
 pkg update
-pkg install \
-    gmake git bash rsync curl par2cmdline \
-    python2 python py27-tornado readline \
-    duplicity rdiff-backup rsnapshot
+
+# https://reviews.freebsd.org/D24816
+pkg install rdiff-backup || true
+
+pkgs='gmake git bash rsync curl par2cmdline readline duplicity'
+pkgs="$pkgs rsnapshot"
+
+case "$pyver" in
+    python2)
+        pkgs="$pkgs python2 py27-tornado py27-pip"
+        pkg install $pkgs
+        pip-2.7 install --user pytest pytest-xdist
+        ;;
+    python3)
+        pkgs="$pkgs python37 py37-tornado py37-pytest py37-pytest-xdist"
+        pkg install $pkgs
+        ;;
+    *)
+        usage 1>&2
+        exit 2
+        ;;
+esac