Pylint: use -j 0 arg

"-j 0" runs on the number of CPUs available, just
pass that instead of counting CPUs ourselves.

(This removes a stealthy python2 dependency, too.)

Change-Id: Ia058036ce8bd22be3b93a6fb71c66cb1b5e5f394
This commit is contained in:
Eric Harney 2019-09-11 10:55:47 -04:00
parent 2a97de623f
commit 523c5aaa3a
1 changed files with 2 additions and 3 deletions

View File

@ -28,7 +28,6 @@ process_options() {
run_pylint() { run_pylint() {
local target="${scriptargs:-HEAD~1}" local target="${scriptargs:-HEAD~1}"
local concurrency=$(python -c 'import multiprocessing as mp; print(mp.cpu_count())')
CODE_OKAY=0 CODE_OKAY=0
if [[ "$target" = *"all"* ]]; then if [[ "$target" = *"all"* ]]; then
@ -46,14 +45,14 @@ run_pylint() {
echo "Running pylint against manila code modules:" echo "Running pylint against manila code modules:"
printf "\t%s\n" "${files[@]}" printf "\t%s\n" "${files[@]}"
pylint --rcfile=.pylintrc --output-format=colorized ${files} \ pylint --rcfile=.pylintrc --output-format=colorized ${files} \
-E -j $concurrency || CODE_OKAY=1 -E -j 0 || CODE_OKAY=1
fi fi
if [[ -n "${test_files}" ]]; then if [[ -n "${test_files}" ]]; then
echo "Running pylint against manila test modules:" echo "Running pylint against manila test modules:"
printf "\t%s\n" "${test_files[@]}" printf "\t%s\n" "${test_files[@]}"
pylint --rcfile=.pylintrc --output-format=colorized ${test_files} \ pylint --rcfile=.pylintrc --output-format=colorized ${test_files} \
-E -d "no-member,assignment-from-no-return,assignment-from-none" \ -E -d "no-member,assignment-from-no-return,assignment-from-none" \
-j $concurrency || CODE_OKAY=1 -j 0 || CODE_OKAY=1
fi fi
exit $CODE_OKAY exit $CODE_OKAY
} }