pyproject.toml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. [tool.poetry]
  2. name = "open_gopro"
  3. version = "0.21.2"
  4. description = "Open GoPro API and Examples"
  5. authors = ["Tim Camise <tcamise@gopro.com>"]
  6. readme = "README.md"
  7. license = "MIT"
  8. repository = "https://github.com/gopro/OpenGoPro/tree/main/demos/python/sdk_wireless_camera_control"
  9. documentation = "https://gopro.github.io/OpenGoPro/python_sdk/"
  10. classifiers = [
  11. "Intended Audience :: Developers",
  12. "Topic :: Communications",
  13. "License :: OSI Approved :: MIT License",
  14. "Natural Language :: English",
  15. "Operating System :: Microsoft :: Windows :: Windows 10",
  16. "Operating System :: POSIX :: Linux",
  17. "Operating System :: MacOS :: MacOS X",
  18. "Programming Language :: Python",
  19. "Programming Language :: Python :: 3",
  20. "Programming Language :: Python :: 3.11",
  21. "Programming Language :: Python :: 3.12",
  22. "Programming Language :: Python :: 3.13",
  23. ]
  24. [tool.poetry.scripts]
  25. gopro-photo = "open_gopro.demos.photo:entrypoint"
  26. gopro-video = "open_gopro.demos.video:entrypoint"
  27. gopro-log-battery = "open_gopro.demos.log_battery:entrypoint"
  28. gopro-wifi = "open_gopro.demos.connect_wifi:entrypoint"
  29. gopro-webcam = "open_gopro.demos.gui.webcam:entrypoint"
  30. gopro-livestream = "open_gopro.demos.gui.livestream:entrypoint"
  31. gopro-preview-stream = "open_gopro.demos.gui.preview_stream:entrypoint"
  32. gopro-cohn = "open_gopro.demos.cohn:entrypoint"
  33. gopro-scan = "open_gopro.demos.scanner:entrypoint"
  34. [build-system]
  35. requires = ["poetry-core>=1.0.0"]
  36. build-backend = "poetry.core.masonry.api"
  37. [tool.poetry.dependencies]
  38. python = ">=3.11,<3.14"
  39. bleak = "=0.22.3"
  40. construct = "^2"
  41. wrapt = "^1"
  42. requests = "^2"
  43. protobuf = "^6"
  44. packaging = "25"
  45. rich = "^14"
  46. pexpect = "^4"
  47. zeroconf = "^0"
  48. pydantic = "^2"
  49. opencv-python = { version = "^4", optional = true }
  50. Pillow = {version= "^11", optional = true}
  51. pytz = "*"
  52. tzlocal = "*"
  53. tinydb = "^4"
  54. returns = {extras = ["compatible-mypy"], version = "^0"}
  55. asyncstdlib = "^3"
  56. [tool.poetry.extras]
  57. gui = ["opencv-python", "pillow"]
  58. [tool.poetry.group.dev.dependencies]
  59. pydoclint = "^0"
  60. pydocstyle = { extras = ["toml"], version = "^6" }
  61. pytest = "^8"
  62. pytest-cov = "^6"
  63. pytest-asyncio = "^1"
  64. pytest-html = "^4"
  65. coverage = { extras = ["toml"], version = "^7" }
  66. requests-mock = "^1"
  67. black = "*"
  68. pylint = "*"
  69. mypy = "*"
  70. types-requests = "*"
  71. types-attrs = "*"
  72. types-pytz = "*"
  73. types-tzlocal = "*"
  74. construct-typing = "*"
  75. sphinx = "^8"
  76. sphinx-rtd-theme = "^3"
  77. coverage-badge = "^1"
  78. poethepoet = "^0"
  79. autodoc-pydantic = "^2"
  80. pytest-timeout = "^2"
  81. isort = "*"
  82. types-protobuf = "*"
  83. licensecheck = "*"
  84. [tool.poe.tasks.tests]
  85. cmd = "pytest tests/unit --cov-fail-under=70"
  86. help = "Run unit tests"
  87. [tool.poe.tasks._types]
  88. cmd = "mypy open_gopro"
  89. help = "Check types"
  90. [tool.poe.tasks._pylint]
  91. cmd = "pylint open_gopro"
  92. help = "Run pylint"
  93. [tool.poe.tasks._format_code]
  94. cmd = "black open_gopro tests noxfile.py docs/conf.py"
  95. help = "Apply black formatting to source code"
  96. [tool.poe.tasks._sort_imports]
  97. cmd = "isort open_gopro tests"
  98. help = "Sort imports with isort"
  99. [tool.poe.tasks.format]
  100. sequence = ["_format_code", "_sort_imports"]
  101. help = "Format code and sort imports"
  102. [tool.poe.tasks.lint]
  103. sequence = ["format", "_types", "_pylint"]
  104. help = "Perform all static code analysis"
  105. [tool.poe.tasks._pydocstyle]
  106. cmd = "pydocstyle --config pyproject.toml -v open_gopro"
  107. help = "check docstrings style"
  108. [tool.poe.tasks._doclint]
  109. cmd = "pydoclint open_gopro"
  110. help = "validate docstrings"
  111. [tool.poe.tasks.docstrings]
  112. sequence = ["_pydocstyle", "_doclint"]
  113. help = "Analyze docstrings for consistency and errors"
  114. [tool.poe.tasks.sphinx]
  115. cmd = "sphinx-build -W --keep-going -a -n -E -b html docs docs/build"
  116. help = "Build sphinx documentation."
  117. [tool.poe.tasks._coverage]
  118. cmd = "coverage-badge -f -o docs/_static/coverage.svg"
  119. help = "update coverage badge"
  120. [tool.poe.tasks._clean_artifacts]
  121. cmd = "rm -rf **/__pycache__ *.csv *.mp4 *.jpg *.log .mypy_cache .nox"
  122. help = "Clean testing artifacts and pycache"
  123. [tool.poe.tasks._clean_tests]
  124. cmd = "rm -rf .reports && rm -rf .pytest_cache"
  125. help = "Clean test reports"
  126. [tool.poe.tasks._clean_docs]
  127. cmd = "rm -f docs/modules.rst && rm -rf docs/build"
  128. help = "Clean built docs output"
  129. [tool.poe.tasks._clean_build]
  130. cmd = "rm -rf dist"
  131. help = "Clean module build output"
  132. [tool.poe.tasks.docs]
  133. sequence = ["docstrings", "sphinx"]
  134. help = "Validate docstrings and build docs"
  135. [tool.poe.tasks.clean]
  136. sequence = ["_clean_artifacts", "_clean_tests", "_clean_docs", "_clean_build"]
  137. help = "Clean everything"
  138. [tool.poe.tasks.all]
  139. sequence = ["format", "lint", "tests", "docs", "licenses"]
  140. help = "Format, check types, lint, check docstrings, run unit tests, and update license report."
  141. [tool.poe.tasks.licenses]
  142. cmd = "licensecheck"
  143. help = "Analyze dependency licenses"
  144. [tool.mypy]
  145. ignore_missing_imports = true
  146. warn_redundant_casts = true
  147. disallow_untyped_calls = false
  148. disallow_untyped_defs = true
  149. disallow_incomplete_defs = true
  150. disallow_untyped_decorators = false
  151. warn_unused_ignores = true
  152. warn_unreachable = false
  153. show_error_context = true
  154. pretty = true
  155. plugins = ["returns.contrib.mypy.returns_plugin"]
  156. [tool.pytest.ini_options]
  157. asyncio_default_fixture_loop_scope = "function"
  158. asyncio_default_test_loop_scope = "function"
  159. asyncio_mode = "auto"
  160. log_auto_indent = true
  161. log_cli = true
  162. log_cli_level = "ERROR"
  163. log_cli_format = "%(asctime)s %(levelname)s %(message)s"
  164. log_cli_date_format = "%H:%M:%S"
  165. log_file_level = "DEBUG"
  166. log_file_format = "%(threadName)13s: %(name)40s:%(lineno)5d %(asctime)s.%(msecs)03d %(levelname)-8s | %(message)s"
  167. log_file_date_format = "%H:%M:%S"
  168. filterwarnings = "ignore::DeprecationWarning"
  169. timeout = 10
  170. addopts = [
  171. "-s",
  172. "--capture=tee-sys",
  173. "--cov=open_gopro",
  174. "--cov-report=term",
  175. "--cov-report=html",
  176. "--html=.reports/test_report.html",
  177. "--self-contained-html",
  178. "--asyncio-mode=auto",
  179. ]
  180. [tool.coverage.run]
  181. data_file = ".reports/coverage/.coverage"
  182. branch = true
  183. source = ["open_gopro"]
  184. omit = [
  185. "open_gopro/constants/*",
  186. "open_gopro/proto/*",
  187. "open_gopro/demos/*"
  188. ]
  189. [tool.coverage.html]
  190. directory = ".reports/coverage"
  191. [tool.coverage.report]
  192. exclude_lines = ["raise NotImplementedError"]
  193. [tool.pylint.'MASTER']
  194. no-docstring-rgx="__|main|parse_arguments|entrypoint"
  195. extension-pkg-whitelist = "cv2" # TODO this isn't working
  196. load-plugins = "pylint.extensions.docparams"
  197. accept-no-param-doc = "yes"
  198. accept-no-return-doc = "yes"
  199. default-docstring-type = "google"
  200. ignore = ["tests", "proto"]
  201. [tool.pylint.'MESSAGES CONTROL']
  202. disable = [
  203. "use-maxsplit-arg",
  204. "unnecessary-lambda",
  205. "unnecessary-lambda-assignment",
  206. "too-many-ancestors",
  207. "no-name-in-module",
  208. "too-many-nested-blocks",
  209. "unspecified-encoding",
  210. "consider-using-with",
  211. "abstract-method",
  212. "useless-type-doc",
  213. "cyclic-import",
  214. "logging-fstring-interpolation",
  215. "logging-format-interpolation",
  216. "duplicate-code",
  217. "global-statement",
  218. "too-few-public-methods",
  219. "too-many-public-methods",
  220. "too-many-arguments",
  221. "too-many-instance-attributes",
  222. "too-many-branches",
  223. "too-many-locals",
  224. "too-many-lines",
  225. "too-many-statements",
  226. "fixme",
  227. "protected-access",
  228. "invalid-name",
  229. "unsubscriptable-object",
  230. "too-many-positional-arguments",
  231. "no-member", # This is bad. We need to make stub files since mypy and pylint do not follow decorators well
  232. ]
  233. [tool.pylint.'FORMAT']
  234. max-line-length = 160
  235. [tool.pylint.'TYPECHECK']
  236. ignored-modules = "cv2"
  237. [tool.black]
  238. line-length = 120
  239. exclude = ".venv"
  240. [tool.pydocstyle]
  241. convention = "google"
  242. add-ignore = "D415, D107, D105"
  243. match = '(?!params|.*pb).*\.py'
  244. match-dir = '(?!.*demos).*'
  245. [tool.isort]
  246. profile = "black"
  247. [tool.pydoclint]
  248. style = 'google'
  249. exclude = 'schemas/'
  250. require-return-section-when-returning-nothing = false
  251. should-declare-assert-error-if-assert-statement-exists = false
  252. [tool.licensecheck]
  253. using = "PEP631"
  254. format = 'csv'
  255. file = "thirdPartyDependencies.csv"