Skip to content

Commit 96f1da1

Browse files
authored
fix: reject mutable daily allowance claims (#86)
1 parent 82622d1 commit 96f1da1

7 files changed

Lines changed: 26 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.12.4] - 2026-08-11
11+
12+
### Fixed
13+
14+
- Reject every fixed demo-rate literal, including the previously exempted
15+
daily allowance, and direct examples to the reviewed live product facts.
16+
1017
## [1.12.3] - 2026-08-11
1118

1219
### Fixed

EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ print("📊 Powered by https://oilpriceapi.com")
621621

622622
Ready to build with these examples?
623623

624-
1. **[Create an API key](https://oilpriceapi.com/auth/signup)** - The current free-account allowance is 50 requests/day; verify the [product facts](https://api.oilpriceapi.com/product-facts.json)
624+
1. **[Create an API key](https://oilpriceapi.com/auth/signup)** - Check the reviewed [product facts](https://api.oilpriceapi.com/product-facts.json) for the current account allowance
625625
2. **[Install the SDK](https://pypi.org/project/oilpriceapi/)** - `pip install oilpriceapi`
626626
3. **[Read the docs](https://docs.oilpriceapi.com/sdk/python)** - Complete API reference
627627
4. **[Choose a plan](https://oilpriceapi.com/pricing)** - Upgrade for more requests

oilpriceapi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Used in __init__.py, client.py, and async_client.py.
66
"""
77

8-
__version__ = "1.12.3"
8+
__version__ = "1.12.4"
99
SDK_VERSION = __version__
1010
SDK_NAME = "oilpriceapi-python"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "oilpriceapi"
9-
version = "1.12.3"
9+
version = "1.12.4"
1010
description = "Official Python SDK for source-timestamped OilPriceAPI energy data"
1111
authors = [
1212
{name = "OilPriceAPI", email = "support@oilpriceapi.com"}

scripts/validate_storefront_claims.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ def _claim_failures(root: Path, surfaces: Iterable[Path]) -> List[str]:
143143
for label, pattern in BLOCKED:
144144
match = pattern.search(text)
145145
if match:
146-
if label == "fixed demo rate" and match.group(0).lower() == "50 requests/day":
147-
continue
148146
failures.append(
149147
f"{path.relative_to(root)}: {label} matched {match.group(0)!r}"
150148
)

tests/test_release_readiness.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ def test_release_documentation_matches_the_automated_gate() -> None:
1717
assert changelog.count("## [Unreleased]") == 1
1818

1919

20-
def test_examples_use_the_canonical_free_quota() -> None:
20+
def test_examples_defer_mutable_allowances_to_product_facts() -> None:
2121
examples = (ROOT / "EXAMPLES.md").read_text()
2222

23-
assert "50 requests/day" in examples
24-
assert not re.search(r"free requests?/(?:month|monthly)", examples, re.IGNORECASE)
23+
assert "https://api.oilpriceapi.com/product-facts.json" in examples
24+
assert not re.search(
25+
r"\b\d[\d,]*\s+(?:api\s+)?requests?\s*(?:/|per\s+)"
26+
r"(?:minute|hour|day|month)s?\b",
27+
examples,
28+
re.IGNORECASE,
29+
)
2530

2631

2732
def test_publish_gate_audits_and_installs_the_built_wheel() -> None:

tests/test_storefront_claims.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def test_rejects_claim_in_future_installed_package_data(tmp_path: Path) -> None:
6161
'Monthly station query limit applies."""\n'
6262
)
6363
(package / "docs" / "catalog.json").write_text(
64-
'{"allowance": "1,000 API requests/month"}\n'
64+
'{"allowance": "1,000 API requests/month", '
65+
'"daily_allowance": "50 requests/day"}\n'
6566
)
6667
(package / "__pycache__" / "version.cpython-312.pyc").write_bytes(b"\x00\xff")
6768
(dist_info / "METADATA").write_text(
@@ -108,3 +109,9 @@ def test_rejects_claim_in_future_installed_package_data(tmp_path: Path) -> None:
108109
for failure in failures
109110
)
110111
assert any("oilpriceapi/docs/catalog.json" in failure for failure in failures)
112+
assert any(
113+
"oilpriceapi/docs/catalog.json" in failure
114+
and "fixed demo rate" in failure
115+
and "matched '50 requests/day'" in failure
116+
for failure in failures
117+
)

0 commit comments

Comments
 (0)