test(python): add flake8-requirements

pull/1295/head
matejcik 4 years ago
parent 2173ad97bc
commit 6dda240f5c

@ -23,6 +23,7 @@ pytest-random-order = "*"
pytest-timeout = "*" pytest-timeout = "*"
tox = "*" tox = "*"
dominate = "*" dominate = "*"
flake8-requirements = ">=1.3.2"
# hardware tests # hardware tests
pyserial = "*" pyserial = "*"

@ -73,6 +73,7 @@ inotify = "*"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
scan-build = "*" scan-build = "*"
flake8-requirements = "^1.3.2"
[build-system] [build-system]
requires = ["poetry>=0.12"] requires = ["poetry>=0.12"]

@ -6,3 +6,4 @@ libusb1>=1.6.4
construct>=2.9,!=2.10.55 construct>=2.9,!=2.10.55
typing_extensions>=3.7.4 typing_extensions>=3.7.4
pyblake2>=0.9.3 ; python_version<'3.6' pyblake2>=0.9.3 ; python_version<'3.6'
attrs

@ -21,6 +21,11 @@ ignore =
E741, E741,
# W503: line break before binary operator # W503: line break before binary operator
W503 W503
per-file-ignores =
helper-scripts/*:I
tools/*:I
tests/*:I
known-modules = libusb1:[usb1],hidapi:[hid],attrs:[attr],PyQt5:[PyQt5.QtWidgets,PyQt5.QtGui,PyQt5.QtCore]
[isort] [isort]
multi_line_output = 3 multi_line_output = 3

@ -14,8 +14,18 @@ install_requires = [
"construct>=2.9", "construct>=2.9",
"typing_extensions>=3.7.4", "typing_extensions>=3.7.4",
"pyblake2>=0.9.3 ; python_version<'3.6'", "pyblake2>=0.9.3 ; python_version<'3.6'",
"attrs",
] ]
extras_require = {
"hidapi": ["hidapi>=0.7.99.post20"],
"ethereum": ["rlp>=1.1.0", "web3>=4.8"],
"qt-widgets": ["PyQt5"],
"extra": ["Pillow"],
}
extras_require["full"] = sum(extras_require.values(), [])
CWD = os.path.dirname(os.path.realpath(__file__)) CWD = os.path.dirname(os.path.realpath(__file__))
@ -48,10 +58,7 @@ setup(
package_dir={"": "src"}, package_dir={"": "src"},
entry_points={"console_scripts": ["trezorctl=trezorlib.cli.trezorctl:cli"]}, entry_points={"console_scripts": ["trezorctl=trezorlib.cli.trezorctl:cli"]},
install_requires=install_requires, install_requires=install_requires,
extras_require={ extras_require=extras_require,
"hidapi": ["hidapi>=0.7.99.post20"],
"ethereum": ["rlp>=1.1.0", "web3>=4.8"],
},
python_requires=">=3.5", python_requires=">=3.5",
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,

@ -20,8 +20,8 @@ import subprocess
import time import time
from pathlib import Path from pathlib import Path
from trezorlib.debuglink import TrezorClientDebugLink from ..debuglink import TrezorClientDebugLink
from trezorlib.transport.udp import UdpTransport from ..transport.udp import UdpTransport
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

@ -5,7 +5,7 @@ from typing import Any, List, Optional
import click import click
import construct as c import construct as c
from trezorlib import cosi, firmware from .. import cosi, firmware
try: try:
from hashlib import blake2s from hashlib import blake2s

@ -290,7 +290,7 @@ def usb_reset():
This can fix LIBUSB_ERROR_PIPE and similar errors when connecting to a device This can fix LIBUSB_ERROR_PIPE and similar errors when connecting to a device
in a messed state. in a messed state.
""" """
from trezorlib.transport.webusb import WebUsbTransport from ..transport.webusb import WebUsbTransport
WebUsbTransport.enumerate(usb_reset=True) WebUsbTransport.enumerate(usb_reset=True)

@ -32,7 +32,7 @@ try:
from PyQt5.QtGui import QRegExpValidator from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtCore import QRegExp, Qt, QT_VERSION_STR from PyQt5.QtCore import QRegExp, Qt, QT_VERSION_STR
except Exception: except Exception:
from PyQt4.QtGui import ( from PyQt4.QtGui import ( # noqa: I
QPushButton, QPushButton,
QLineEdit, QLineEdit,
QSizePolicy, QSizePolicy,
@ -44,7 +44,7 @@ except Exception:
QVBoxLayout, QVBoxLayout,
QHBoxLayout, QHBoxLayout,
) )
from PyQt4.QtCore import QObject, SIGNAL, QRegExp, Qt, QT_VERSION_STR from PyQt4.QtCore import QObject, SIGNAL, QRegExp, Qt, QT_VERSION_STR # noqa: I
class PinButton(QPushButton): class PinButton(QPushButton):

@ -13,7 +13,9 @@ ignore =
# E741 ambiguous variable name # E741 ambiguous variable name
E741, E741,
# W503: line break before binary operator # W503: line break before binary operator
W503 W503,
# flake8-requirements import checks
I
per-file-ignores = per-file-ignores =
core/mocks/generated/*:F4 core/mocks/generated/*:F4

Loading…
Cancel
Save