From 4688cf905862a02f26cc63484d4e5b0edf8f9440 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:26:54 +0200 Subject: [PATCH 1/8] test/test_protocol.py:6:1: W0611 'dsmr_parser.telegram_specifications' imported but unused [pyflakes] test/test_protocol.py:7:1: W0611 'dsmr_parser.parsers.TelegramParser' imported but unused [pyflakes] --- test/test_protocol.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_protocol.py b/test/test_protocol.py index c298d5c..d1393f3 100644 --- a/test/test_protocol.py +++ b/test/test_protocol.py @@ -3,8 +3,6 @@ from unittest.mock import Mock import unittest from dsmr_parser import obis_references as obis -from dsmr_parser import telegram_specifications -from dsmr_parser.parsers import TelegramParser from dsmr_parser.clients.protocol import create_dsmr_protocol From b3a705a74d8eac98210a1fbb3f18406d65c2299c Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:27:22 +0200 Subject: [PATCH 2/8] "pytest-catchlog plugin has been merged into the core, please remove it from your requirements" --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index a9a403d..855f11c 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ deps= pytest-cov pylama pytest-asyncio - pytest-catchlog pytest-mock commands= py.test --cov=dsmr_parser test {posargs} From fcb0dc600baae87a7b5be0580f37cfb56a7e995b Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:28:17 +0200 Subject: [PATCH 3/8] CI tests using Github Actions --- .github/workflows/tests.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..95abb2c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Tests + +on: + push: ~ + pull_request: ~ + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 # Don't run forever when stale + + strategy: + matrix: + python-version: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + + name: Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v2 + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Cached PIP dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache/pip + ~/.tox/python/.pytest_cache + key: pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'tox.ini') }} + restore-keys: pip-${{ matrix.python-version }}- + + - name: Run tests + run: | + pip install tox + tox + + - name: Code coverage upload + uses: codecov/codecov-action@v1 From da98cf1d057147f62d0329fc25eb45659e0219fb Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:28:36 +0200 Subject: [PATCH 4/8] Drop Travis (travis.org is EOL) --- .travis.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bc6b513..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python - -python: - - 2.7 - - 3.5 - - 3.6 - - 3.8 - -install: pip install tox-travis codecov - -script: tox - -after_success: - - codecov - -matrix: - allow_failures: - - python: 2.7 From 62aa0ac3abf22637d3c793e489227e0817493d1e Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:31:11 +0200 Subject: [PATCH 5/8] W0611 'asyncio' imported but unused [pyflakes] --- dsmr_parser/clients/serial_.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dsmr_parser/clients/serial_.py b/dsmr_parser/clients/serial_.py index f63ff07..12d2245 100644 --- a/dsmr_parser/clients/serial_.py +++ b/dsmr_parser/clients/serial_.py @@ -1,4 +1,3 @@ -import asyncio import logging import serial import serial_asyncio From 947fd6437763cad68fc99a1182c65c857639c65e Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:33:22 +0200 Subject: [PATCH 6/8] E501 line too long (170 > 120 characters) [pycodestyle] --- dsmr_parser/telegram_specifications.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsmr_parser/telegram_specifications.py b/dsmr_parser/telegram_specifications.py index 4e59f51..8a0abf5 100644 --- a/dsmr_parser/telegram_specifications.py +++ b/dsmr_parser/telegram_specifications.py @@ -157,7 +157,8 @@ LUXEMBOURG_SMARTY['objects'].update({ obis.LUXEMBOURG_ELECTRICITY_DELIVERED_TARIFF_GLOBAL: CosemParser(ValueParser(Decimal)), }) -# Source: https://www.energiforetagen.se/globalassets/energiforetagen/det-erbjuder-vi/kurser-och-konferenser/elnat/branschrekommendation-lokalt-granssnitt-v2_0-201912.pdf +# Source: https://www.energiforetagen.se/globalassets/energiforetagen/det-erbjuder-vi/kurser-och-konferenser/elnat/ +# branschrekommendation-lokalt-granssnitt-v2_0-201912.pdf SWEDEN = { 'checksum_support': True, 'objects': { From 61de170a79d119606dee08f98309fdc938064722 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:36:46 +0200 Subject: [PATCH 7/8] Tox no longer relies on every Python version installed, due to multiple CI runners --- tox.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/tox.ini b/tox.ini index 855f11c..27fc713 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,3 @@ -[tox] -envlist = py35,py36,py37,py38,py39 - [testenv] deps= pytest From 88ef4f4921ba9ac7ab6ba79384b69ec89b47042c Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Wed, 22 Sep 2021 21:38:24 +0200 Subject: [PATCH 8/8] Split dependency installation step in Actions --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 95abb2c..5f6b2b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,10 +35,11 @@ jobs: key: pip-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'tox.ini') }} restore-keys: pip-${{ matrix.python-version }}- + - name: Install dependencies + run: pip install tox + - name: Run tests - run: | - pip install tox - tox + run: tox - name: Code coverage upload uses: codecov/codecov-action@v1