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

24.11.0 #459

Merged
merged 87 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
68a2419
fix
spacemanspiff2007 Aug 2, 2024
89bbc0f
change example path to default name of param directory (#454)
Rosi2143 Sep 3, 2024
e09cacc
start new scheduler
spacemanspiff2007 Sep 17, 2024
95a6eb3
.
spacemanspiff2007 Sep 18, 2024
72bb5b9
Updated type hints to 3.10
spacemanspiff2007 Sep 18, 2024
e41bebd
Fix scheduler
spacemanspiff2007 Sep 18, 2024
8567284
.
spacemanspiff2007 Sep 19, 2024
29c5215
.
spacemanspiff2007 Sep 19, 2024
4b21d93
.
spacemanspiff2007 Sep 19, 2024
d7da345
fix setup
spacemanspiff2007 Sep 19, 2024
895b372
fix setup
spacemanspiff2007 Sep 19, 2024
104c71c
removed python 3.8 and 3.9
spacemanspiff2007 Sep 19, 2024
af90fa9
Fix scheduler thread access
spacemanspiff2007 Sep 22, 2024
baeb222
docs
spacemanspiff2007 Sep 23, 2024
2eb1106
.
spacemanspiff2007 Sep 24, 2024
d84041e
moved shutdown to core
spacemanspiff2007 Sep 24, 2024
e7377ca
.
spacemanspiff2007 Sep 24, 2024
da238b4
Wrapped functions can return something
spacemanspiff2007 Sep 25, 2024
dbfee42
Fixed issue with logging config
spacemanspiff2007 Sep 27, 2024
927f0b5
Fixed issue with profiler
spacemanspiff2007 Sep 27, 2024
ce56f68
Hints
spacemanspiff2007 Sep 27, 2024
3c45df8
Dev4
spacemanspiff2007 Sep 29, 2024
dd540fd
Dev5
spacemanspiff2007 Sep 30, 2024
e65d80c
DEV6: remove whole item registry from traceback,
spacemanspiff2007 Oct 8, 2024
0dbac80
.
spacemanspiff2007 Oct 8, 2024
efd5984
Added config for country
spacemanspiff2007 Oct 9, 2024
40eeb51
- Added config for country
spacemanspiff2007 Oct 9, 2024
9a7f6d1
- Dev7: Fixed logical error for instantview
spacemanspiff2007 Oct 10, 2024
1d81ba0
fixed test
spacemanspiff2007 Oct 10, 2024
996ba9b
updated eb
spacemanspiff2007 Oct 10, 2024
d395e4c
DEV-8: Added option do dump traceback
spacemanspiff2007 Oct 14, 2024
8e81528
reworked some logging setup
spacemanspiff2007 Oct 14, 2024
2fbb7bb
.
spacemanspiff2007 Oct 14, 2024
534acc7
Added ValueCommandEvent
spacemanspiff2007 Oct 17, 2024
bb7c6d4
Added command_value to the item
spacemanspiff2007 Oct 17, 2024
03b4867
Dev 9: reworked debug
spacemanspiff2007 Oct 18, 2024
47bf147
docs
spacemanspiff2007 Oct 18, 2024
b0f26d5
tox
spacemanspiff2007 Oct 18, 2024
56eacc9
ci
spacemanspiff2007 Oct 18, 2024
8e1ee87
ci
spacemanspiff2007 Oct 18, 2024
9ce7436
ci
spacemanspiff2007 Oct 18, 2024
b59e3da
ci
spacemanspiff2007 Oct 18, 2024
f98484b
tox
spacemanspiff2007 Oct 18, 2024
ec32c87
tox
spacemanspiff2007 Oct 18, 2024
3a4c5cf
tox
spacemanspiff2007 Oct 18, 2024
3e151c9
tox
spacemanspiff2007 Oct 18, 2024
c11603b
tox
spacemanspiff2007 Oct 18, 2024
e8d1b54
fixed some wrong type hints
spacemanspiff2007 Oct 18, 2024
400d1dd
tc oh scheduler
spacemanspiff2007 Oct 21, 2024
b774e8d
DEV10: Fix Scheduler
spacemanspiff2007 Oct 21, 2024
5f12c49
Add migration
spacemanspiff2007 Oct 21, 2024
c3f5735
.
spacemanspiff2007 Oct 21, 2024
22aeec5
Fixed some hints
spacemanspiff2007 Oct 23, 2024
e443d07
Fix Handy Wecker
spacemanspiff2007 Oct 24, 2024
628ceaa
- Added MqttTopicInfo
spacemanspiff2007 Oct 28, 2024
1d580fa
ci
spacemanspiff2007 Oct 28, 2024
d5d9a68
renamed to MqttPublishOptions
spacemanspiff2007 Oct 30, 2024
89bf281
Pin eascheduler release
spacemanspiff2007 Nov 13, 2024
603f1c4
.
spacemanspiff2007 Nov 13, 2024
dcf3852
.
spacemanspiff2007 Nov 13, 2024
2321f38
.
spacemanspiff2007 Nov 13, 2024
31d4709
enable 3.13
spacemanspiff2007 Nov 13, 2024
c8da639
.
spacemanspiff2007 Nov 13, 2024
1012416
.
spacemanspiff2007 Nov 13, 2024
ff56462
.
spacemanspiff2007 Nov 13, 2024
3d498e7
.
spacemanspiff2007 Nov 13, 2024
2675bdb
.
spacemanspiff2007 Nov 13, 2024
74befa6
.
spacemanspiff2007 Nov 13, 2024
a2a6ba0
.
spacemanspiff2007 Nov 13, 2024
adeb2bc
.
spacemanspiff2007 Nov 13, 2024
5f323d6
ci
spacemanspiff2007 Nov 13, 2024
ba5181f
ci
spacemanspiff2007 Nov 13, 2024
a05ab62
ci
spacemanspiff2007 Nov 13, 2024
99a5d67
ci
spacemanspiff2007 Nov 13, 2024
b68b8d6
ci
spacemanspiff2007 Nov 13, 2024
6cf1dda
ci
spacemanspiff2007 Nov 13, 2024
00ab106
dependencies
spacemanspiff2007 Nov 15, 2024
f5e0a77
Fix RuleRunner
spacemanspiff2007 Nov 18, 2024
c54d81d
docs
spacemanspiff2007 Nov 18, 2024
66a57e3
docs
spacemanspiff2007 Nov 18, 2024
f85504f
Align itemwatcher timedelta with eascheduler
spacemanspiff2007 Nov 20, 2024
0174750
.
spacemanspiff2007 Nov 20, 2024
5548301
24.11.0
spacemanspiff2007 Nov 22, 2024
a7c2c97
.
spacemanspiff2007 Nov 22, 2024
cde44f8
Merge branch 'master' into Develop
spacemanspiff2007 Nov 22, 2024
3232d37
.
spacemanspiff2007 Nov 22, 2024
1208539
.
spacemanspiff2007 Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
with:
ref: master

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

- name: Install setuptools
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- uses: pre-commit/[email protected]


Expand All @@ -20,7 +20,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 16 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -15,14 +15,27 @@ repos:


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.8.0
hooks:
- id: ruff
name: ruff unused imports
# F401 [*] {name} imported but unused
args: [ "--select", "F401,I001", "--extend-exclude", "__init__.py", "--fix"]

- id: ruff
# I001 [*] Import block is un-sorted or un-formatted
# UP035 [*] Import from {target} instead: {names}
# Q000 [*] Double quote found but single quotes preferred
# Q001 [*] Double quote multiline found but single quotes preferred
args: [ "--select", "I001,UP035,Q000,Q001", "--fix"]
args: [ "--select", "UP035,Q000,Q001", "--fix"]


- repo: https://github.com/JelleZijlstra/autotyping
rev: 24.9.0
hooks:
- id: autotyping
types: [python]
args: [--safe]


- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ formats: all
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"
apt_packages:
- graphviz

Expand Down
126 changes: 81 additions & 45 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,77 +1,113 @@

line-length = 120
indent-width = 4
line-length = 120

target-version = "py38"
src = ["src", "test"]

target-version = "py310"

extend-exclude = [
"__init__.py",
"src/__test_*.py"
src = [
"src",
"tests"
]
extend-exclude = ["src/__test_*.py"]


[lint]
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
]
select = ["ALL"]

ignore = [
"D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf

"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/
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A003", # Python builtin is shadowed by class attribute {name} from {row}

# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F401", # {name} imported but unused; consider using importlib.util.find_spec to test for availability

# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes

# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP038", # Use X | Y in {} call instead of (X, Y)

# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN101", # Missing type annotation for {name} in method
"ANN102", # Missing type annotation for {name} in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}

# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE001", # Do not catch blind exception: {name}

# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE102", # Unnecessary parentheses on raised exception

# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing
"COM819", # Trailing comma prohibited

# https://docs.astral.sh/ruff/rules/#warning-w_1
"PLW0603", # Using the global statement to update {name} is discouraged

# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"G004", # Logging statement uses f-string

# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR1711", # Useless return statement at end of function

# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF005", # Consider {expression} instead of concatenation

# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"PT007", # Wrong values type in @pytest.mark.parametrize expected {values} of {row}
]


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


# https://docs.astral.sh/ruff/settings/#lintflake8-quotes
[lint.flake8-quotes]
inline-quotes = "single"
inline-quotes = "single"
multiline-quotes = "single"


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


# https://docs.astral.sh/ruff/settings/#lintisort
[lint.isort]
lines-after-imports = 2 # https://docs.astral.sh/ruff/settings/#lint_isort_lines-after-imports


[lint.per-file-ignores]
"docs/conf.py" = ["INP001", "A001"]
"docs/conf.py" = [
"INP001", # File `conf.py` is part of an implicit namespace package. Add an `__init__.py`.
"A001", # Variable `copyright` is shadowing a Python builtin
"PTH118", # `os.path.join()` should be replaced by `Path` with `/` operator
"PTH100", # `os.path.abspath()` should be replaced by `Path.resolve()`
]

"setup.py" = ["PTH123"]

"run/**" = ["INP001"]

"tests/*" = [
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann

[lint.isort]
# https://docs.astral.sh/ruff/settings/#isort-lines-after-imports
lines-after-imports = 2
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S101", # Use of assert detected

# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLR0913", # Too many arguments in function definition ({c_args} > {max_args})
]

"interface_*.py" = [
"F401" # F401 [*] {name} imported but unused
]
2 changes: 1 addition & 1 deletion docs/advanced_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Example
# depends on:
# - rules/rule_file.py
# reloads on:
# - params/param_file.yml
# - param/param_file.yml

import HABApp
...
Expand Down
65 changes: 3 additions & 62 deletions docs/class_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,11 @@ ItemNoChangeWatch
:member-order: groupwise


Scheduler
======================================


OneTimeJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.OneTimeJob
:members:
:inherited-members:
:member-order: groupwise

CountdownJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.CountdownJob
:members:
:inherited-members:
:member-order: groupwise

ReoccurringJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.ReoccurringJob
:members:
:inherited-members:
:member-order: groupwise

DayOfWeekJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.DayOfWeekJob
:members:
:inherited-members:
:member-order: groupwise

DawnJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.DawnJob
:members:
:inherited-members:
:member-order: groupwise

SunriseJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.SunriseJob
:members:
:inherited-members:
:member-order: groupwise

SunsetJob
""""""""""""""""""""""""""""""""""""""

.. autoclass:: HABApp.rule.scheduler.jobs.SunsetJob
:members:
:inherited-members:
:member-order: groupwise

DuskJob
""""""""""""""""""""""""""""""""""""""
InstantView
======================================

.. autoclass:: HABApp.rule.scheduler.jobs.DuskJob
.. autoclass:: HABApp.core.lib.InstantView
:members:
:inherited-members:
:member-order: groupwise
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
logger_lvl = logging.DEBUG if IS_RTD_BUILD or IS_CI else logging.INFO # set level to DEBUG for CI


def log(msg: str):
def log(msg: str) -> None:
sphinx_logger.log(logger_lvl, f'[POST] {msg:s}')


Expand Down Expand Up @@ -87,7 +87,7 @@ def log(msg: str):
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = {'.rst': 'restructuredtext'}

# The master toctree document.
master_doc = 'index'
Expand Down Expand Up @@ -123,7 +123,6 @@ def log(msg: str):
'canonical_url': '',
# 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
# 'vcs_pageview_mode': '',
Expand Down Expand Up @@ -233,7 +232,7 @@ def log(msg: str):

nitpick_ignore_regex = [
(re.compile(r'py:data|py:class'), re.compile(r'typing\..+')),
(re.compile(r'py:class'), re.compile(r'(?:datetime|pendulum|aiohttp|pathlib)\..+'))
(re.compile(r'py:class'), re.compile(r'(?:datetime|aiohttp|pathlib)\..+'))
]

# -- Extension configuration -------------------------------------------------
Expand Down Expand Up @@ -295,7 +294,7 @@ def replace_node_contents(node: Node):
replacement = TYPE_REPLACEMENTS.get(node_text)

# https://www.sphinx-doc.org/en/master/extdev/nodes.html
if isinstance(node, desc_signature) and node.attributes.get('fullname', '').endswith('Item'):
if isinstance(node, desc_signature) and node.attributes.get('fullname', '').endswith(('Item', 'JobControl')):
log(f'Removing constructor signature of {", ".join(node.attributes["ids"])}')
assert len(node.children) == 3
signature_node = node.children[2]
Expand Down Expand Up @@ -323,22 +322,23 @@ def replace_node_contents(node: Node):
return matched_nodes


def transform_desc(app, domain, objtype: str, contentnode):
def transform_desc(app, domain, objtype: str, contentnode) -> None:
# if objtype != 'pydantic_field':
# return None

replace_node_contents(node=contentnode.parent)


def setup(app):
def setup(app) -> None:
app.connect('object-description-transform', transform_desc)


# -- Options for intersphinx -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html
if IS_RTD_BUILD:
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None)
'python': ('https://docs.python.org/3', None),
'whenever': ('https://whenever.readthedocs.io/en/stable', None)
}

# Don't show warnings for missing python references since these are created via intersphinx during the RTD build
Expand Down
Loading