pyproject.toml 5.2 KB

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