-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
36 changed files
with
264 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ jobs: | |
name: pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- uses: pre-commit/[email protected] | ||
|
@@ -23,9 +23,9 @@ jobs: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
line-length = 120 | ||
indent-width = 4 | ||
|
||
target-version = "py38" | ||
src = ["src", "test"] | ||
|
||
[lint] | ||
|
||
# https://docs.astral.sh/ruff/settings/#ignore-init-module-imports | ||
ignore-init-module-imports = true | ||
|
||
select = [ | ||
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w | ||
"I", # https://docs.astral.sh/ruff/rules/#isort-i | ||
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up | ||
|
||
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a | ||
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async | ||
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4 | ||
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em | ||
"FIX", # https://docs.astral.sh/ruff/rules/#flake8-fixme-fix | ||
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp | ||
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc | ||
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie | ||
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt | ||
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth | ||
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret | ||
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim | ||
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot | ||
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10 | ||
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch | ||
"TD", # https://docs.astral.sh/ruff/rules/#flake8-todos-td | ||
|
||
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try | ||
"FLY", # https://docs.astral.sh/ruff/rules/#flynt-fly | ||
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf | ||
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf | ||
|
||
# "PL", # https://docs.astral.sh/ruff/rules/#pylint-pl | ||
# "FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb | ||
] | ||
|
||
ignore = [ | ||
"PT007" # Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | ||
] | ||
|
||
|
||
[format] | ||
# Use single quotes for non-triple-quoted strings. | ||
quote-style = "single" | ||
|
||
|
||
# [lint.flake8-builtins] | ||
# builtins-ignorelist = ["id", "input"] | ||
|
||
|
||
[lint.per-file-ignores] | ||
"src/smllib/errors.py" = ["A002"] # Argument `type` is shadowing a Python builtin | ||
"src/smllib/sml/_field_info.py" = ["A002"] # Argument `type` is shadowing a Python builtin | ||
"tests/*" = ["INP001"] # INP001 File `PATH` is part of an implicit namespace package. Add an `__init__.py`. | ||
|
||
|
||
[lint.isort] | ||
# https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports | ||
lines-after-imports = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
pytest == 7.4.2 | ||
pre-commit == 3.5.0 | ||
# ----------------------------------------------------------------------------- | ||
# Packages required for testing | ||
# ----------------------------------------------------------------------------- | ||
-r requirements_tests.txt | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Packages for source formatting | ||
# ----------------------------------------------------------------------------- | ||
ruff == 0.3.4 | ||
pre-commit == 3.7.0 | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Packages for other developement tasks | ||
# ----------------------------------------------------------------------------- | ||
pur == 7.3.1 # Update requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest == 8.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from smllib import errors | ||
from smllib.__version__ import __version__ | ||
|
||
|
||
# isort: split | ||
|
||
import smllib.reader | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.3' | ||
__version__ = '1.4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
from ._builder import SmlObjBuilder, T_SML_BUILDER | ||
from ._builder import T_SML_BUILDER, SmlObjBuilder | ||
|
||
|
||
# isort: split | ||
|
||
|
||
from .list_entry import SmlListEntryBuilder | ||
from .message import SmlMessageBuilder | ||
from .response_get_list import SmlGetListResponseBuilder | ||
from .response_open_close import SmlCloseResponseBuilder, SmlOpenResponseBuilder | ||
|
||
|
||
# isort: split | ||
|
||
from .default_context import create_context, CTX_HINT | ||
|
||
from .default_context import CTX_HINT, create_context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
from smllib.sml._base_obj import SmlBaseObj, T_SML_OBJ | ||
from smllib.sml._base_obj import T_SML_OBJ, SmlBaseObj | ||
from smllib.sml.sml_eom import EndOfSmlMsg | ||
|
||
|
||
# isort: split | ||
|
||
|
||
from smllib.sml.sml_choice import SmlChoice | ||
|
||
|
||
# isort: split | ||
from smllib.sml._field_info import inspect_obj, SmlObjFieldInfo | ||
|
||
|
||
from smllib.sml._field_info import SmlObjFieldInfo, inspect_obj | ||
|
||
|
||
# isort: split | ||
|
||
|
||
from smllib.sml.list_entry import SmlListEntry | ||
from smllib.sml.response_get_list import SmlGetListResponse | ||
from smllib.sml.response_open_close import SmlCloseResponse, SmlOpenResponse | ||
from smllib.sml.sml_obis import ObisCode | ||
|
||
|
||
# isort: split | ||
|
||
|
||
from smllib.sml.message import SmlMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.