Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47d914edb7 | ||
|
|
99ad21c896 | ||
|
|
94189b6b63 | ||
|
|
8829260b15 | ||
|
|
55ac551a2a | ||
|
|
fc65326370 | ||
|
|
059c0802ad |
@@ -12,6 +12,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- '3.6'
|
||||
- '3.7'
|
||||
- '3.8'
|
||||
- '3.9'
|
||||
@@ -21,15 +22,15 @@ jobs:
|
||||
|
||||
name: Python ${{ matrix.python-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cached PIP dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/pip
|
||||
@@ -44,4 +45,4 @@ jobs:
|
||||
run: tox
|
||||
|
||||
- name: Code coverage upload
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
|
||||
+7
-2
@@ -1,9 +1,14 @@
|
||||
Change Log
|
||||
----------
|
||||
|
||||
**1.4.1** (2024-03-12)
|
||||
**1.4.2** (2024-07-14)
|
||||
|
||||
- Avoid loading timezone at runtime (`PR #157 <https://github.com/ndokter/dsmr_parser/pull/157>`_ by `dupondje <https://github.com/elupus>`_)
|
||||
- Bump Github Actions to latest versions in favor of Node deprecations (`PR #159 <https://github.com/ndokter/dsmr_parser/pull/159>`_ by `dennissiemensma <https://github.com/dennissiemensma>`_)
|
||||
- Swap pyserial-asyncio for pyserial-asyncio-fast (`PR #158 <https://github.com/ndokter/dsmr_parser/pull/158>`_ by `bdraco <https://github.com/bdraco>`_)
|
||||
|
||||
**1.4.1** (2024-06-04)
|
||||
|
||||
- Avoid loading timezone at runtime (`PR #157 <https://github.com/ndokter/dsmr_parser/pull/157>`_ by `elupus <https://github.com/elupus>`_)
|
||||
|
||||
**1.4.0** (2024-03-12)
|
||||
|
||||
|
||||
+30
@@ -293,6 +293,36 @@ To install DSMR Parser:
|
||||
|
||||
$ pip install dsmr-parser
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
Create a virtualenv and activate it followed by the installation of the dsmr-parser:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -e .
|
||||
|
||||
Install tox and run it:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install tox
|
||||
tox
|
||||
|
||||
You should see that the tests have succeeded:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
======================================================================================================== 59 passed in 0.91s ========================================================================================================
|
||||
py: commands[1]> pylama dsmr_parser test
|
||||
py: OK (11.55=setup[9.73]+cmd[1.29,0.53] seconds)
|
||||
congratulations :) (11.69 seconds)
|
||||
|
||||
|
||||
Now you can make changes by editing the code and rerunning tox to verify your changes.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from functools import partial
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from serial_asyncio import create_serial_connection
|
||||
from serial_asyncio_fast import create_serial_connection
|
||||
|
||||
from dsmr_parser import telegram_specifications
|
||||
from dsmr_parser.clients.telegram_buffer import TelegramBuffer
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import asyncio
|
||||
|
||||
from serial_asyncio import create_serial_connection
|
||||
from serial_asyncio_fast import create_serial_connection
|
||||
from .protocol import DSMRProtocol, _create_dsmr_protocol
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
import serial
|
||||
import serial_asyncio
|
||||
import serial_asyncio_fast
|
||||
|
||||
from dsmr_parser.clients.telegram_buffer import TelegramBuffer
|
||||
from dsmr_parser.exceptions import ParseError, InvalidChecksumError
|
||||
@@ -77,7 +77,7 @@ class AsyncSerialReader(SerialReader):
|
||||
:rtype: None
|
||||
"""
|
||||
# create Serial StreamReader
|
||||
conn = serial_asyncio.open_serial_connection(**self.serial_settings)
|
||||
conn = serial_asyncio_fast.open_serial_connection(**self.serial_settings)
|
||||
reader, _ = await conn
|
||||
|
||||
while True:
|
||||
@@ -107,7 +107,7 @@ class AsyncSerialReader(SerialReader):
|
||||
"""
|
||||
|
||||
# create Serial StreamReader
|
||||
conn = serial_asyncio.open_serial_connection(**self.serial_settings)
|
||||
conn = serial_asyncio_fast.open_serial_connection(**self.serial_settings)
|
||||
reader, _ = await conn
|
||||
|
||||
while True:
|
||||
|
||||
@@ -31,11 +31,15 @@ class SocketReader(object):
|
||||
buffer = b""
|
||||
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_handle:
|
||||
|
||||
socket_handle.settimeout(60)
|
||||
socket_handle.connect((self.host, self.port))
|
||||
|
||||
while True:
|
||||
buffer += socket_handle.recv(self.BUFFER_SIZE)
|
||||
try:
|
||||
buffer += socket_handle.recv(self.BUFFER_SIZE)
|
||||
except socket.timeout:
|
||||
logger.error("Socket timeout occurred, exiting")
|
||||
break
|
||||
|
||||
lines = buffer.splitlines(keepends=True)
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ setup(
|
||||
author_email='mail@nldr.net',
|
||||
license='MIT',
|
||||
url='https://github.com/ndokter/dsmr_parser',
|
||||
version='1.4.1',
|
||||
version='1.4.2',
|
||||
packages=find_packages(exclude=('test', 'test.*')),
|
||||
install_requires=[
|
||||
'pyserial>=3,<4',
|
||||
'pyserial-asyncio<1',
|
||||
'pyserial-asyncio-fast>=0.11',
|
||||
'pytz',
|
||||
'Tailer==0.4.1',
|
||||
'dlms_cosem==21.3.2'
|
||||
|
||||
@@ -14,6 +14,9 @@ commands=
|
||||
[pylama:dsmr_parser/clients/__init__.py]
|
||||
ignore = W0611
|
||||
|
||||
[pylama:dsmr_parser/clients/socket_.py]
|
||||
ignore = C901
|
||||
|
||||
[pylama:dsmr_parser/parsers.py]
|
||||
ignore = W605
|
||||
|
||||
@@ -24,4 +27,4 @@ ignore = E501
|
||||
max_line_length = 120
|
||||
|
||||
[pylama:pycodestyle]
|
||||
max_line_length = 120
|
||||
max_line_length = 120
|
||||
|
||||
Reference in New Issue
Block a user