pyproject.toml 5.0 KB

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