pyproject.toml 5.4 KB

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