agent-framework-botsrated 0.1.1__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agent-framework-botsrated
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: BotsRated pre-payment check for Microsoft Agent Framework: function middleware that checks an x402 payTo with the free BotsRated preflight before a payment tool runs.
5
5
  Project-URL: Homepage, https://botsrated.com
6
6
  Project-URL: Repository, https://github.com/botsrated/botsrated
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agent-framework-botsrated"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "BotsRated pre-payment check for Microsoft Agent Framework: function middleware that checks an x402 payTo with the free BotsRated preflight before a payment tool runs."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,5 +1,7 @@
1
1
  """BotsRated pre-payment checks for Microsoft Agent Framework (Python)."""
2
2
 
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
3
5
  from agent_framework_botsrated._middleware import (
4
6
  DECISION_METADATA_KEY,
5
7
  BotsRatedPaymentBlocked,
@@ -25,4 +27,7 @@ __all__ = [
25
27
  "decision_to_dict",
26
28
  "default_quote_extractor",
27
29
  ]
28
- __version__ = "0.1.0"
30
+ try:
31
+ __version__ = version("agent-framework-botsrated")
32
+ except PackageNotFoundError: # running from a source tree without an install
33
+ __version__ = "0+unknown"
@@ -181,3 +181,11 @@ def test_default_extractor_reads_camel_case() -> None:
181
181
  def test_needs_a_payment_tool() -> None:
182
182
  with pytest.raises(ValueError):
183
183
  BotsRatedPaymentMiddleware([])
184
+
185
+
186
+ def test_version_comes_from_package_metadata() -> None:
187
+ from importlib.metadata import version
188
+
189
+ import agent_framework_botsrated
190
+
191
+ assert agent_framework_botsrated.__version__ == version("agent-framework-botsrated") == "0.1.2"