maybe_specific_n = $(if $(filter -j%,$(parallel_opt)),-n$(get_parallel_n))
xdist_opt = $(if $(filter -j,$(parallel_opt)),-nauto,$(maybe_specific_n))
-lint: dev/bup-python
+lint: dev/bup-exec dev/bup-python
./pylint
test: all test/tmp dev/python lint
#!/usr/bin/env bash
+ac_help="--with-pylint[=yes|no|maybe] require and run pylint (maybe)"
+
bup_find_prog()
{
# Prints prog path to stdout or nothing.
TARGET=bup
+argv=()
+with_pylint=maybe
+while test $# -gt 0; do
+ case "$1" in
+ --with-pylint=yes) with_pylint=yes; shift;;
+ --with-pylint=maybe) with_pylint=maybe; shift;;
+ --with-pylint=no) with_pylint=no; shift;;
+ *) argv+=("$1"); shift;;
+ esac
+done
+
+# Set $@ to the adjusted args
+set - "${argv[@]}"
+
. ./configure.inc
# FIXME: real tmpdir
mkdir -p config.var.tmp
echo -n "$MAKE" > config.var.tmp/bup-make
echo -n "$bup_python_config" > config.var.tmp/bup-python-config
+echo -n "$with_pylint" > config.var.tmp/with-pylint
mv config.var.tmp config.var
if test -e bin; then rm -r bin; fi
#!/bin/sh
-if test "$#" -gt 0; then
- echo "Usage: configure" 1>&2
- exit 1
-fi
+set -e
-cd config &&
+cd config
exec ./configure "$@"
--- /dev/null
+#!/bin/sh
+"""": # -*-python-*-
+bup_exec="$(dirname "$0")/bup-exec" || exit $?
+exec "$bup_exec" "$0" ${1+"$@"}
+"""
+
+from __future__ import absolute_import, print_function
+
+import sys
+
+try:
+ import pylint
+except ImportError as ex:
+ sys.exit(1)
+except BaseException as ex:
+ print(ex, file=sys.stderr)
+ sys.exit(2)
$common_debs \
python2.7-dev python-fuse \
python-"$xattr" python-tornado python-pytest \
- python-pytest-xdist
+ python-pytest-xdist pylint
;;
python3)
apt-get install -y \
$common_debs \
python3-dev python3-distutils python3-fuse \
python3-"$xattr" python3-tornado python3-pytest \
- python3-pytest-xdist
+ python3-pytest-xdist pylint3
;;
*)
usage 1>&2
-#!/bin/sh
+#!/usr/bin/env bash
# Changes here might also be appropriate for ./pytest
set -eu
+with_pylint=$(cat config/config.var/with-pylint)
+
+case "$with_pylint" in
+ yes) ;;
+ no)
+ echo "./pylint: doing nothing given ./configure --with-pylint=no" 1>&2
+ exit 0
+ ;;
+ maybe)
+ rc=0
+ dev/have-pylint || rc=$?
+ case "$rc" in
+ 0) ;;
+ 1)
+ echo "./pylint: doing nothing (pylint not found)" 1>&2
+ exit 0
+ ;;
+ *) exit "$rc" ;;
+ esac
+ ;;
+ *)
+ printf "./pylint: unexpected config/config.var/with-pylint value %q\n" \
+ "$with_pylint" 1>&2
+ exit 2
+ ;;
+esac
+
script_home="$(cd "$(dirname "$0")" && pwd -P)"
testlibdir="$script_home/test/lib"