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 = "*"
tox = "*"
dominate = "*"
flake8-requirements = ">=1.3.2"
# hardware tests
pyserial = "*"

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

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

@ -21,6 +21,11 @@ ignore =
E741,
# W503: line break before binary operator
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]
multi_line_output = 3

@ -14,8 +14,18 @@ install_requires = [
"construct>=2.9",
"typing_extensions>=3.7.4",
"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__))
@ -48,10 +58,7 @@ setup(
package_dir={"": "src"},
entry_points={"console_scripts": ["trezorctl=trezorlib.cli.trezorctl:cli"]},
install_requires=install_requires,
extras_require={
"hidapi": ["hidapi>=0.7.99.post20"],
"ethereum": ["rlp>=1.1.0", "web3>=4.8"],
},
extras_require=extras_require,
python_requires=">=3.5",
include_package_data=True,
zip_safe=False,

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

@ -5,7 +5,7 @@ from typing import Any, List, Optional
import click
import construct as c
from trezorlib import cosi, firmware
from .. import cosi, firmware
try:
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
in a messed state.
"""
from trezorlib.transport.webusb import WebUsbTransport
from ..transport.webusb import WebUsbTransport
WebUsbTransport.enumerate(usb_reset=True)

@ -32,7 +32,7 @@ try:
from PyQt5.QtGui import QRegExpValidator
from PyQt5.QtCore import QRegExp, Qt, QT_VERSION_STR
except Exception:
from PyQt4.QtGui import (
from PyQt4.QtGui import ( # noqa: I
QPushButton,
QLineEdit,
QSizePolicy,
@ -44,7 +44,7 @@ except Exception:
QVBoxLayout,
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):

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

Loading…
Cancel
Save