Skip to content

Commit

Permalink
Migrate to pyproject.toml where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
mdegat01 committed Dec 21, 2023
1 parent ed7edd9 commit cc4a3b9
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 108 deletions.
45 changes: 0 additions & 45 deletions pylintrc

This file was deleted.

141 changes: 141 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
[build-system]
requires = ["setuptools~=68.0.0", "wheel~=0.40.0"]
build-backend = "setuptools.build_meta"

[project]
name = "Supervisor"
dynamic = ["version"]
license = { text = "Apache-2.0" }
description = "Open-source private cloud os for Home-Assistant based on HassOS"
readme = "README.md"
authors = [
{ name = "The Home Assistant Authors", email = "[email protected]" },
]
keywords = ["docker", "home-assistant", "api"]
requires-python = ">=3.11.0"
dependencies = [
"aiodns==3.1.1",
"aiohttp==3.8.6",
"aiohttp-fast-url-dispatcher==0.1.1",
"async_timeout==4.0.3",
"atomicwrites-homeassistant==1.4.1",
"attrs==23.1.0",
"awesomeversion==23.11.0",
"brotli==1.1.0",
"ciso8601==2.3.1",
"colorlog==6.7.0",
"cpe==1.2.1",
"cryptography==41.0.5",
"debugpy==1.8.0",
"deepmerge==1.1.0",
"dirhash==0.2.1",
"docker==6.1.3",
"faust-cchardet==2.1.19",
"gitpython==3.1.40",
"jinja2==3.1.2",
"pulsectl==23.5.2",
"pyudev==0.24.1",
"PyYAML==6.0.1",
"securetar==2023.3.0",
"sentry-sdk==1.36.0",
"voluptuous==0.14.1",
"dbus-fast==2.14.0",
"typing_extensions==4.8.0",
]

[project.urls]
"Homepage" = "https://www.home-assistant.io/"
"Source Code" = "https://github.com/home-assistant/supervisor"
"Bug Reports" = "https://github.com/home-assistant/supervisor/issues"
"Docs: Dev" = "https://developers.home-assistant.io/"
"Discord" = "https://www.home-assistant.io/join-chat/"
"Forum" = "https://community.home-assistant.io/"

[tool.setuptools]
platforms = ["any"]
zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
include = ["supervisor*"]

[tool.pylint.MAIN]
py-version = "3.11"
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
jobs = 2
persistent = false
extension-pkg-allow-list = ["ciso8601"]

[tool.pylint.BASIC]
class-const-naming-style = "any"
good-names = ["id", "i", "j", "k", "ex", "Run", "_", "fp", "T", "os"]

[tool.pylint."MESSAGES CONTROL"]
# Reasons disabled:
# format - handled by black
# abstract-method - with intro of async there are always methods missing
# cyclic-import - doesn't test if both import on load
# duplicate-code - unavoidable
# locally-disabled - it spams too much
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# unused-argument - generic callbacks and setup methods create a lot of warnings
disable = [
"format",
"abstract-method",
"cyclic-import",
"duplicate-code",
"locally-disabled",
"no-else-return",
"not-context-manager",
"too-few-public-methods",
"too-many-arguments",
"too-many-branches",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"unused-argument",
"consider-using-with",
]

[tool.pylint.REPORTS]
score = false

[tool.pylint.TYPECHECK]
ignored-modules = ["distutils"]

[tool.pylint.FORMAT]
expected-line-ending-format = "LF"

[tool.pylint.EXCEPTIONS]
overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception"]

[tool.pytest.ini_options]
testpaths = ["tests"]
norecursedirs = [".git"]
log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(name)s:%(filename)s:%(lineno)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
asyncio_mode = "auto"
filterwarnings = [
"error",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:dirhash",
"ignore::pytest.PytestUnraisableExceptionWarning",
]

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
indent = " "
force_sort_within_sections = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
forced_separate = "tests"
combine_as_imports = true
use_parentheses = true
known_first_party = ["supervisor", "tests"]
6 changes: 0 additions & 6 deletions pytest.ini

This file was deleted.

14 changes: 0 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
[isort]
multi_line_output = 3
include_trailing_comma=True
force_grid_wrap=0
line_length=88
indent = " "
force_sort_within_sections = true
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY
forced_separate = tests
combine_as_imports = true
use_parentheses = true
known_first_party = supervisor,tests

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
Expand Down
44 changes: 1 addition & 43 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,4 @@

from supervisor.const import SUPERVISOR_VERSION

setup(
name="Supervisor",
version=SUPERVISOR_VERSION,
license="BSD License",
author="The Home Assistant Authors",
author_email="[email protected]",
url="https://home-assistant.io/",
description=("Open-source private cloud os for Home-Assistant" " based on HassOS"),
long_description=(
"A maintainless private cloud operator system that"
"setup a Home-Assistant instance. Based on HassOS"
),
keywords=["docker", "home-assistant", "api"],
zip_safe=False,
platforms="any",
packages=[
"supervisor.addons",
"supervisor.api",
"supervisor.backups",
"supervisor.dbus.network",
"supervisor.dbus.network.setting",
"supervisor.dbus",
"supervisor.discovery.services",
"supervisor.discovery",
"supervisor.docker",
"supervisor.homeassistant",
"supervisor.host",
"supervisor.jobs",
"supervisor.misc",
"supervisor.plugins",
"supervisor.resolution.checks",
"supervisor.resolution.evaluations",
"supervisor.resolution.fixups",
"supervisor.resolution",
"supervisor.security",
"supervisor.services.modules",
"supervisor.services",
"supervisor.store",
"supervisor.utils",
"supervisor",
],
include_package_data=True,
)
setup(version=SUPERVISOR_VERSION)

0 comments on commit cc4a3b9

Please sign in to comment.