pyproject.toml 6.0 KB

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