Add GitHub CI
Fixup a few pylint comments
This commit is contained in:
24
.github/workflows/ci.yml
vendored
Normal file
24
.github/workflows/ci.yml
vendored
Normal file
@@ -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
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[MESSAGES CONTROL]
|
[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]
|
[SIMILARITIES]
|
||||||
min-similarity-lines=5
|
min-similarity-lines=5
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class Trezor(interface.Device):
|
|||||||
log.exception('ping failed: %s', e)
|
log.exception('ping failed: %s', e)
|
||||||
connection.close() # so the next HID open() will succeed
|
connection.close() # so the next HID open() will succeed
|
||||||
raise
|
raise
|
||||||
|
return None
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""Close connection."""
|
"""Close connection."""
|
||||||
|
|||||||
@@ -28,3 +28,4 @@ def find_device():
|
|||||||
return get_transport(os.environ.get("TREZOR_PATH"))
|
return get_transport(os.environ.get("TREZOR_PATH"))
|
||||||
except Exception as e: # pylint: disable=broad-except
|
except Exception as e: # pylint: disable=broad-except
|
||||||
log.debug("Failed to find a Trezor device: %s", e)
|
log.debug("Failed to find a Trezor device: %s", e)
|
||||||
|
return None
|
||||||
|
|||||||
2
tox.ini
2
tox.ini
@@ -16,7 +16,7 @@ deps=
|
|||||||
isort<5
|
isort<5
|
||||||
commands=
|
commands=
|
||||||
pycodestyle libagent
|
pycodestyle libagent
|
||||||
# isort --skip-glob .tox -c -r libagent
|
# isort --skip-glob .tox -c -rc libagent
|
||||||
pylint --reports=no --rcfile .pylintrc libagent
|
pylint --reports=no --rcfile .pylintrc libagent
|
||||||
pydocstyle libagent
|
pydocstyle libagent
|
||||||
coverage run --source libagent -m py.test -v libagent
|
coverage run --source libagent -m py.test -v libagent
|
||||||
|
|||||||
Reference in New Issue
Block a user