Skip to content

Commit 78d9c07

Browse files
3.0 (#40)
1 parent 6ca3009 commit 78d9c07

File tree

132 files changed

+6543
-2239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+6543
-2239
lines changed

.github/workflows/publish-dockerhub.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,32 @@ on:
88
jobs:
99
buildx:
1010
runs-on: ubuntu-latest
11+
environment: dockerhub
1112
steps:
12-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1314
with:
1415
ref: master
1516

1617
- name: Set up QEMU
17-
uses: docker/setup-qemu-action@v2
18+
uses: docker/setup-qemu-action@v3
1819
with:
1920
platforms: all
2021

2122
- name: Set up Docker Buildx
2223
id: buildx
23-
uses: docker/setup-buildx-action@v2
24+
uses: docker/setup-buildx-action@v3
2425
with:
2526
version: latest
2627

2728
- name: Login to DockerHub
28-
uses: docker/login-action@v2
29+
uses: docker/login-action@v3
2930
with:
3031
username: ${{ secrets.DOCKER_HUB_USER }}
3132
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3233

3334
- name: Build and push
3435
id: docker_build
35-
uses: docker/build-push-action@v4
36+
uses: docker/build-push-action@v5
3637
with:
3738
push: true
3839
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6

.github/workflows/publish-pypi.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ jobs:
77
build-n-publish:
88
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
99
runs-on: ubuntu-latest
10-
10+
environment: pypi
11+
permissions:
12+
# IMPORTANT: this permission is mandatory for trusted publishing
13+
id-token: write
1114
steps:
12-
- uses: actions/checkout@v3
15+
16+
- uses: actions/checkout@v4
1317
with:
1418
ref: master
19+
1520
- name: Set up Python 3.10
16-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
1722
with:
1823
python-version: '3.10'
1924

@@ -27,7 +32,4 @@ jobs:
2732
python setup.py sdist bdist_wheel
2833
2934
- name: Publish distribution to PyPI
30-
uses: pypa/gh-action-pypi-publish@master
31-
with:
32-
user: __token__
33-
password: ${{ secrets.pypi_api_key }}
35+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run_tox.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
name:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-python@v4
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
1212
with:
1313
python-version: '3.10'
1414
- uses: pre-commit/action@v3.0.0
@@ -20,12 +20,12 @@ jobs:
2020
strategy:
2121
max-parallel: 4
2222
matrix:
23-
python-version: ['3.8', '3.9', '3.10', '3.11']
23+
python-version: ['3.10', '3.11', '3.12']
2424

2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,17 @@ repos:
66
- id: check-builtin-literals
77
- id: check-docstring-first
88
- id: check-merge-conflict
9-
# - id: check-toml
9+
- id: check-toml
1010
- id: check-yaml
1111
- id: debug-statements
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
1414

1515

16-
- repo: https://github.com/pycqa/isort
17-
rev: 5.12.0
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.3.4
1818
hooks:
19-
- id: isort
20-
name: isort (python)
21-
22-
23-
- repo: https://github.com/PyCQA/flake8
24-
rev: '6.0.0'
25-
hooks:
26-
- id: flake8
27-
additional_dependencies:
28-
- flake8-bugbear==23.2.13
29-
- flake8-comprehensions==3.10.1
30-
- flake8-pytest-style==1.6
31-
# - flake8-spellcheck==0.28
32-
# - flake8-unused-arguments==0.0.12
33-
- flake8-noqa==1.3
34-
- pep8-naming==0.13.3
35-
36-
37-
- repo: https://github.com/asottile/pyupgrade
38-
rev: v3.3.1
39-
hooks:
40-
- id: pyupgrade
41-
args: ["--py38-plus"]
42-
19+
- id: ruff
4320

4421
- repo: https://github.com/pre-commit/pygrep-hooks
4522
rev: v1.10.0

.ruff.toml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
line-length = 120
3+
indent-width = 4
4+
5+
target-version = "py310"
6+
src = ["src", "test"]
7+
8+
[lint]
9+
10+
# https://docs.astral.sh/ruff/settings/#ignore-init-module-imports
11+
ignore-init-module-imports = true
12+
13+
select = [
14+
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
15+
"I", # https://docs.astral.sh/ruff/rules/#isort-i
16+
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
17+
18+
"A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a
19+
"ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async
20+
"C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
21+
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
22+
"FIX", # https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
23+
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
24+
"ISC", # https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
25+
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
26+
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
27+
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
28+
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
29+
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
30+
"SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot
31+
"T10", # https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
32+
"TCH", # https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
33+
"TD", # https://docs.astral.sh/ruff/rules/#flake8-todos-td
34+
35+
"TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try
36+
"FLY", # https://docs.astral.sh/ruff/rules/#flynt-fly
37+
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
38+
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
39+
40+
# "PL", # https://docs.astral.sh/ruff/rules/#pylint-pl
41+
# "FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
42+
]
43+
44+
ignore = [
45+
"RET501", # https://docs.astral.sh/ruff/rules/unnecessary-return-none/#unnecessary-return-none-ret501
46+
"TRY400", # https://docs.astral.sh/ruff/rules/error-instead-of-exception/
47+
48+
"A003", # https://docs.astral.sh/ruff/rules/builtin-attribute-shadowing/
49+
50+
"UP038", # https://docs.astral.sh/ruff/rules/non-pep604-isinstance/
51+
]
52+
53+
54+
[format]
55+
# Use single quotes for non-triple-quoted strings.
56+
quote-style = "single"
57+
58+
59+
60+
[lint.flake8-builtins]
61+
builtins-ignorelist = ["id", "input"]
62+
63+
64+
[lint.per-file-ignores]
65+
"docs/conf.py" = ["INP001", "A001"]
66+
"setup.py" = ["PTH123"]
67+
"tests/*" = [
68+
"ISC002", # Implicitly concatenated string literals over multiple lines
69+
"E501", # Line too long
70+
"INP001", # File `FILE_NAME` is part of an implicit namespace package. Add an `__init__.py`
71+
]
72+
73+
74+
75+
[lint.isort]
76+
# https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports
77+
lines-after-imports = 2

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10-alpine
1+
FROM python:3.11-alpine
22

33
VOLUME /sml2mqtt
44

docs/cli.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**************************************
2+
Command Line Interface
3+
**************************************
4+
5+
.. _COMMAND_LINE_INTERFACE:
6+
7+
.. exec_code::
8+
:hide_code:
9+
10+
import sml2mqtt.__args__
11+
sml2mqtt.__args__.get_command_line_args(['-h'])

docs/conf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
import re
33
import sys
4+
from pathlib import Path
5+
46

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

@@ -50,7 +52,7 @@
5052
autoclass_content = 'class'
5153

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

5557

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

0 commit comments

Comments
 (0)