mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Some release preparation janitoring (#432)
* Use myst-parser for readme.md doc injection * Relax version pins * Define bug tracker and doc links for pypi * Update pre-commit hooks
This commit is contained in:
parent
016f4dfd19
commit
02c857d472
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.3.0
|
rev: v4.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
@ -10,18 +10,18 @@ repos:
|
|||||||
- id: check-ast
|
- id: check-ast
|
||||||
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.2.2
|
rev: v3.3.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: ['--py37-plus']
|
args: ['--py37-plus']
|
||||||
|
|
||||||
- repo: https://github.com/python/black
|
- repo: https://github.com/python/black
|
||||||
rev: 22.10.0
|
rev: 23.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/flake8
|
- repo: https://github.com/pycqa/flake8
|
||||||
rev: 5.0.4
|
rev: 6.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies: [flake8-docstrings]
|
additional_dependencies: [flake8-docstrings]
|
||||||
@ -33,13 +33,13 @@ repos:
|
|||||||
additional_dependencies: [toml]
|
additional_dependencies: [toml]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v0.991
|
rev: v1.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
additional_dependencies: [types-click]
|
additional_dependencies: [types-click]
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/doc8
|
- repo: https://github.com/PyCQA/doc8
|
||||||
rev: 'v1.0.0'
|
rev: 'v1.1.1'
|
||||||
hooks:
|
hooks:
|
||||||
- id: doc8
|
- id: doc8
|
||||||
additional_dependencies: [tomli]
|
additional_dependencies: [tomli]
|
||||||
|
@ -44,7 +44,9 @@ def read_payloads_from_file(file):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
json_payload = json.loads(decrypted)
|
json_payload = json.loads(decrypted)
|
||||||
except Exception as ex: # this can happen when the response is split into multiple tcp segments
|
except (
|
||||||
|
Exception
|
||||||
|
) as ex: # this can happen when the response is split into multiple tcp segments
|
||||||
echo(f"[red]Unable to parse payload '{decrypted}', ignoring: {ex}[/red]")
|
echo(f"[red]Unable to parse payload '{decrypted}', ignoring: {ex}[/red]")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ extensions = [
|
|||||||
"sphinx.ext.viewcode",
|
"sphinx.ext.viewcode",
|
||||||
"sphinx.ext.todo",
|
"sphinx.ext.todo",
|
||||||
"sphinxcontrib.programoutput",
|
"sphinxcontrib.programoutput",
|
||||||
|
"myst_parser",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
@ -62,12 +63,3 @@ todo_include_todos = True
|
|||||||
def setup(app):
|
def setup(app):
|
||||||
# add copybutton to hide the >>> prompts, see https://github.com/readthedocs/sphinx_rtd_theme/issues/167
|
# add copybutton to hide the >>> prompts, see https://github.com/readthedocs/sphinx_rtd_theme/issues/167
|
||||||
app.add_js_file("copybutton.js")
|
app.add_js_file("copybutton.js")
|
||||||
|
|
||||||
# see https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
|
|
||||||
from m2r import MdInclude
|
|
||||||
|
|
||||||
app.add_config_value("no_underscore_emphasis", False, "env")
|
|
||||||
app.add_config_value("m2r_parse_relative_links", False, "env")
|
|
||||||
app.add_config_value("m2r_anonymous_references", False, "env")
|
|
||||||
app.add_config_value("m2r_disable_inline_math", False, "env")
|
|
||||||
app.add_directive("mdinclude", MdInclude)
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
.. mdinclude:: ../../README.md
|
.. include:: ../../README.md
|
||||||
|
:parser: myst_parser.sphinx_
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
@ -1,16 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from voluptuous import ( # type: ignore
|
from voluptuous import Coerce # type: ignore
|
||||||
REMOVE_EXTRA,
|
from voluptuous import REMOVE_EXTRA, All, Any, Invalid, Optional, Range, Schema
|
||||||
All,
|
|
||||||
Any,
|
|
||||||
Coerce,
|
|
||||||
Invalid,
|
|
||||||
Optional,
|
|
||||||
Range,
|
|
||||||
Schema,
|
|
||||||
)
|
|
||||||
|
|
||||||
from ..protocol import TPLinkSmartHomeProtocol
|
from ..protocol import TPLinkSmartHomeProtocol
|
||||||
|
|
||||||
@ -467,7 +459,6 @@ class FakeTransportProtocol(TPLinkSmartHomeProtocol):
|
|||||||
child_ids = []
|
child_ids = []
|
||||||
|
|
||||||
def get_response_for_module(target):
|
def get_response_for_module(target):
|
||||||
|
|
||||||
if target not in proto.keys():
|
if target not in proto.keys():
|
||||||
return error(msg="target not found")
|
return error(msg="target not found")
|
||||||
|
|
||||||
|
@ -108,7 +108,6 @@ async def test_all_binary_states(dev):
|
|||||||
|
|
||||||
# toggle each outlet with state map applied
|
# toggle each outlet with state map applied
|
||||||
for plug_index in range(len(dev.children)):
|
for plug_index in range(len(dev.children)):
|
||||||
|
|
||||||
# toggle state
|
# toggle state
|
||||||
if state_map[plug_index]:
|
if state_map[plug_index]:
|
||||||
await dev.turn_off(index=plug_index)
|
await dev.turn_off(index=plug_index)
|
||||||
|
977
poetry.lock
generated
977
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,10 @@ packages = [
|
|||||||
]
|
]
|
||||||
include = ["CHANGELOG.md"]
|
include = ["CHANGELOG.md"]
|
||||||
|
|
||||||
|
[tool.poetry.urls]
|
||||||
|
"Bug Tracker" = "https://github.com/python-kasa/python-kasa/issues"
|
||||||
|
"Documentation" = "https://python-kasa.readthedocs.io"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
kasa = "kasa.cli:cli"
|
kasa = "kasa.cli:cli"
|
||||||
|
|
||||||
@ -23,27 +27,27 @@ pydantic = "^1"
|
|||||||
|
|
||||||
# required only for docs
|
# required only for docs
|
||||||
sphinx = { version = "^4", optional = true }
|
sphinx = { version = "^4", optional = true }
|
||||||
m2r = { version = "^0", optional = true }
|
|
||||||
mistune = { version = "<2.0.0", optional = true }
|
|
||||||
sphinx_rtd_theme = { version = "^0", optional = true }
|
sphinx_rtd_theme = { version = "^0", optional = true }
|
||||||
sphinxcontrib-programoutput = { version = "^0", optional = true }
|
sphinxcontrib-programoutput = { version = "^0", optional = true }
|
||||||
|
myst-parser = { version = "*", optional = true }
|
||||||
|
docutils = { version = ">=0.17", optional = true }
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = ">=6.2.5"
|
pytest = "*"
|
||||||
pytest-cov = "^2"
|
pytest-cov = "*"
|
||||||
pytest-asyncio = "^0"
|
pytest-asyncio = "*"
|
||||||
pytest-sugar = "*"
|
pytest-sugar = "*"
|
||||||
pre-commit = "*"
|
pre-commit = "*"
|
||||||
voluptuous = "*"
|
voluptuous = "*"
|
||||||
toml = "*"
|
toml = "*"
|
||||||
tox = "*"
|
tox = "*"
|
||||||
pytest-mock = "^3"
|
pytest-mock = "*"
|
||||||
codecov = "^2"
|
codecov = "*"
|
||||||
xdoctest = "^0"
|
xdoctest = "*"
|
||||||
coverage = {version = "^6", extras = ["toml"]}
|
coverage = {version = "*", extras = ["toml"]}
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
docs = ["sphinx", "sphinx_rtd_theme", "m2r", "mistune", "sphinxcontrib-programoutput"]
|
docs = ["sphinx", "sphinx_rtd_theme", "sphinxcontrib-programoutput", "myst-parser", "docutils"]
|
||||||
|
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
@ -85,6 +89,7 @@ asyncio_mode = "auto"
|
|||||||
[tool.doc8]
|
[tool.doc8]
|
||||||
paths = ["docs"]
|
paths = ["docs"]
|
||||||
ignore = ["D001"]
|
ignore = ["D001"]
|
||||||
|
ignore-path-errors = ["docs/source/index.rst;D000"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
Loading…
Reference in New Issue
Block a user