pyproject.toml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. [tool.poetry]
  2. name = "unfccc-ghg-data"
  3. version = "0.1.0"
  4. description = "Reading country greenhouse gas data submitted to the United Nations Framework Convention on Climate Change (UNFCCC)in different submissions and formats and providing it in a standadized nc and csv format compatible with primap2. Data are read using different methods from APIs, xlsx and csv files as well as pdf files."
  5. authors = ["Johannes Gütschow <mail@johannes-guetschow.de>"]
  6. readme = "README.md"
  7. packages = [{include = "unfccc_ghg_data", from = "src"}]
  8. [tool.poetry.dependencies]
  9. python = "^3.9"
  10. matplotlib = { version = "^3.7.1", optional = true }
  11. doit = "^0.36.0"
  12. primap2 = "^0.9.8"
  13. pycountry = "^22.3.5"
  14. datalad = "^0.19.3"
  15. treelib = "^1.7.0"
  16. camelot-py = "^0.11.0"
  17. selenium = "^4.15.2"
  18. bs4 = "^0.0.1"
  19. requests = "^2.31.0"
  20. opencv-python = "^4.8.1.78"
  21. unfccc-di-api = "^4.0.0"
  22. dask = "^2023.12.0"
  23. sphinx-exec-code = "^0.10"
  24. [tool.poetry.extras]
  25. plots = ["matplotlib"]
  26. [tool.poetry.group.tests.dependencies]
  27. pytest = "^7.3.1"
  28. [tool.poetry.group.docs.dependencies]
  29. myst-nb = "^0.17.0"
  30. sphinx-rtd-theme = "^1.2.0"
  31. sphinx-autodoc-typehints = "^1.23.0"
  32. sphinx-autodocgen = "^1.3"
  33. jupytext = "^1.14.5"
  34. sphinx-copybutton = "^0.5.2"
  35. [tool.poetry.group.dev.dependencies]
  36. pytest-cov = "^4.0.0"
  37. coverage = "^7.2.0"
  38. black = "23.3.0"
  39. blackdoc = "0.3.8"
  40. mypy = "^1.2.0"
  41. ruff = "0.0.264"
  42. pre-commit = "^3.3.1"
  43. towncrier = "^23.6.0"
  44. liccheck = "^0.9.1"
  45. [build-system]
  46. requires = ["poetry-core"]
  47. build-backend = "poetry.core.masonry.api"
  48. [tool.coverage.run]
  49. source = ["src"]
  50. branch = true
  51. [tool.coverage.report]
  52. fail_under = 95
  53. skip_empty = true
  54. show_missing = true
  55. # Regexes for lines to exclude from consideration in addition to the defaults
  56. exclude_also = [
  57. # Don't complain about missing type checking code:
  58. "if TYPE_CHECKING",
  59. ]
  60. [tool.mypy]
  61. strict = true
  62. # prevent unimported libraries silently being treated as Any
  63. disallow_any_unimported = true
  64. # show error codes on failure with context
  65. show_error_codes = true
  66. show_error_context = true
  67. # warn if code can't be reached
  68. warn_unreachable = true
  69. # importing following uses default settings
  70. follow_imports = "normal"
  71. [tool.jupytext]
  72. formats = "ipynb,py:percent"
  73. [tool.pytest.ini_options]
  74. addopts = [
  75. "--import-mode=importlib",
  76. ]
  77. [tool.ruff]
  78. src = ["src"]
  79. target-version = "py39"
  80. select = [
  81. "E", # pycodestyle error
  82. "W", # pycodestyle warning
  83. "F", # pyflakes
  84. "I", # isort
  85. "D", # pydocstyle
  86. "PL", # pylint
  87. "TRY", # tryceratops
  88. "NPY", # numpy rules
  89. "RUF", # ruff specifics
  90. "UP", # pyupgrade
  91. "S", # flake8-bandit
  92. # pandas support via pandas-vet. In some cases we will want to disable
  93. # this because it can lead to too many false positives.
  94. "PD",
  95. ]
  96. unfixable = [
  97. "PD002", # Disable autofix for inplace as this often introduces bugs
  98. ]
  99. ignore = [
  100. "D200", # One-line docstring should fit on one line with quotes
  101. "D400", # First line should end with a period
  102. ]
  103. # Provide some leeway for long docstring, this is otherwise handled by black
  104. line-length = 110
  105. [tool.ruff.per-file-ignores]
  106. "test*.py" = [
  107. "D", # Documentation not needed in tests
  108. "S101", # S101 Use of `assert` detected
  109. "PLR2004" # Magic value used in comparison
  110. ]
  111. "docs/source/notebooks/*" = [
  112. "D100", # Missing docstring at the top of file
  113. "E402", # Module level import not at top of file
  114. "S101", # Use of `assert` detected
  115. ]
  116. "scripts/*" = [
  117. "S101" # S101 Use of `assert` detected
  118. ]
  119. [tool.ruff.isort]
  120. known-first-party = ["src"]
  121. [tool.ruff.pydocstyle]
  122. convention = "numpy"
  123. [tool.towncrier]
  124. package = "unfccc-ghg-data"
  125. package_dir = "src"
  126. filename = "docs/source/changelog.md"
  127. directory = "changelog/"
  128. title_format = "## unfccc-ghg-data {version} ({project_date})"
  129. underlines = ["", "", ""]
  130. issue_format = "[#{issue}](https://github.com/JGuetschow/UNFCCC_non-AnnexI_data/pulls/{issue})"
  131. [[tool.towncrier.type]]
  132. directory = "breaking"
  133. name = "Breaking Changes"
  134. showcontent = true
  135. [[tool.towncrier.type]]
  136. directory = "deprecation"
  137. name = "Deprecations"
  138. showcontent = true
  139. [[tool.towncrier.type]]
  140. directory = "feature"
  141. name = "Features"
  142. showcontent = true
  143. [[tool.towncrier.type]]
  144. directory = "improvement"
  145. name = "Improvements"
  146. showcontent = true
  147. [[tool.towncrier.type]]
  148. directory = "fix"
  149. name = "Bug Fixes"
  150. showcontent = true
  151. [[tool.towncrier.type]]
  152. directory = "docs"
  153. name = "Improved Documentation"
  154. showcontent = true
  155. [[tool.towncrier.type]]
  156. directory = "trivial"
  157. name = "Trivial/Internal Changes"
  158. showcontent = false
  159. [tool.liccheck]
  160. authorized_licenses = [
  161. "bsd",
  162. "bsd license",
  163. "BSD 3-Clause",
  164. "CC0",
  165. "apache",
  166. "apache 2.0",
  167. "apache software",
  168. "apache software license",
  169. "Apache License, Version 2.0",
  170. "Historical Permission Notice and Disclaimer (HPND)",
  171. "isc license",
  172. "isc license (iscl)",
  173. "gnu lgpl",
  174. "lgpl with exceptions or zpl",
  175. "LGPLv2+",
  176. "GNU Lesser General Public License v2 (LGPLv2)",
  177. "GNU Lesser General Public License v2 or later (LGPLv2+)",
  178. "mit",
  179. "mit license",
  180. "Mozilla Public License 2.0 (MPL 2.0)",
  181. "python software foundation",
  182. "python software foundation license",
  183. "zpl 2.1",
  184. ]
  185. # This starting list is relatively conservative. Depending on the project, it
  186. # may make sense to move some of these into the authorized list
  187. unauthorized_licenses = [
  188. "agpl",
  189. "gnu agpl",
  190. "gpl v3",
  191. "gplv3",
  192. "gpl v2",
  193. "gplv2",
  194. "gpl v1",
  195. "gplv1",
  196. ]