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. [tool.ruff.format]
  107. docstring-code-format = true
  108. [tool.ruff.per-file-ignores]
  109. "test*.py" = [
  110. "D", # Documentation not needed in tests
  111. "S101", # S101 Use of `assert` detected
  112. "PLR2004" # Magic value used in comparison
  113. ]
  114. "src/unfccc_ghg_data/unfccc_reader/*/config_*.py" = [
  115. "E501", # don't enforce line length
  116. ]
  117. "src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/*_specification.py" = [
  118. "E501", # don't enforce line length
  119. ]
  120. "src/unfccc_ghg_data/unfccc_di_reader/unfccc_di_reader_config.py" = [
  121. "E501", # don't enforce line length
  122. ]
  123. "docs/source/notebooks/*" = [
  124. "D100", # Missing docstring at the top of file
  125. "E402", # Module level import not at top of file
  126. "S101", # Use of `assert` detected
  127. ]
  128. "scripts/*" = [
  129. "S101" # S101 Use of `assert` detected
  130. ]
  131. "dodo.py" = [
  132. "E501" # don't enforce line length
  133. ]
  134. [tool.ruff.isort]
  135. known-first-party = ["src"]
  136. [tool.ruff.pydocstyle]
  137. convention = "numpy"
  138. [tool.towncrier]
  139. package = "unfccc_ghg_data"
  140. package_dir = "src"
  141. filename = "docs/source/changelog.md"
  142. directory = "changelog/"
  143. title_format = "## unfccc-ghg-data {version} ({project_date})"
  144. underlines = ["", "", ""]
  145. issue_format = "[#{issue}](https://github.com/JGuetschow/UNFCCC_non-AnnexI_data/pulls/{issue})"
  146. [[tool.towncrier.type]]
  147. directory = "breaking"
  148. name = "Breaking Changes"
  149. showcontent = true
  150. [[tool.towncrier.type]]
  151. directory = "deprecation"
  152. name = "Deprecations"
  153. showcontent = true
  154. [[tool.towncrier.type]]
  155. directory = "feature"
  156. name = "Features"
  157. showcontent = true
  158. [[tool.towncrier.type]]
  159. directory = "improvement"
  160. name = "Improvements"
  161. showcontent = true
  162. [[tool.towncrier.type]]
  163. directory = "fix"
  164. name = "Bug Fixes"
  165. showcontent = true
  166. [[tool.towncrier.type]]
  167. directory = "docs"
  168. name = "Improved Documentation"
  169. showcontent = true
  170. [[tool.towncrier.type]]
  171. directory = "trivial"
  172. name = "Trivial/Internal Changes"
  173. showcontent = false
  174. [tool.liccheck]
  175. authorized_licenses = [
  176. "bsd",
  177. "bsd license",
  178. "BSD 3-Clause",
  179. "CC0",
  180. "apache",
  181. "apache 2.0",
  182. "apache software",
  183. "apache software license",
  184. "Apache License, Version 2.0",
  185. "Historical Permission Notice and Disclaimer (HPND)",
  186. "isc license",
  187. "isc license (iscl)",
  188. "gnu lgpl",
  189. "lgpl with exceptions or zpl",
  190. "LGPLv2+",
  191. "GNU Lesser General Public License v2 (LGPLv2)",
  192. "GNU Lesser General Public License v2 or later (LGPLv2+)",
  193. "mit",
  194. "mit license",
  195. "Mozilla Public License 2.0 (MPL 2.0)",
  196. "python software foundation",
  197. "python software foundation license",
  198. "zpl 2.1",
  199. ]
  200. # This starting list is relatively conservative. Depending on the project, it
  201. # may make sense to move some of these into the authorized list
  202. unauthorized_licenses = [
  203. "agpl",
  204. "gnu agpl",
  205. "gpl v3",
  206. "gplv3",
  207. "gpl v2",
  208. "gplv2",
  209. "gpl v1",
  210. "gplv1",
  211. ]