pyproject.toml 5.9 KB

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