Add GitHub CI

Fixup a few pylint comments
This commit is contained in:
Roman Zeyde
2021-05-22 14:51:55 +03:00
parent 36e7afde17
commit 7f4269ab88
5 changed files with 28 additions and 2 deletions

24
.github/workflows/ci.yml vendored Normal file
View 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

View File

@@ -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

View File

@@ -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."""

View File

@@ -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

View File

@@ -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