diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cb50efe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: Python package + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip tox + - name: Build and test + run: | + tox diff --git a/.pylintrc b/.pylintrc index 33809a1..1a26ad7 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,5 +1,5 @@ [MESSAGES CONTROL] -disable=invalid-name, missing-docstring, locally-disabled, unbalanced-tuple-unpacking,no-else-return,fixme,duplicate-code,cyclic-import,import-outside-toplevel +disable=invalid-name, missing-docstring, locally-disabled, unbalanced-tuple-unpacking,no-else-return,fixme,duplicate-code,cyclic-import,import-outside-toplevel,consider-using-with [SIMILARITIES] min-similarity-lines=5 diff --git a/libagent/device/trezor.py b/libagent/device/trezor.py index 81104f3..3cb1345 100644 --- a/libagent/device/trezor.py +++ b/libagent/device/trezor.py @@ -71,6 +71,7 @@ class Trezor(interface.Device): log.exception('ping failed: %s', e) connection.close() # so the next HID open() will succeed raise + return None def close(self): """Close connection.""" diff --git a/libagent/device/trezor_defs.py b/libagent/device/trezor_defs.py index 916c869..79107f6 100644 --- a/libagent/device/trezor_defs.py +++ b/libagent/device/trezor_defs.py @@ -28,3 +28,4 @@ def find_device(): return get_transport(os.environ.get("TREZOR_PATH")) except Exception as e: # pylint: disable=broad-except log.debug("Failed to find a Trezor device: %s", e) + return None diff --git a/tox.ini b/tox.ini index acbe911..b6c377b 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ deps= isort<5 commands= pycodestyle libagent - # isort --skip-glob .tox -c -r libagent + # isort --skip-glob .tox -c -rc libagent pylint --reports=no --rcfile .pylintrc libagent pydocstyle libagent coverage run --source libagent -m py.test -v libagent