pyproject.toml 6.0 KB

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