pyproject.toml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. [tool.poetry]
  2. name = "PySwitchbot"
  3. version = "2.3.0"
  4. description = "A library to communicate with Switchbot"
  5. authors = ["Daniel Hjelseth Hoyer"]
  6. license = "MIT"
  7. readme = "README.md"
  8. repository = "https://github.com/sblibs/pySwitchbot/"
  9. packages = [
  10. { include = "switchbot" },
  11. ]
  12. classifiers = [
  13. "Development Status :: 3 - Alpha",
  14. "Environment :: Other Environment",
  15. "Intended Audience :: Developers",
  16. "Operating System :: OS Independent",
  17. "Programming Language :: Python",
  18. "Topic :: Home Automation",
  19. "Topic :: Software Development :: Libraries :: Python Modules",
  20. ]
  21. [tool.poetry.urls]
  22. "Bug Tracker" = "https://github.com/sblibs/pySwitchbot/issues"
  23. "Changelog" = "https://github.com/sblibs/pySwitchbot/blob/main/CHANGELOG.md"
  24. [tool.poetry.dependencies]
  25. python = ">=3.11,<4.0"
  26. aiohttp = ">=3.9.5"
  27. bleak = ">=0.19.0"
  28. bleak-retry-connector = ">=3.4.0"
  29. cryptography = ">=39.0.0"
  30. pyOpenSSL = ">=23.0.0"
  31. [tool.poetry.group.dev.dependencies]
  32. pytest = ">=7,<10"
  33. pytest-cov = ">=3,<8"
  34. pytest-asyncio = ">=0.19,<1.5"
  35. [tool.semantic_release]
  36. branch = "main"
  37. # Existing release tags have no "v" prefix (e.g. 2.2.0), unlike PSR's default
  38. # "v{version}"; without this PSR finds no prior release and bumps from 0.0.0.
  39. tag_format = "{version}"
  40. version_toml = ["pyproject.toml:tool.poetry.version"]
  41. version_variables = ["switchbot/__version__.py:__version__"]
  42. build_command = "pip install poetry && poetry build"
  43. [tool.pytest.ini_options]
  44. addopts = "--cov=switchbot --cov-report=term-missing"
  45. [build-system]
  46. requires = ["poetry-core>=1.0.0"]
  47. build-backend = "poetry.core.masonry.api"
  48. [tool.ruff]
  49. target-version = "py311"
  50. line-length = 88
  51. [tool.ruff.lint]
  52. preview = true
  53. explicit-preview-rules = true # opt in ONLY explicitly-listed preview rules
  54. ignore = [
  55. "S101", # use of assert
  56. "D203", # 1 blank line required before class docstring
  57. "D212", # Multi-line docstring summary should start at the first line
  58. "D100", # Missing docstring in public module
  59. "D101", # Missing docstring in public module
  60. "D102", # Missing docstring in public method
  61. "D103", # Missing docstring in public module
  62. "D104", # Missing docstring in public package
  63. "D105", # Missing docstring in magic method
  64. "D107", # Missing docstring in `__init__`
  65. "D400", # First line should end with a period
  66. "D401", # First line of docstring should be in imperative mood
  67. "D205", # 1 blank line required between summary line and description
  68. "D415", # First line should end with a period, question mark, or exclamation point
  69. "D417", # Missing argument descriptions in the docstring
  70. "E501", # Line too long
  71. "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
  72. "B008", # Do not perform function call
  73. "S110", # `try`-`except`-`pass` detected, consider logging the exception
  74. "D106", # Missing docstring in public nested class
  75. "UP007", # typer needs Optional syntax
  76. "S603", # check for execution of untrusted input
  77. "S105", # possible hard coded creds
  78. "TID252", # not for this lib
  79. "TRY003", # nice but too many to fix,
  80. "G201", # too noisy
  81. "PLR2004", # too many to fix
  82. ]
  83. select = [
  84. "ASYNC", # async rules
  85. "A", # flake8-builtins
  86. "B", # flake8-bugbear
  87. "BLE", # flake8-blind-except
  88. "D", # flake8-docstrings
  89. "C4", # flake8-comprehensions
  90. "C90", # mccabe complexity
  91. "DTZ", # flake8-datetimez
  92. "ERA", # eradicate
  93. "EXE", # flake8-executable
  94. "S", # flake8-bandit
  95. "F", # pyflake
  96. "FA", # flake8-future-annotations
  97. "FIX", # flake8-fixme
  98. "FURB", # refurb
  99. "FURB118", # reimplemented-operator (preview) - unneeded lambdas
  100. "E", # pycodestyle
  101. "W", # pycodestyle
  102. "UP", # pyupgrade
  103. "I", # isort
  104. "ICN", # flake8-import-conventions
  105. "INP", # flake8-no-pep420
  106. "ISC", # flake8-implicit-str-concat
  107. "LOG", # flake8-logging
  108. "Q", # flake8-quotes
  109. "RUF", # ruff specific
  110. "FLY", # flynt
  111. "G", # flake8-logging-format ,
  112. "PERF", # Perflint
  113. "PGH", # pygrep-hooks
  114. "PIE", # flake8-pie
  115. "PL", # pylint
  116. "PT", # flake8-pytest-style
  117. "PTH", # flake8-pathlib
  118. "PYI", # flake8-pyi
  119. "RET", # flake8-return
  120. "RSE", # flake8-raise ,
  121. "SIM", # flake8-simplify
  122. "SLF", # flake8-self
  123. "SLOT", # flake8-slots
  124. "T100", # Trace found: {name} used
  125. "T20", # flake8-print
  126. "TD", # flake8-todos
  127. "TID", # Tidy imports
  128. "TRY", # tryceratops
  129. "YTT", # flake8-2020
  130. ]
  131. [tool.ruff.lint.per-file-ignores]
  132. "tests/**/*" = [
  133. "D100",
  134. "D101",
  135. "D102",
  136. "D103",
  137. "D104",
  138. "S101",
  139. "SLF001",
  140. "PLR2004",
  141. ]
  142. "setup.py" = ["D100"]
  143. "conftest.py" = ["D100"]
  144. "docs/conf.py" = ["D100"]
  145. "scripts/**/*" = [
  146. "T201"
  147. ]
  148. [tool.ruff.lint.isort]
  149. known-first-party = ["pySwitchbot", "tests"]