commit 9acd59dfaf9d5d488be490dc970c4216f9570c9c Author: Mike Bloy Date: Sat Feb 27 16:15:21 2021 -0600 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c50a22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,117 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +pylint-out.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +coverage.xml +test-report.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ +_version.py diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2339482 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +History +======= + +Pending +------- + +* Initial release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8745708 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2021 Mike Bloy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f627f5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Home Assistant Kiosk +==================== + diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b54b7a6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[build-system] +requires = [ + "setuptools >= 42", + "wheel", + "sphinx", + "setuptools_scm[toml]", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "src/hasskiosk/_version.py" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..cb55349 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,44 @@ +# https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files + +[metadata] +name = hasskisok +author = Mike Bloy +author_email = mike@bloy.org +description = Helper application for homeassistant kiosk screens +long_description = file: README.md +license = MIT +url = https://git.bloy.org/mike/hasskiosk + +[options] +setup_requires= +zip_safe = False +include_package_data = True +package_dir = + =src +packages = find: +install_requires = + paho-mqtt + +[options.extras_require] +dev = + bpython + flake8 + flake8-bandit + flake8-blind-except + flake8-builtins + flake8-docstrings + flake8-executable + flake8-isort + flake8-logging-format + mypy + pdbpp + pycodestyle + pydocstyle + pytest + pytest-cov + python-language-server + rope + sphinx + +[options.packages.find] +where=src diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3f52e0e --- /dev/null +++ b/setup.py @@ -0,0 +1,8 @@ +"""Setup.""" + +from setuptools import setup + +setup( + setup_requires=["setuptools-scm", "wheel"], + use_scm_version={"write_to": "src/hasskiosk/_version.py"}, +) diff --git a/src/hasskiosk/__init__.py b/src/hasskiosk/__init__.py new file mode 100644 index 0000000..70337f3 --- /dev/null +++ b/src/hasskiosk/__init__.py @@ -0,0 +1,7 @@ +"""Home Assistant Kiosk.""" + +from ._version import version as __version__ + +__all__ = [ + "__version__", +] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..14ebee4 --- /dev/null +++ b/tox.ini @@ -0,0 +1,82 @@ +[tox] +envlist = py37,security,lint,bundle +isolated_build = True + +[testenv] +wheel = true +wheel_build_env = build +extras= + dev + +[testenv:build] +deps = setuptools + + +[testenv:py37] +commands = + pytest --cov={envsitepackagesdir}/hasskiosk \ + --cov-report=term-missing \ + --cov-report=xml:coverage.xml \ + --junitxml=test-report.xml \ + --cov-branch \ + --cov-fail-under=80 + +[testenv:security] +commands = + bandit {envsitepackagesdir}/hasskiosk -r + +[testenv:lint] +commands = + flake8 --output-file pylint-out.txt --format pylint --tee + +[testenv:bundle] +commands = + python setup.py sdist bdist_wheel + +[pycodestyle] +max-line-length = 87 + +[pydocstyle] +ignore = D203,D213,D400,D401,D407,D413 + +[flake8] +ignore = D401 +enable-extensions = G,M +max_line_length = 87 +exclude = + build/ + dist/ + docs/ + tests/ + .tox/ + _version.py + .* + +[isort] +line_length = 87 + +[mypy] +files = src/**/*.py,test/**/*.py +mypy_path = + +[pytest] +addopts= + -ra + --cov-report=term-missing + +[coverage:run] +branch = True + +include = + .tox/**/hasskiosk/ +omit = + **/hasskiosk/_version.py + setup.py + tests/* + +[coverage:paths] +# map these two directories as equivalent, so that covered packaged code shows +# up as coverage of the git paths actually being reported +source = + ./src/ + .tox/**/site-packages/