fmp-data 2.7.0__tar.gz → 2.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. {fmp_data-2.7.0 → fmp_data-2.7.1}/PKG-INFO +1 -1
  2. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/_version.py +2 -2
  3. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_base.py +4 -4
  4. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_base_async.py +15 -2
  5. fmp_data-2.7.1/tests/unit/test_changelog_headings.py +134 -0
  6. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_checkout_credentials.py +32 -9
  7. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_docs_tools_sync.py +34 -0
  8. fmp_data-2.7.1/tests/unit/test_github_release_notes.py +202 -0
  9. fmp_data-2.7.1/tests/unit/test_release_pr_workflow.py +110 -0
  10. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_release_tag_push.py +43 -1
  11. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_setup_uv_pin.py +1 -1
  12. fmp_data-2.7.1/tests/unit/test_workflow_run_scripts.py +214 -0
  13. {fmp_data-2.7.0 → fmp_data-2.7.1}/.gitignore +0 -0
  14. {fmp_data-2.7.0 → fmp_data-2.7.1}/LICENSE +0 -0
  15. {fmp_data-2.7.0 → fmp_data-2.7.1}/NOTICE +0 -0
  16. {fmp_data-2.7.0 → fmp_data-2.7.1}/README.md +0 -0
  17. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/__init__.py +0 -0
  18. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/_redaction.py +0 -0
  19. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/__init__.py +0 -0
  20. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/async_client.py +0 -0
  21. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/client.py +0 -0
  22. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/endpoints.py +0 -0
  23. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/mapping.py +0 -0
  24. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/models.py +0 -0
  25. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/alternative/schema.py +0 -0
  26. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/async_client.py +0 -0
  27. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/base.py +0 -0
  28. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/__init__.py +0 -0
  29. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/_csv_utils.py +0 -0
  30. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/async_client.py +0 -0
  31. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/client.py +0 -0
  32. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/endpoints.py +0 -0
  33. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/mapping.py +0 -0
  34. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/batch/models.py +0 -0
  35. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/__init__.py +0 -0
  36. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/base.py +0 -0
  37. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/config.py +0 -0
  38. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/file.py +0 -0
  39. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/memory.py +0 -0
  40. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/cache/redis_backend.py +0 -0
  41. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/client.py +0 -0
  42. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/__init__.py +0 -0
  43. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/async_client.py +0 -0
  44. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/client.py +0 -0
  45. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/endpoints.py +0 -0
  46. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/hints.py +0 -0
  47. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/mapping.py +0 -0
  48. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/models.py +0 -0
  49. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/company/schema.py +0 -0
  50. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/config.py +0 -0
  51. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/__init__.py +0 -0
  52. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/async_client.py +0 -0
  53. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/client.py +0 -0
  54. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/endpoints.py +0 -0
  55. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/mapping.py +0 -0
  56. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/models.py +0 -0
  57. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/economics/schema.py +0 -0
  58. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/exceptions.py +0 -0
  59. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/__init__.py +0 -0
  60. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/async_client.py +0 -0
  61. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/client.py +0 -0
  62. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/endpoints.py +0 -0
  63. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/mapping.py +0 -0
  64. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/models.py +0 -0
  65. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/fundamental/schema.py +0 -0
  66. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/helpers.py +0 -0
  67. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/__init__.py +0 -0
  68. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/async_client.py +0 -0
  69. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/client.py +0 -0
  70. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/endpoints.py +0 -0
  71. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/mapping.py +0 -0
  72. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/index/models.py +0 -0
  73. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/__init__.py +0 -0
  74. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/async_client.py +0 -0
  75. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/client.py +0 -0
  76. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/endpoints.py +0 -0
  77. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/mapping.py +0 -0
  78. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/models.py +0 -0
  79. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/institutional/schema.py +0 -0
  80. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/__init__.py +0 -0
  81. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/async_client.py +0 -0
  82. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/client.py +0 -0
  83. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/endpoints.py +0 -0
  84. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/mapping.py +0 -0
  85. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/models.py +0 -0
  86. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/intelligence/schema.py +0 -0
  87. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/__init__.py +0 -0
  88. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/async_client.py +0 -0
  89. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/client.py +0 -0
  90. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/endpoints.py +0 -0
  91. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/mapping.py +0 -0
  92. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/models.py +0 -0
  93. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/investment/schema.py +0 -0
  94. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/__init__.py +0 -0
  95. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/config.py +0 -0
  96. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/embedding.py +0 -0
  97. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/hints.py +0 -0
  98. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/mapping.py +0 -0
  99. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/models.py +0 -0
  100. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/registry.py +0 -0
  101. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/utils.py +0 -0
  102. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/validation.py +0 -0
  103. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/lc/vector_store.py +0 -0
  104. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/logger.py +0 -0
  105. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/__init__.py +0 -0
  106. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/async_client.py +0 -0
  107. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/client.py +0 -0
  108. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/endpoints.py +0 -0
  109. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/hints.py +0 -0
  110. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/mapping.py +0 -0
  111. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/models.py +0 -0
  112. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/market/schema.py +0 -0
  113. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/__init__.py +0 -0
  114. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/__main__.py +0 -0
  115. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/_compat.py +0 -0
  116. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/cli.py +0 -0
  117. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/discovery.py +0 -0
  118. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/server.py +0 -0
  119. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/setup.py +0 -0
  120. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/tool_loader.py +0 -0
  121. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/tools_manifest.py +0 -0
  122. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/mcp/utils.py +0 -0
  123. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/models.py +0 -0
  124. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/py.typed +0 -0
  125. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/rate_limit.py +0 -0
  126. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/schema.py +0 -0
  127. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/__init__.py +0 -0
  128. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/async_client.py +0 -0
  129. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/client.py +0 -0
  130. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/endpoints.py +0 -0
  131. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/mapping.py +0 -0
  132. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/sec/models.py +0 -0
  133. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/__init__.py +0 -0
  134. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/async_client.py +0 -0
  135. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/client.py +0 -0
  136. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/endpoints.py +0 -0
  137. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/mapping.py +0 -0
  138. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/models.py +0 -0
  139. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/technical/schema.py +0 -0
  140. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/tool_binding.py +0 -0
  141. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/__init__.py +0 -0
  142. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/async_client.py +0 -0
  143. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/client.py +0 -0
  144. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/endpoints.py +0 -0
  145. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/mapping.py +0 -0
  146. {fmp_data-2.7.0 → fmp_data-2.7.1}/fmp_data/transcripts/models.py +0 -0
  147. {fmp_data-2.7.0 → fmp_data-2.7.1}/pyproject.toml +0 -0
  148. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/__init__.py +0 -0
  149. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/e2e/__init__.py +0 -0
  150. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/e2e/harness.py +0 -0
  151. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/e2e/test_client_sweep.py +0 -0
  152. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/e2e/test_live_signatures.py +0 -0
  153. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/examples/__init__.py +0 -0
  154. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/examples/test_examples_smoke.py +0 -0
  155. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/__init__.py +0 -0
  156. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/base.py +0 -0
  157. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/cassette_contracts.json +0 -0
  158. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/conftest.py +0 -0
  159. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_alternative.py +0 -0
  160. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_batch.py +0 -0
  161. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_company.py +0 -0
  162. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_economics.py +0 -0
  163. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_fundamental.py +0 -0
  164. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_index.py +0 -0
  165. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_institutional.py +0 -0
  166. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_intelligence.py +0 -0
  167. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_investment.py +0 -0
  168. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_lc.py +0 -0
  169. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_market.py +0 -0
  170. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_sec.py +0 -0
  171. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_technical.py +0 -0
  172. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/integration/test_transcripts.py +0 -0
  173. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/__init__.py +0 -0
  174. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/conftest.py +0 -0
  175. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/__init__.py +0 -0
  176. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/conftest.py +0 -0
  177. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_config.py +0 -0
  178. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_deprecated_endpoints.py +0 -0
  179. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_embedding.py +0 -0
  180. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_endpoint_based_rules.py +0 -0
  181. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_endpoint_method_coverage.py +0 -0
  182. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_imports.py +0 -0
  183. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_mapping.py +0 -0
  184. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_method_dispatch.py +0 -0
  185. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_models.py +0 -0
  186. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_package_init.py +0 -0
  187. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_tool_schema.py +0 -0
  188. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_utils.py +0 -0
  189. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_validation.py +0 -0
  190. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_validation_registry.py +0 -0
  191. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/lc/test_vector_store.py +0 -0
  192. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_alternative.py +0 -0
  193. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_alternative_coverage.py +0 -0
  194. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_arg_model_deprecation.py +0 -0
  195. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_artifact_action_pins.py +0 -0
  196. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_async_clients.py +0 -0
  197. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_bandit_skips.py +0 -0
  198. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_base_coverage.py +0 -0
  199. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_batch.py +0 -0
  200. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_bulk_bytes.py +0 -0
  201. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_cache_backends.py +0 -0
  202. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_cache_integration.py +0 -0
  203. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_cache_ttl_override_keys.py +0 -0
  204. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_cassette_contracts.py +0 -0
  205. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_catalog_registration.py +0 -0
  206. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_ci_quality_gates.py +0 -0
  207. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_client.py +0 -0
  208. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_closed_vocabularies.py +0 -0
  209. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_codeql_workflow.py +0 -0
  210. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_company.py +0 -0
  211. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_company_coverage.py +0 -0
  212. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_config.py +0 -0
  213. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_config_secret_serialization.py +0 -0
  214. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_datetime_shadowing.py +0 -0
  215. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_dependabot_action_groups.py +0 -0
  216. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_deprecated_endpoint_flags.py +0 -0
  217. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_deprecated_methods_warn.py +0 -0
  218. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_docs_endpoints_sync.py +0 -0
  219. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_e2e_harness.py +0 -0
  220. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_e2e_sweep.py +0 -0
  221. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_economics.py +0 -0
  222. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_endpoint_registry.py +0 -0
  223. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_example_json_fences.py +0 -0
  224. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_exceptions.py +0 -0
  225. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_export_dotenv.py +0 -0
  226. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_extras_coverage_gate.py +0 -0
  227. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_fundamental.py +0 -0
  228. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_helpers.py +0 -0
  229. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_hint_consolidation.py +0 -0
  230. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_hosted_mcp_docs.py +0 -0
  231. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_imports.py +0 -0
  232. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_index.py +0 -0
  233. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_institutional.py +0 -0
  234. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_intelligence.py +0 -0
  235. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_investment.py +0 -0
  236. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_list_unwrap.py +0 -0
  237. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_logger.py +0 -0
  238. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_market.py +0 -0
  239. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp.py +0 -0
  240. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp_cli.py +0 -0
  241. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp_config_perms.py +0 -0
  242. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp_entry_point_coherence.py +0 -0
  243. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp_setup.py +0 -0
  244. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_mcp_utils.py +0 -0
  245. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_models.py +0 -0
  246. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_param_required_consistency.py +0 -0
  247. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_path_params.py +0 -0
  248. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_publish_pins.py +0 -0
  249. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_rate_limit.py +0 -0
  250. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_rate_limit_async.py +0 -0
  251. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_rate_limit_coverage.py +0 -0
  252. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_redaction_rules.py +0 -0
  253. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_redis_backend.py +0 -0
  254. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_sec.py +0 -0
  255. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_secret_scan_ci.py +0 -0
  256. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_security_audit_pins.py +0 -0
  257. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_tag_ancestry_guard.py +0 -0
  258. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_technical.py +0 -0
  259. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_technical_coverage.py +0 -0
  260. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_tool_binding.py +0 -0
  261. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_transcripts.py +0 -0
  262. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_vcr_sanitization.py +0 -0
  263. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_vector_store_error_contract.py +0 -0
  264. {fmp_data-2.7.0 → fmp_data-2.7.1}/tests/unit/test_workflow_permission_isolation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fmp-data
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: Python client for the Financial Modeling Prep API
5
5
  Project-URL: Homepage, https://github.com/MehdiZare/fmp-data
