diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..5f6b2b0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +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: Install dependencies + run: pip install tox + + - name: Run tests + run: tox + + - name: Code coverage upload + uses: codecov/codecov-action@v1 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 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 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': { 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 diff --git a/tox.ini b/tox.ini index a9a403d..27fc713 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,9 @@ -[tox] -envlist = py35,py36,py37,py38,py39 - [testenv] deps= pytest pytest-cov pylama pytest-asyncio - pytest-catchlog pytest-mock commands= py.test --cov=dsmr_parser test {posargs}