Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.10"]
python-version: ["3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand All @@ -25,9 +25,13 @@ jobs:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

# https://github.com/astral-sh/setup-uv
- name: Install UV
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
enable-cache: true
ignore-nothing-to-cache: true
python-version: ${{ matrix.python-version }}

- name: Install PyMBus
Expand Down
37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# CHANGELOG

## v0.4.0

- remake VIF codes ([PR-17](https://github.com/stankudrow/pymbus/pull/17) + [PR-18](https://github.com/stankudrow/pymbus/pull/18)):
- only one VIFCode (data)class for coding
- the `get_vif_code` factory method is improved

- subclass TelegramContainer from the `Sequence` ABC ([PR-16](https://github.com/stankudrow/pymbus/pull/16))

- subclass the TelegramField class from Python `int` type ([PR-15](https://github.com/stankudrow/pymbus/pull/15)):
- make TelegramField support the operations that `int` does;
- ensure the byte range validation for TelegramField -> the `validate` flag removed;
- unburden and simplify TelegramField successors and classes derived from TelegramContainer;
- revises the [PR-11](https://github.com/stankudrow/pymbus/pull/11).

- submodule specific Telegram fields (A, C, CI, Data, Value) ([PR-12](https://github.com/stankudrow/pymbus/pull/12))

- improve Telegram classes ([PR-11](https://github.com/stankudrow/pymbus/pull/11)):
- the API of TelegramField is enriched:
- `total_ordering` is enabled - the full set of arithmetic comparison operators are on
- bitwise operator support:
- and (&)
- or (|)
- xor (^)
- inversion (~)
- the `validate` flag is added
- the `byte` attribute is removed
- the API of TelegramContainer is enriched:
- `total_ordering` is enabled
- the `validate` flag is added
- all entities related to the the TelegramField and TelegramContainer classes are updated
- introduce the `utils` module with the `validate_byte` function
- some obsolete entities are removed

## v0.3.0

[PR-8](https://github.com/stankudrow/pymbus/pull/8)
Expand All @@ -12,7 +45,7 @@ Added:

Changed:

- update project metadata;
- update the project metadata;
- lint the code and test base(s).

## v0.2.0
Expand All @@ -27,7 +60,7 @@ Added:

Changed:

- API: reconsidered and flatten;
- API: reconsidered and flattened;
- the former `DataRecord` class is now `DataRecordHeader`.

## v0.1.0
Expand Down
28 changes: 23 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"License :: Public Domain",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython"
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
keywords = ["meter-bus", "m-bus", "meters"]
dependencies = []
Expand All @@ -40,6 +38,12 @@ dev = [
"ruff>=0.9.7",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.coverage.run]
branch = true
omit = ["tests"]
Expand Down Expand Up @@ -119,14 +123,18 @@ select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
# "D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle (Error)
"EM", # flake8-errmsg
"ERA", # eradicate
"F", # Pyflakes
"FBT", # flake8-boolean-trap
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming (N)
"PIE", # flake8-pie
"PT", # pytest-style
"PYI", # flake8-pyi
Expand All @@ -136,23 +144,33 @@ select = [
"S", # flake8-bandit
"SLF", # flake8-self
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T", # flake8-print-linter
"T10", # flake8-debugger
"T20", # flake8-print
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle (Warning)
"YTT", # flake8-2020
]
ignore = [
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"D105", # https://docs.astral.sh/ruff/rules/undocumented-magic-method/
"ISC001", # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
]
fixable = ["I", "ICN", "ISC"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"{src,tests}/*.py" = [
"N817", # https://docs.astral.sh/ruff/rules/camelcase-imported-as-acronym/
]
"src/pymbus/codes/vif.py" = ["ERA001"]
"tests/*.py" = [
"ANN201", # https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function/
"D",
"ERA",
"FBT001", # https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/
"PT011", # https://docs.astral.sh/ruff/rules/pytest-raises-too-broad/
"S",
Expand Down
195 changes: 0 additions & 195 deletions src/pymbus/codes/value_info.py

This file was deleted.

Loading