Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 #40

Merged
merged 82 commits into from
Apr 24, 2024
Merged

3.0 #40

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
b808c6e
First implementation
spacemanspiff2007 Jun 27, 2023
c1f25a5
.
spacemanspiff2007 Jun 27, 2023
e5accb7
Updated packages
spacemanspiff2007 Jun 27, 2023
2f7e1a7
Fixed docs warning
spacemanspiff2007 Jun 27, 2023
e349c64
This is never going to pass CI :S
spacemanspiff2007 Jun 27, 2023
9c46fe1
fix :rolleyes:
spacemanspiff2007 Aug 14, 2023
f561a4f
fix config
spacemanspiff2007 Aug 15, 2023
679c0f1
.
spacemanspiff2007 Feb 29, 2024
95f9732
.
spacemanspiff2007 Mar 1, 2024
a526397
.
spacemanspiff2007 Mar 12, 2024
4d1e9d1
.
spacemanspiff2007 Mar 14, 2024
9d5d9f3
.
spacemanspiff2007 Mar 14, 2024
608e3c1
.
spacemanspiff2007 Mar 14, 2024
205e056
.
spacemanspiff2007 Mar 15, 2024
32d2c72
task sync
spacemanspiff2007 Mar 18, 2024
26fde55
del old
spacemanspiff2007 Mar 18, 2024
a045aca
.
spacemanspiff2007 Mar 19, 2024
d38735b
actions
spacemanspiff2007 Mar 19, 2024
546be47
.
spacemanspiff2007 Mar 19, 2024
d9c05b8
better config error messages
spacemanspiff2007 Mar 19, 2024
33e0071
.
spacemanspiff2007 Mar 19, 2024
46d381d
.
spacemanspiff2007 Mar 20, 2024
826fcb8
.
spacemanspiff2007 Mar 20, 2024
3f32d4c
docs
spacemanspiff2007 Mar 20, 2024
d94b85d
.
spacemanspiff2007 Mar 20, 2024
618a01f
.
spacemanspiff2007 Mar 21, 2024
d61df87
.
spacemanspiff2007 Mar 21, 2024
2c03511
.
spacemanspiff2007 Mar 21, 2024
12c6c71
.
spacemanspiff2007 Mar 22, 2024
3fe18e2
.
spacemanspiff2007 Mar 25, 2024
0f9cfa7
.
spacemanspiff2007 Mar 25, 2024
ecc9bb1
.
spacemanspiff2007 Mar 25, 2024
42ba544
.
spacemanspiff2007 Mar 25, 2024
f946f70
.
spacemanspiff2007 Mar 25, 2024
d601f51
.
spacemanspiff2007 Mar 25, 2024
bb93ca6
.
spacemanspiff2007 Mar 25, 2024
6811465
.
spacemanspiff2007 Mar 25, 2024
5f264f1
.
spacemanspiff2007 Mar 25, 2024
693fbbe
.
spacemanspiff2007 Mar 25, 2024
734c111
.
spacemanspiff2007 Mar 25, 2024
fad8a87
.
spacemanspiff2007 Mar 25, 2024
d352d1a
.
spacemanspiff2007 Mar 25, 2024
b193777
.
spacemanspiff2007 Mar 26, 2024
70d20fe
.
spacemanspiff2007 Mar 26, 2024
da12ddc
.
spacemanspiff2007 Mar 26, 2024
ac78807
.
spacemanspiff2007 Mar 26, 2024
438f7c8
added tls
spacemanspiff2007 Mar 27, 2024
4db64a3
added tls
spacemanspiff2007 Mar 27, 2024
f992ec3
.
spacemanspiff2007 Mar 27, 2024
b542977
.
spacemanspiff2007 Mar 27, 2024
8dfcc34
.
spacemanspiff2007 Mar 27, 2024
f21a242
.
spacemanspiff2007 Mar 27, 2024
c2e7fa7
update CI
spacemanspiff2007 Mar 27, 2024
ed38fbe
.
spacemanspiff2007 Mar 27, 2024
d52b2f0
fix
spacemanspiff2007 Mar 28, 2024
93dfbdd
added tests
spacemanspiff2007 Mar 28, 2024
0cd1533
Tibber example
spacemanspiff2007 Mar 28, 2024
bf49b3a
Tibber example
spacemanspiff2007 Mar 28, 2024
ab8f60f
Tibber example
spacemanspiff2007 Mar 28, 2024
de0530d
Tibber example
spacemanspiff2007 Mar 28, 2024
0b97772
docs
spacemanspiff2007 Mar 28, 2024
850dc1a
docs
spacemanspiff2007 Apr 2, 2024
ab18073
Update error handling
spacemanspiff2007 Apr 2, 2024
750580b
update next reset description
spacemanspiff2007 Apr 2, 2024
7b199b9
try again with error
spacemanspiff2007 Apr 8, 2024
7f3e41a
CRC Errors are logged as DEBUG
spacemanspiff2007 Apr 8, 2024
f12c3f5
Fixed tests
spacemanspiff2007 Apr 8, 2024
96c7d4e
.
spacemanspiff2007 Apr 11, 2024
4e74d52
.
spacemanspiff2007 Apr 11, 2024
e985209
.
spacemanspiff2007 Apr 11, 2024
3e8884b
mqtt check for duplicate topics
spacemanspiff2007 Apr 12, 2024
d8faf40
dev7
spacemanspiff2007 Apr 12, 2024
aa83fc1
dev8
spacemanspiff2007 Apr 15, 2024
68fd8a2
.
spacemanspiff2007 Apr 15, 2024
d7d73ed
.
spacemanspiff2007 Apr 15, 2024
10e02b4
.
spacemanspiff2007 Apr 22, 2024
0298186
.
spacemanspiff2007 Apr 23, 2024
f2f9060
.
spacemanspiff2007 Apr 23, 2024
2f89720
.
spacemanspiff2007 Apr 23, 2024
6522e39
.
spacemanspiff2007 Apr 23, 2024
edd81ca
.
spacemanspiff2007 Apr 23, 2024
b2b0359
.
spacemanspiff2007 Apr 24, 2024
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
11 changes: 6 additions & 5 deletions .github/workflows/publish-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,32 @@ on:
jobs:
buildx:
runs-on: ubuntu-latest
environment: dockerhub
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
version: latest

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest

environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
with:
ref: master

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -27,7 +32,4 @@ jobs:
python setup.py sdist bdist_wheel

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_api_key }}
uses: pypa/gh-action-pypi-publish@release/v1
10 changes: 5 additions & 5 deletions .github/workflows/run_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name:
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]
Expand All @@ -20,12 +20,12 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['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
Expand Down
31 changes: 4 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,17 @@ repos:
- id: check-builtin-literals
- id: check-docstring-first
- id: check-merge-conflict
# - id: check-toml
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace


- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: isort
name: isort (python)


- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.2.13
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
# - flake8-spellcheck==0.28
# - flake8-unused-arguments==0.0.12
- flake8-noqa==1.3
- pep8-naming==0.13.3


- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- id: ruff

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand Down
77 changes: 77 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

line-length = 120
indent-width = 4

target-version = "py310"
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 = [
"RET501", # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
"TRY400", # https://docs.astral.sh/ruff/rules/error-instead-of-exception/

"A003", # https://docs.astral.sh/ruff/rules/builtin-attribute-shadowing/

"UP038", # https://docs.astral.sh/ruff/rules/non-pep604-isinstance/
]


[format]
# Use single quotes for non-triple-quoted strings.
quote-style = "single"



[lint.flake8-builtins]
builtins-ignorelist = ["id", "input"]


[lint.per-file-ignores]
"docs/conf.py" = ["INP001", "A001"]
"setup.py" = ["PTH123"]
"tests/*" = [
"ISC002", # Implicitly concatenated string literals over multiple lines
"E501", # Line too long
"INP001", # File `FILE_NAME` 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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-alpine
FROM python:3.11-alpine

VOLUME /sml2mqtt

Expand Down
11 changes: 11 additions & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**************************************
Command Line Interface
**************************************

.. _COMMAND_LINE_INTERFACE:

.. exec_code::
:hide_code:

import sml2mqtt.__args__
sml2mqtt.__args__.get_command_line_args(['-h'])
9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import re
import sys
from pathlib import Path


RTD_BUILD = os.environ.get('READTHEDOCS') == 'True'

Expand Down Expand Up @@ -50,7 +52,7 @@
autoclass_content = 'class'

# so autodoc does find the source
sys.path.insert(0, os.path.join(os.path.abspath('..'), 'src'))
sys.path.insert(0, str(Path(__file__).parent.with_name('src')))


# -- Options for autodoc pydantic -------------------------------------------------
Expand Down Expand Up @@ -86,7 +88,8 @@
# Don't show warnings for missing python references since these are created via intersphinx during the RTD build
if not RTD_BUILD:
nitpick_ignore_regex = [
(re.compile(r'^py:class'), re.compile(r'pathlib\..+')),
(re.compile(r'^py:data'), re.compile(r'typing\..+')),
(re.compile(r'^py:class'), re.compile(r'pydantic\..+|.+Constrained(?:Str|Int)Value')),
(re.compile(r'^py:class'), re.compile(r'pydantic_core\..+')),
# WARNING: py:class reference target not found: sml2mqtt.config.operations.Annotated
(re.compile(r'^py:class'), re.compile(r'.+\.Annotated')),
]
Loading
Loading