pyproject.toml 5.4 KB

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