mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 11:13: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:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
@ -10,18 +10,18 @@ repos:
|
||||
- id: check-ast
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.2.2
|
||||
rev: v3.3.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ['--py37-plus']
|
||||
|
||||
- repo: https://github.com/python/black
|
||||
rev: 22.10.0
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 5.0.4
|
||||
rev: 6.0.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies: [flake8-docstrings]
|
||||
@ -33,13 +33,13 @@ repos:
|
||||
additional_dependencies: [toml]
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v0.991
|
||||
rev: v1.0.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: [types-click]
|
||||
|
||||
- repo: https://github.com/PyCQA/doc8
|
||||
rev: 'v1.0.0'
|
||||
rev: 'v1.1.1'
|
||||
hooks:
|
||||
- id: doc8
|
||||
additional_dependencies: [tomli]
|
||||
|
@ -44,7 +44,9 @@ def read_payloads_from_file(file):
|
||||
|
||||
try:
|
||||
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]")
|
||||
continue
|
||||
|
||||
|
@ -33,6 +33,7 @@ extensions = [
|
||||
"sphinx.ext.viewcode",
|
||||
"sphinx.ext.todo",
|
||||
"sphinxcontrib.programoutput",
|
||||
"myst_parser",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@ -62,12 +63,3 @@ todo_include_todos = True
|
||||
def setup(app):
|
||||
# add copybutton to hide the >>> prompts, see https://github.com/readthedocs/sphinx_rtd_theme/issues/167
|
||||
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::
|
||||
:maxdepth: 2
|
||||
|
@ -1,16 +1,8 @@
|
||||
import logging
|
||||
import re
|
||||
|
||||
from voluptuous import ( # type: ignore
|
||||
REMOVE_EXTRA,
|
||||
All,
|
||||
Any,
|
||||
Coerce,
|
||||
Invalid,
|
||||
Optional,
|
||||
Range,
|
||||
Schema,
|
||||
)
|
||||
from voluptuous import Coerce # type: ignore
|
||||
from voluptuous import REMOVE_EXTRA, All, Any, Invalid, Optional, Range, Schema
|
||||
|
||||
from ..protocol import TPLinkSmartHomeProtocol
|
||||
|
||||
@ -467,7 +459,6 @@ class FakeTransportProtocol(TPLinkSmartHomeProtocol):
|
||||
child_ids = []
|
||||
|
||||
def get_response_for_module(target):
|
||||
|
||||
if target not in proto.keys():
|
||||
return error(msg="target not found")
|
||||
|
||||
|
@ -108,7 +108,6 @@ async def test_all_binary_states(dev):
|
||||
|
||||
# toggle each outlet with state map applied
|
||||
for plug_index in range(len(dev.children)):
|
||||
|
||||
# toggle state
|
||||
if state_map[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"]
|
||||
|
||||
[tool.poetry.urls]
|
||||
"Bug Tracker" = "https://github.com/python-kasa/python-kasa/issues"
|
||||
"Documentation" = "https://python-kasa.readthedocs.io"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
kasa = "kasa.cli:cli"
|
||||
|
||||
@ -23,27 +27,27 @@ pydantic = "^1"
|
||||
|
||||
# required only for docs
|
||||
sphinx = { version = "^4", optional = true }
|
||||
m2r = { version = "^0", optional = true }
|
||||
mistune = { version = "<2.0.0", optional = true }
|
||||
sphinx_rtd_theme = { 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]
|
||||
pytest = ">=6.2.5"
|
||||
pytest-cov = "^2"
|
||||
pytest-asyncio = "^0"
|
||||
pytest = "*"
|
||||
pytest-cov = "*"
|
||||
pytest-asyncio = "*"
|
||||
pytest-sugar = "*"
|
||||
pre-commit = "*"
|
||||
voluptuous = "*"
|
||||
toml = "*"
|
||||
tox = "*"
|
||||
pytest-mock = "^3"
|
||||
codecov = "^2"
|
||||
xdoctest = "^0"
|
||||
coverage = {version = "^6", extras = ["toml"]}
|
||||
pytest-mock = "*"
|
||||
codecov = "*"
|
||||
xdoctest = "*"
|
||||
coverage = {version = "*", extras = ["toml"]}
|
||||
|
||||
[tool.poetry.extras]
|
||||
docs = ["sphinx", "sphinx_rtd_theme", "m2r", "mistune", "sphinxcontrib-programoutput"]
|
||||
docs = ["sphinx", "sphinx_rtd_theme", "sphinxcontrib-programoutput", "myst-parser", "docutils"]
|
||||
|
||||
|
||||
[tool.isort]
|
||||
@ -85,6 +89,7 @@ asyncio_mode = "auto"
|
||||
[tool.doc8]
|
||||
paths = ["docs"]
|
||||
ignore = ["D001"]
|
||||
ignore-path-errors = ["docs/source/index.rst;D000"]
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
Loading…
Reference in New Issue
Block a user