6
6
  Project-URL: Repository, https://github.com/MehdiZare/fmp-data
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.7.0'
22
- __version_tuple__ = version_tuple = (2, 7, 0)
21
+ __version__ = version = '2.7.1'
22
+ __version_tuple__ = version_tuple = (2, 7, 1)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -934,7 +934,7 @@ async def test_async_timeout_does_not_leak_apikey_via_cause_or_logs(
934
934
  with (
935
935
  patch.object(client, "_setup_async_client", return_value=mock_async_client),
936
936
  patch.object(client.logger, "error") as mock_error,
937
- patch("tenacity.nap.sleep", return_value=None),
937
+ patch("asyncio.sleep", new_callable=AsyncMock),
938
938
  pytest.raises(FMPTimeoutError) as exc_info,
939
939
  ):
940
940
  await client.request_async(mock_endpoint)
@@ -972,7 +972,7 @@ async def test_async_network_error_does_not_leak_apikey_via_cause_or_logs(
972
972
  with (
973
973
  patch.object(client, "_setup_async_client", return_value=mock_async_client),
974
974
  patch.object(client.logger, "error") as mock_error,
975
- patch("tenacity.nap.sleep", return_value=None),
975
+ patch("asyncio.sleep", new_callable=AsyncMock),
976
976
  pytest.raises(FMPNetworkError) as exc_info,
977
977
  ):
978
978
  await client.request_async(mock_endpoint)
@@ -1065,7 +1065,7 @@ async def test_async_leftover_request_error_does_not_leak_apikey_via_cause_or_lo
1065
1065
  with (
1066
1066
  patch.object(client, "_setup_async_client", return_value=mock_async_client),
1067
1067
  patch.object(client.logger, "error") as mock_error,
1068
- patch("tenacity.nap.sleep", return_value=None),
1068
+ patch("asyncio.sleep", new_callable=AsyncMock),
1069
1069
  pytest.raises(FMPNetworkError) as exc_info,
1070
1070
  ):
1071
1071
  await client.request_async(mock_endpoint)
@@ -1536,7 +1536,7 @@ async def test_async_protocol_error_is_retried(mock_endpoint, client_config) ->
1536
1536
  try:
1537
1537
  with (
1538
1538
  patch.object(client, "_setup_async_client", return_value=mock_async_client),
1539
- patch("tenacity.nap.sleep", return_value=None),
1539
+ patch("asyncio.sleep", new_callable=AsyncMock),
1540
1540
  pytest.raises(FMPNetworkError) as exc_info,
1541
1541
  ):
1542
1542
  await client.request_async(mock_endpoint)
@@ -271,7 +271,11 @@ class TestAsyncRetry:
271
271
  async def test_request_async_with_retry_on_transient_failure(
272
272
  self, client_config, sample_endpoint
273
273
  ):
274
- """Test that async request retries on transient failures."""
274
+ """Test that async request retries on transient failures.
275
+
276
+ Patches ``asyncio.sleep`` so the Tenacity 4-10s backoff is not a
277
+ real wait (#372 leftover of #358).
278
+ """
275
279
  from fmp_data.base import BaseClient
276
280
 
277
281
  client = BaseClient(client_config)
@@ -292,7 +296,10 @@ class TestAsyncRetry:
292
296
  raise httpx.TimeoutException("Timeout")
293
297
  return mock_response
294
298
 
295
- with patch.object(client, "_setup_async_client") as mock_setup:
299
+ with (
300
+ patch.object(client, "_setup_async_client") as mock_setup,
301
+ patch("asyncio.sleep", new_callable=AsyncMock) as mock_sleep,
302
+ ):
296
303
  mock_async_client = AsyncMock()
297
304
  mock_async_client.request = mock_request
298
305
  mock_setup.return_value = mock_async_client
@@ -302,6 +309,12 @@ class TestAsyncRetry:
302
309
  # Should have been called 3 times (2 failures + 1 success)
303
310
  assert call_count == 3
304
311
  assert result == {"test": "data"}
312
+ # Two backoffs between the three attempts. Tenacity 9.1.4 async
313
+ # retries go through asyncio.sleep, not tenacity.nap.sleep (#372).
314
+ # wait_exponential(multiplier=1, min=4, max=10) clamps both
315
+ # waits to 4s (2^0 and 2^1 are below min).
316
+ assert mock_sleep.await_count == 2
317
+ assert [call.args[0] for call in mock_sleep.await_args_list] == [4, 4]
305
318
 
306
319
  await client.aclose()
307
320
 
@@ -0,0 +1,134 @@
1
+ """Keep a Changelog version sections must not repeat standard headings (#360).
2
+
3
+ Folding Unreleased into 2.7.0 left two Added / four Changed / three Fixed /
4
+ two Security under the same version heading, with FMP API surface in the
5
+ middle. The merge is editorial; this pin keeps it from happening again on
6
+ Unreleased and on dated ``## [X.Y.Z] - YYYY-MM-DD`` headings from 2.7.0+.
7
+
8
+ Empty Unreleased is allowed (the post-cut bucket). Duplicate standard
9
+ headings are not.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from collections import Counter
15
+ from pathlib import Path
16
+ import re
17
+
18
+ CHANGELOG = Path(__file__).resolve().parents[2] / "CHANGELOG.md"
19
+
20
+ _STANDARD = frozenset(
21
+ {"Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"}
22
+ )
23
+ # Keep a Changelog dates the version: `## [2.7.0] - 2026-08-19`.
24
+ # A `$` immediately after `]` would skip every shipped section and leave
25
+ # only Unreleased gated (#360 follow-up on #369).
26
+ _VERSION_HEADER = re.compile(
27
+ r"^## (?:Unreleased|\[(\d+)\.(\d+)\.[^\]]+\])(?:\s+-.*)?\s*$"
28
+ )
29
+ _HEADING = re.compile(r"^### (.+)$", re.M)
30
+ # Extractor splits only on ``## [X.Y.Z]`` (#385 / ``_VERSION_CHUNK_START``).
31
+ # Uniqueness does the same for version bodies, plus ``## Unreleased`` so
32
+ # the post-cut bucket stays its own gated section. A bare ``## `` inside
33
+ # a version must not start a new chunk (#387).
34
+ _SECTION_CHUNK_START = re.compile(
35
+ r"(?=^## (?:Unreleased|\[[^\]]+\])(?:\s+-.*)?\s*$)", re.M
36
+ )
37
+
38
+
39
+ def _gated_sections(text: str) -> list[tuple[str, str]]:
40
+ """``(header, body)`` for Unreleased and every ``[X.Y.*]`` with X.Y >= 2.7."""
41
+ chunks = _SECTION_CHUNK_START.split(text)
42
+ out: list[tuple[str, str]] = []
43
+ for chunk in chunks:
44
+ lines = chunk.splitlines()
45
+ if not lines:
46
+ continue
47
+ header = lines[0].strip()
48
+ match = _VERSION_HEADER.match(header)
49
+ if match is None:
50
+ continue
51
+ if match.group(1) is not None:
52
+ major, minor = int(match.group(1)), int(match.group(2))
53
+ if (major, minor) < (2, 7):
54
+ continue
55
+ out.append((header, chunk))
56
+ return out
57
+
58
+
59
+ def test_version_header_matches_dated_keep_a_changelog() -> None:
60
+ """The uniqueness pin must see dated 2.7+ headings, not only Unreleased."""
61
+ dated = _VERSION_HEADER.match("## [2.7.0] - 2026-08-19")
62
+ assert dated is not None
63
+ assert dated.group(1) == "2"
64
+ assert dated.group(2) == "7"
65
+ assert _VERSION_HEADER.match("## Unreleased") is not None
66
+ assert _VERSION_HEADER.match("## [2.6.0] - 2026-08-10") is not None
67
+ assert _VERSION_HEADER.match("## Future Roadmap") is None
68
+
69
+
70
+ def test_gated_sections_keep_non_version_level_two_inside_version() -> None:
71
+ """#387: a ``## `` that is not a version heading stays in the section."""
72
+ text = (
73
+ "## [2.7.0] - 2026-08-19\n\n"
74
+ "### Added\n\n- first\n\n"
75
+ "## Upgrade notes\n\n"
76
+ "### Added\n\n- second\n\n"
77
+ "## [2.6.0] - 2026-08-10\n\n"
78
+ "### Added\n\n- old\n"
79
+ )
80
+ sections = _gated_sections(text)
81
+ assert [header for header, _ in sections] == ["## [2.7.0] - 2026-08-19"]
82
+ headings = [name for name in _HEADING.findall(sections[0][1]) if name in _STANDARD]
83
+ assert headings == ["Added", "Added"]
84
+
85
+
86
+ def test_gated_sections_include_dated_2_7_and_allow_empty_unreleased() -> None:
87
+ text = (
88
+ "## Unreleased\n\n"
89
+ "## [2.7.0] - 2026-08-19\n\n### Added\n\n- note\n\n"
90
+ "## [2.6.0] - 2026-08-10\n\n### Added\n\n- old\n"
91
+ )
92
+ sections = _gated_sections(text)
93
+ headers = [header for header, _ in sections]
94
+ assert headers == ["## Unreleased", "## [2.7.0] - 2026-08-19"]
95
+ unreleased_headings = [
96
+ name for name in _HEADING.findall(sections[0][1]) if name in _STANDARD
97
+ ]
98
+ assert unreleased_headings == []
99
+
100
+
101
+ def test_changelog_standard_headings_are_unique_from_2_7() -> None:
102
+ text = CHANGELOG.read_text(encoding="utf-8")
103
+ sections = _gated_sections(text)
104
+ assert sections, "expected Unreleased and/or 2.7.0+ sections"
105
+ dated = [header for header, _ in sections if header.startswith("## [")]
106
+ assert dated, (
107
+ "uniqueness pin matched no dated 2.7+ section; "
108
+ "the version-header regex is probably ignoring `## [X.Y.Z] - date`"
109
+ )
110
+
111
+ duplicates: dict[str, list[str]] = {}
112
+ for header, body in sections:
113
+ headings = _HEADING.findall(body)
114
+ standard = [name for name in headings if name in _STANDARD]
115
+ # Empty Unreleased is the post-cut bucket (#360). Version sections
116
+ # that still have notes must not repeat a standard heading.
117
+ repeated = sorted(
118
+ name for name, count in Counter(standard).items() if count > 1
119
+ )
120
+ if repeated:
121
+ duplicates[header] = repeated
122
+
123
+ assert duplicates == {}, f"duplicate changelog headings: {duplicates}"
124
+
125
+
126
+ def test_2_7_0_puts_fmp_api_surface_first() -> None:
127
+ text = CHANGELOG.read_text(encoding="utf-8")
128
+ match = re.search(r"^## \[2\.7\.0\].*?(?=^## \[)", text, re.M | re.S)
129
+ assert match is not None, "missing ## [2.7.0] section"
130
+ headings = _HEADING.findall(match.group(0))
131
+ assert headings, "2.7.0 has no ### headings"
132
+ assert headings[0].startswith("FMP API surface"), headings[0]
133
+ for name in ("Added", "Changed", "Fixed", "Security"):
134
+ assert headings.count(name) == 1, headings
@@ -2,11 +2,11 @@
2
2
 
3
3
  ``actions/checkout`` writes the job's token into ``.git/config`` unless told
4
4
  not to, where every later step can read it -- including dependency installs,
5
- build backends and third-party actions. Only two jobs in this repo actually
6
- push, so the rest have no reason to carry the credential at all.
5
+ build backends and third-party actions. Only ``sync-main-to-dev`` still
6
+ pushes, so every other checkout drops the credential.
7
7
 
8
- The exceptions are asserted by name rather than skipped, so adding a third one
9
- is a deliberate edit to this list and not an accident.
8
+ The remaining exception is asserted by name rather than skipped, so adding
9
+ another one is a deliberate edit to this list and not an accident.
10
10
  """
11
11
 
12
12
  from __future__ import annotations
@@ -18,14 +18,14 @@ import pytest
18
18
  import yaml
19
19
 
20
20
  REPO_ROOT = Path(__file__).resolve().parents[2]
21
- WORKFLOWS = sorted((REPO_ROOT / ".github" / "workflows").glob("*.yml"))
21
+ WORKFLOWS_DIR = REPO_ROOT / ".github" / "workflows"
22
+ WORKFLOWS = sorted(WORKFLOWS_DIR.glob("*.yml")) + sorted(WORKFLOWS_DIR.glob("*.yaml"))
23
+ GITHUB_YAML = sorted((REPO_ROOT / ".github").rglob("*.yml")) + sorted(
24
+ (REPO_ROOT / ".github").rglob("*.yaml")
25
+ )
22
26
 
23
27
  # job name -> why this one keeps its credential.
24
28
  ALLOWED_TO_PERSIST = {
25
- "claude": (
26
- "claude-code-action runs standard git commands to commit and push; "
27
- "dropping the credential silently breaks @claude"
28
- ),
29
29
  "sync-main-to-dev": "really runs `git push origin HEAD:refs/heads/...`",
30
30
  }
31
31
 
@@ -80,3 +80,26 @@ def test_read_only_checkouts_do_not_pass_an_explicit_token() -> None:
80
80
  if "token" in (step.get("with") or {}) and job not in ALLOWED_TO_PERSIST
81
81
  ]
82
82
  assert not offenders, offenders
83
+
84
+
85
+ def test_claude_code_action_workflows_are_absent() -> None:
86
+ """#359: do not restore the unpinned marketplace review or @claude agent.
87
+
88
+ GitHub runs ``.yml`` and ``.yaml``. Composite actions under
89
+ ``.github/actions/`` are scanned too, so a vendored wrapper cannot
90
+ hide ``claude-code-action`` / ``plugin_marketplaces``.
91
+ """
92
+ for name in (
93
+ "claude.yml",
94
+ "claude.yaml",
95
+ "claude-code-review.yml",
96
+ "claude-code-review.yaml",
97
+ ):
98
+ assert not (WORKFLOWS_DIR / name).exists()
99
+ remaining = "\n".join(
100
+ path.read_text(encoding="utf-8") for path in GITHUB_YAML
101
+ ).casefold()
102
+ assert "anthropics/claude-code-action" not in remaining
103
+ assert "claude_code_oauth_token" not in remaining
104
+ assert "plugin_marketplaces" not in remaining
105
+ assert "anthropics/claude-code.git" not in remaining
@@ -144,6 +144,40 @@ _NO_SUCCESSOR_WORDS = {
144
144
  }
145
145
 
146
146
 
147
+ _WITHDRAWN_MARK = "**Withdrawn / not in DEFAULT_TOOLS**"
148
+ _ROW_FULL_RE = re.compile(r"^\| `(?P<key>[a-z_0-9]+)` \| (?P<desc>.*) \|$")
149
+
150
+
151
+ def _documented_row_text() -> dict[str, str]:
152
+ """``{client.key: description}`` for every catalog row."""
153
+ rows: dict[str, str] = {}
154
+ client: str | None = None
155
+
156
+ for line in DOC_PATH.read_text().splitlines():
157
+ section = _SECTION_RE.match(line)
158
+ if section:
159
+ title = section.group("title")
160
+ client = None if title == "Table of Contents" else title.lower()
161
+ continue
162
+
163
+ row = _ROW_FULL_RE.match(line)
164
+ if row and client is not None:
165
+ rows[f"{client}.{row.group('key')}"] = row.group("desc")
166
+
167
+ return rows
168
+
169
+
170
+ def test_withdrawn_catalog_rows_are_marked() -> None:
171
+ """Every WITHDRAWN_TOOLS spec must carry the withdrawn mark in its row."""
172
+ rows = _documented_row_text()
173
+ missing = sorted(
174
+ spec for spec in WITHDRAWN_TOOLS if _WITHDRAWN_MARK not in rows.get(spec, "")
175
+ )
176
+ assert missing == [], (
177
+ f"{DOC_PATH.name} withdrawn rows omit {_WITHDRAWN_MARK!r}: {missing}"
178
+ )
179
+
180
+
147
181
  def test_withdrawn_preamble_counts_match_source() -> None:
148
182
  """The withdrawn-endpoint prose must track WITHDRAWN_TOOLS, not rot."""
149
183
  text = DOC_PATH.read_text()
@@ -0,0 +1,202 @@
1
+ """GitHub Release notes come from CHANGELOG.md, not the squash log (#370)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib.util
6
+ from pathlib import Path
7
+
8
+ import pytest
9
+
10
+ _SCRIPT = Path(__file__).resolve().parents[2] / "scripts" / "github_release_notes.py"
11
+ _CHANGELOG = Path(__file__).resolve().parents[2] / "CHANGELOG.md"
12
+ _SPEC = importlib.util.spec_from_file_location("github_release_notes", _SCRIPT)
13
+ assert _SPEC and _SPEC.loader
14
+ notes = importlib.util.module_from_spec(_SPEC)
15
+ _SPEC.loader.exec_module(notes)
16
+
17
+ _SAMPLE = """# Changelog
18
+
19
+ ## Unreleased
20
+
21
+ ### Added
22
+
23
+ - unreleased note
24
+
25
+ ## [2.7.0] - 2026-08-19
26
+
27
+ Released from `dev`.
28
+
29
+ ### FMP API surface (scan this first)
30
+
31
+ - diluted P/E
32
+
33
+ ### Added
34
+
35
+ - senate trades
36
+
37
+ ## [2.6.0] - 2026-08-10
38
+
39
+ ### Added
40
+
41
+ - old note
42
+ """
43
+
44
+
45
+ def test_extract_section_drops_heading_and_neighbors() -> None:
46
+ body = notes.extract_section(_SAMPLE, "2.7.0")
47
+ assert body.startswith("Released from `dev`.")
48
+ assert "### FMP API surface (scan this first)" in body
49
+ assert "### Added" in body
50
+ assert "senate trades" in body
51
+ assert "## [2.7.0]" not in body
52
+ assert "unreleased note" not in body
53
+ assert "old note" not in body
54
+ assert "## Unreleased" not in body
55
+ assert "## [2.6.0]" not in body
56
+
57
+
58
+ def test_extract_section_strips_v_prefix() -> None:
59
+ assert notes.extract_section(_SAMPLE, "v2.7.0") == notes.extract_section(
60
+ _SAMPLE, "2.7.0"
61
+ )
62
+
63
+
64
+ def test_extract_section_missing_version_raises() -> None:
65
+ with pytest.raises(ValueError, match=r"no ## \[2\.8\.0\] section"):
66
+ notes.extract_section(_SAMPLE, "2.8.0")
67
+
68
+
69
+ def test_extract_section_keeps_non_version_level_two_heading() -> None:
70
+ text = (
71
+ "## [2.7.0] - 2026-08-19\n\n"
72
+ "intro\n\n"
73
+ "## Upgrade notes\n\n"
74
+ "keep me\n\n"
75
+ "## [2.6.0] - 2026-08-10\n\n"
76
+ "old\n"
77
+ )
78
+ body = notes.extract_section(text, "2.7.0")
79
+ assert "intro" in body
80
+ assert "## Upgrade notes" in body
81
+ assert "keep me" in body
82
+ assert "old" not in body
83
+
84
+
85
+ def test_extract_section_empty_body_raises() -> None:
86
+ text = "## [2.7.1] - 2026-08-20\n\n## [2.7.0] - 2026-08-19\n\nbody\n"
87
+ with pytest.raises(ValueError, match=r"## \[2\.7\.1\] is empty"):
88
+ notes.extract_section(text, "2.7.1")
89
+
90
+
91
+ def test_render_github_release_wraps_install_and_links() -> None:
92
+ rendered = notes.render_github_release(
93
+ tag="v2.7.0", version="2.7.0", body="Released from `dev`."
94
+ )
95
+ assert rendered.startswith("## 🎉 Release v2.7.0\n")
96
+ assert "Released from `dev`." in rendered
97
+ assert "pip install fmp-data==2.7.0" in rendered
98
+ assert "https://pypi.org/project/fmp-data/2.7.0/" in rendered
99
+ assert "https://mehdizare.github.io/fmp-data/" in rendered
100
+ assert "### 📝 Commits" not in rendered
101
+
102
+
103
+ def test_live_changelog_2_7_0_extracts_fmp_surface_first() -> None:
104
+ body = notes.extract_section(_CHANGELOG.read_text(encoding="utf-8"), "2.7.0")
105
+ assert "### FMP API surface (scan this first)" in body
106
+ assert body.index("### FMP API surface") < body.index("### Added")
107
+ assert "## Unreleased" not in body
108
+ assert "## [2.6.0]" not in body
109
+
110
+
111
+ def test_cli_writes_release_file(tmp_path: Path) -> None:
112
+ changelog = tmp_path / "CHANGELOG.md"
113
+ changelog.write_text(_SAMPLE, encoding="utf-8")
114
+ out = tmp_path / "release-notes.md"
115
+ rc = notes.main(
116
+ [
117
+ "--changelog",
118
+ str(changelog),
119
+ "--version",
120
+ "2.7.0",
121
+ "--tag",
122
+ "v2.7.0",
123
+ "--out",
124
+ str(out),
125
+ ]
126
+ )
127
+ assert rc == 0
128
+ body = notes.extract_section(_SAMPLE, "2.7.0")
129
+ expected = notes.render_github_release(tag="v2.7.0", version="2.7.0", body=body)
130
+ assert out.read_text(encoding="utf-8") == expected
131
+ assert "unreleased note" not in expected
132
+ assert "old note" not in expected
133
+
134
+
135
+ def test_cli_missing_section_is_nonzero(
136
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
137
+ ) -> None:
138
+ changelog = tmp_path / "CHANGELOG.md"
139
+ changelog.write_text(_SAMPLE, encoding="utf-8")
140
+ out = tmp_path / "x.md"
141
+ rc = notes.main(
142
+ [
143
+ "--changelog",
144
+ str(changelog),
145
+ "--version",
146
+ "9.9.9",
147
+ "--out",
148
+ str(out),
149
+ ]
150
+ )
151
+ assert rc == 1
152
+ err = capsys.readouterr().err
153
+ assert err.startswith("error:")
154
+ assert not out.exists()
155
+
156
+
157
+ def test_cli_unwritable_out_is_nonzero(
158
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
159
+ ) -> None:
160
+ changelog = tmp_path / "CHANGELOG.md"
161
+ changelog.write_text(_SAMPLE, encoding="utf-8")
162
+ rc = notes.main(
163
+ [
164
+ "--changelog",
165
+ str(changelog),
166
+ "--version",
167
+ "2.7.0",
168
+ "--out",
169
+ str(tmp_path),
170
+ ]
171
+ )
172
+ assert rc == 1
173
+ err = capsys.readouterr().err
174
+ assert err.startswith("error:")
175
+ assert "cannot write" in err
176
+
177
+
178
+ def test_cli_missing_changelog_file_is_nonzero(
179
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
180
+ ) -> None:
181
+ rc = notes.main(
182
+ [
183
+ "--changelog",
184
+ str(tmp_path / "missing.md"),
185
+ "--version",
186
+ "2.7.0",
187
+ "--out",
188
+ str(tmp_path / "x.md"),
189
+ ]
190
+ )
191
+ assert rc == 1
192
+ err = capsys.readouterr().err
193
+ assert err.startswith("error:")
194
+ assert not (tmp_path / "x.md").exists()
195
+
196
+
197
+ def test_live_changelog_2_7_1_extracts() -> None:
198
+ body = notes.extract_section(_CHANGELOG.read_text(encoding="utf-8"), "2.7.1")
199
+ assert body.startswith("Patch of leftover 2.7.0")
200
+ assert "## Unreleased" not in body
201
+ assert "## [2.7.0]" not in body
202
+ assert "fmp_data" in body
@@ -0,0 +1,110 @@
1
+ """Release-PR must not open a slot when ``dev`` and ``main`` share a tree (#375).
2
+
3
+ After a squash onto ``main`` and a history-only Sync-Main-to-Dev merge,
4
+ ``dev`` is commits-ahead of ``main`` with an identical tree. SHA equality
5
+ and ``git rev-list --count`` miss that, so the job used to open an
6
+ unlabeled empty ``Release: dev → main`` PR (#374). Squash-merging that
7
+ slot recreates the #202 ancestry break for no package change.
8
+
9
+ These assertions walk the workflow source so the tree-identity check cannot
10
+ be deleted without CI failing. Behaviour of ``gh`` itself is not executed.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from pathlib import Path
16
+ from typing import Any
17
+
18
+ import yaml
19
+
20
+ REPO_ROOT = Path(__file__).resolve().parents[2]
21
+ WORKFLOW = REPO_ROOT / ".github" / "workflows" / "release-pr.yml"
22
+
23
+ _TREE_DIFF = "git diff --quiet origin/dev origin/main"
24
+ _CREATE = "gh pr create --base main --head dev"
25
+ _EMPTY_ACTION = "action=empty-slot"
26
+ _UNDO_DRAFT = "gh pr ready"
27
+
28
+
29
+ def _loaded() -> dict[str, Any]:
30
+ loaded = yaml.safe_load(WORKFLOW.read_text(encoding="utf-8"))
31
+ assert isinstance(loaded, dict), f"{WORKFLOW.name} is not a mapping"
32
+ return loaded
33
+
34
+
35
+ def _plan_script() -> str:
36
+ jobs = _loaded().get("jobs") or {}
37
+ job = jobs.get("create-release-pr") or {}
38
+ steps = job.get("steps") or []
39
+ for step in steps:
40
+ if not isinstance(step, dict):
41
+ continue
42
+ if step.get("id") == "plan":
43
+ run = step.get("run")
44
+ assert isinstance(run, str) and run.strip(), "plan step has no run script"
45
+ return run
46
+ raise AssertionError("create-release-pr job has no plan step")
47
+
48
+
49
+ def test_release_pr_workflow_is_parseable() -> None:
50
+ loaded = _loaded()
51
+ assert loaded.get("name") == "Release-PR"
52
+ jobs = loaded.get("jobs") or {}
53
+ assert "create-release-pr" in jobs
54
+
55
+
56
+ def test_trees_match_is_defined_and_used_before_create() -> None:
57
+ script = _plan_script()
58
+ assert "trees_match()" in script
59
+ assert _TREE_DIFF in script
60
+ tree_at = script.index(_TREE_DIFF)
61
+ create_at = script.index(_CREATE)
62
+ assert tree_at < create_at, "tree-identity check must run before gh pr create"
63
+
64
+
65
+ def test_create_path_noops_when_trees_match() -> None:
66
+ """The no-existing-PR path must refuse to open a slot on identical trees."""
67
+ script = _plan_script()
68
+ create_at = script.index(_CREATE)
69
+ prefix = script[:create_at]
70
+ # Existing-PR path + create path each have their own call.
71
+ assert prefix.count("if trees_match; then") == 2
72
+ ahead_at = prefix.index("AHEAD=$(git rev-list --count origin/main..origin/dev)")
73
+ create_path = prefix[ahead_at:]
74
+ skip_at = create_path.index("if trees_match; then")
75
+ then_arm = create_path[skip_at : create_path.index("fi", skip_at)]
76
+ assert 'echo "action=noop"' in then_arm
77
+ assert "exit 0" in then_arm
78
+ assert "gh pr create" not in then_arm
79
+ # Unique vs the SHA / rev-list noops that #374 already bypassed.
80
+ assert "trees match; nothing to release" in then_arm
81
+
82
+
83
+ def test_existing_pr_becomes_empty_slot_when_trees_match() -> None:
84
+ script = _plan_script()
85
+ assert "mark_empty_slot()" in script
86
+ assert _EMPTY_ACTION in script
87
+ assert f'{_UNDO_DRAFT} "$pr_number" --undo' in script or (
88
+ f"{_UNDO_DRAFT} " in script and "--undo" in script
89
+ )
90
+ assert "empty slot — do not merge" in script
91
+ assert "<!-- empty-tree-release-slot -->" in script
92
+ # Restore the checklist when a later push introduces a content delta.
93
+ assert "restore_release_pr()" in script
94
+ assert "Content delta present; restoring release checklist" in script
95
+ # Restore keys off the HTML stamp, not a title glob like "do not merge".
96
+ assert 'contains("<!-- empty-tree-release-slot -->")' in script
97
+ assert '*"do not merge"*' not in script
98
+
99
+
100
+ def test_empty_slot_still_runs_mergeable_check() -> None:
101
+ """CONFLICTING empty slots must still fail closed (#207 / #210)."""
102
+ text = WORKFLOW.read_text(encoding="utf-8")
103
+ assert "steps.plan.outputs.action == 'empty-slot'" in text
104
+ loaded = _loaded()
105
+ steps = loaded["jobs"]["create-release-pr"]["steps"]
106
+ mergeable = next(step for step in steps if step.get("id") == "mergeable")
107
+ condition = mergeable.get("if")
108
+ assert isinstance(condition, str)
109
+ assert "empty-slot" in condition
110
+ assert "revalidate" in condition