Skip to content

Commit f60b4ad

Browse files
author
MarcoFalke
committed
Merge #11835: Add Travis check for unused Python imports
d60b320 Add Travis check for unused Python imports (practicalswift) c7399e7 Remove unused Python imports (practicalswift) Pull request description: Add Travis check for unused Python imports. ``` $ contrib/devtools/lint-python.sh ./test/functional/example_test.py:18:1: F401 'test_framework.mininode.NODE_NETWORK' imported but unused ./test/functional/test_framework/messages.py:27:1: F401 'test_framework.util.wait_until' imported but unused ./test/functional/test_framework/test_framework.py:16:1: F401 'traceback' imported but unused ``` Tree-SHA512: 78e50fb1488abe3ebe365e766cb8d6d448cf1bd16c8691e102cb9bf7c202988bdf6e10b25ff772c62e05c72568168462e88cdc7ad98069d9eb3be727735b2d56
2 parents 59d3dc8 + d60b320 commit f60b4ad

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
- WINEDEBUG=fixme-all
2222
matrix:
2323
# ARM
24-
- HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
24+
- HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf python3-pip" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
2525
# Win32
2626
- HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.6" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-reduce-exports"
2727
# Qt4 & system libs
@@ -43,6 +43,7 @@ install:
4343
- if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi
4444
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
4545
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi
46+
- if [ "$CHECK_DOC" = 1 -a "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then travis_retry pip3 install flake8 --user; fi
4647
before_script:
4748
- if [ "$CHECK_DOC" = 1 -a "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi
4849
- if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/git-subtree-check.sh src/crypto/ctaes; fi

contrib/devtools/lint-python.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2017 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Check for specified flake8 warnings in python files.
8+
9+
# F401: module imported but unused
10+
flake8 --ignore=B,C,E,F,I,N,W --select=F401 .

test/functional/example_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
mininode_lock,
2323
msg_block,
2424
msg_getdata,
25-
NODE_NETWORK,
2625
)
2726
from test_framework.test_framework import BitcoinTestFramework
2827
from test_framework.util import (

test/functional/test_framework/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import time
2525

2626
from test_framework.siphash import siphash256
27-
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str, wait_until
27+
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
2828

2929
MIN_VERSION_SUPPORTED = 60001
3030
MY_VERSION = 70014 # past bip-31 for ping/pong

test/functional/test_framework/test_framework.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import sys
1414
import tempfile
1515
import time
16-
import traceback
1716

1817
from .authproxy import JSONRPCException
1918
from . import coverage

0 commit comments

Comments
 (0)