[PATCH 1/1] Move pylint from "make check" to a new "make dev-check"

0 views
Skip to first unread message

Rob Browning

unread,
Mar 6, 2026, 7:58:21 PM (8 days ago) Mar 6
to bup-...@googlegroups.com
Don't run pylint for "make check" since pylint versions vary, and lint
failures shouldn't prevent normal build testing.

Add a new dev-check that includes pylint and use it in CI on new
enough platforms. Previously the new linters were failing on
bookworm.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Pushed to main.

.cirrus.yml | 14 +++++++-------
GNUmakefile | 21 +++++++++++++++------
HACKING.md | 17 +++++++++++++----
README.md | 5 +++--
4 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 59f3cfd3..7568801a 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,6 +1,6 @@

task:
- name: debian check/lint root
+ name: debian check (root)
only_if: $CIRRUS_BRANCH != "master"
container:
image: debian:bookworm
@@ -43,7 +43,7 @@ task:
test -e config/config.vars || cat config.log 1>&2

task:
- name: debian check
+ name: debian check / lint
only_if: $CIRRUS_BRANCH != "master"
container:
image: debian:trixie
@@ -56,14 +56,14 @@ task:
dev/system-info
adduser --disabled-password --gecos '' bup
chown -R bup:bup .
- printf "make -j6 -C %q BUP_PYTHON_CONFIG=python3-config check" \
+ printf "make -j6 -C %q BUP_PYTHON_CONFIG=python3-config dev-check" \
"$(pwd)" | su -l bup
on_failure:
debug_script:
test -e config/config.vars || cat config.log 1>&2

task:
- name: freebsd check
+ name: freebsd check / lint
only_if: $CIRRUS_BRANCH != "master"
freebsd_instance:
image: freebsd-13-5-release-amd64
@@ -73,13 +73,13 @@ task:
set -xe
dev/prep-for-freebsd-build
dev/system-info
- gmake -j6 check
+ gmake -j6 dev-check
on_failure:
debug_script:
test -e config/config.vars || cat config.log 1>&2

task:
- name: macos check
+ name: macos check / lint
only_if: $CIRRUS_BRANCH != "master"
macos_instance:
# https://cirrus-ci.org/guide/macOS/
@@ -92,7 +92,7 @@ task:
"$BUP_TEST_OTHER_BUP" version
export PKG_CONFIG_PATH=/usr/local/opt/readline/lib/pkgconfig
dev/system-info
- gmake -j6 BUP_PYTHON_CONFIG=python3-config LDFLAGS=-L/usr/local/lib check
+ gmake -j6 BUP_PYTHON_CONFIG=python3-config LDFLAGS=-L/usr/local/lib dev-check
on_failure:
debug_script:
test -e config/config.vars || cat config.log 1>&2
diff --git a/GNUmakefile b/GNUmakefile
index 6f0f4a1b..3c72b8d8 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -321,12 +321,21 @@ lint-test: dev/bup-exec dev/bup-python
.PHONY: lint
lint: lint-lib lint-test

-check: all test/tmp dev/python lint
- # Ensure we can't test the local bup
- ! bup version
- test "$$(command -v bup)" = '$(CURDIR)/dev/shadow-bin/bup'
- ./bup features
- ./pytest $(xdist_opt)
+define run_check
+ # Ensure we can't test the local bup
+ ! bup version
+ test "$$(command -v bup)" = '$(CURDIR)/dev/shadow-bin/bup'
+ ./bup features
+ ./pytest $(xdist_opt)
+endef
+
+check_targets := all test/tmp dev/python
+
+check: $(check_targets)
+ $(run_check)
+
+dev-check: $(check_targets) lint
+ $(run_check)

distcheck: all
./pytest $(xdist_opt) -m release
diff --git a/HACKING.md b/HACKING.md
index 26f4740b..4fb5198f 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -72,6 +72,14 @@ We also love a good "Tested-by:" -- the more the merrier.
Testing
=======

+You can run the typical development checks via `make dev-check`, which
+includes the test suite and linting via pylint. To omit the linting
+(which can produce false positives, particularly with older versions
+of pylint) run `make check` instead, and you should be able to
+accelerate the tests, particularly if you have the python xdist module
+installed, via `make -j N ...`, with an `N` of perhaps one more than
+your CPU core core count.
+
Individual tests can be run via

./pytest TEST
@@ -81,10 +89,11 @@ For example:
./pytest test/int/test_git.py
./pytest test/ext/test-ftp

-If you have the xdist module installed, then you can specify its `-n`
-option to run the tests in parallel (e.g. `./pytest -nauto ...`), or
-you can specify `-j` to make, which will be translated to xdist with
-`-j` becoming `-nauto` and `-jN` becoming `-nN`.
+If you have the xdist module installed, then you can specify its `-n N`
+option to run the tests in parallel (e.g. `./pytest -n 5 ...`). Here
+too, an `N` of one more than your core count is a reasonable choice,
+and as hinted at above, we translate the make `-j` option to xdist
+`-n`, with `-j` becoming `-n auto` and `-j N` becoming `-n N`.

Internal tests that test bup's code directly are located in test/int,
and external tests that test bup from the outside, typically by
diff --git a/README.md b/README.md
index 6332f3ad..3ea021df 100644
--- a/README.md
+++ b/README.md
@@ -203,11 +203,12 @@ From source
```

If you have the Python xdist module installed, then you can
- probably run the tests faster by adding the make -j option (see <a
+ probably run the tests faster by adding the make `-j N` option,
+ with an N of perhaps one more than your CPU core count (see <a
href="HACKING">./HACKING</a> for additional information):

```sh
- make -j check
+ make -j 5 check
```

The tests should pass (with some skipped tests that weren't
--
2.47.3

Reply all
Reply to author
Forward
0 new messages