pyproject.toml 6.0 KB

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