Skip to content

Commit ebad1ee

Browse files
committed
release: keep Python 3.8 artifact gate strict
1 parent 5894bc6 commit ebad1ee

5 files changed

Lines changed: 28 additions & 10 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
3838
- name: Lint source with ruff
3939
run: ruff check oilpriceapi/
40-
continue-on-error: true
4140

4241
- name: Run unit tests
4342
run: pytest tests/ --ignore=tests/integration --ignore=tests/contract -m 'not slow' --cov=oilpriceapi -v

‎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. **[Sign up for free](https://oilpriceapi.com/auth/signup)** - Get 1,000 free requests/month
624+
1. **[Sign up for free](https://oilpriceapi.com/auth/signup)** - Get 50 requests/day
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

‎pyproject.toml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[build-system]
2-
requires = ["setuptools>=61.0", "wheel"]
2+
# Setuptools 77+ warns on the legacy license table, while the older backend
3+
# available on supported Python 3.8 cannot parse the replacement string form.
4+
requires = ["setuptools>=70.1,<77", "wheel"]
35
build-backend = "setuptools.build_meta"
46

57
[project]
@@ -13,8 +15,7 @@ maintainers = [
1315
{name = "OilPriceAPI Team", email = "support@oilpriceapi.com"}
1416
]
1517
readme = "README.md"
16-
license = "MIT"
17-
license-files = ["LICENSE"]
18+
license = {file = "LICENSE"}
1819
keywords = [
1920
"oil", "prices", "api", "commodities", "energy",
2021
"brent", "wti", "natural gas", "source timestamps", "finance"
@@ -24,6 +25,7 @@ classifiers = [
2425
"Intended Audience :: Developers",
2526
"Intended Audience :: Financial and Insurance Industry",
2627
"Intended Audience :: Science/Research",
28+
"License :: OSI Approved :: MIT License",
2729
"Operating System :: OS Independent",
2830
"Programming Language :: Python",
2931
"Programming Language :: Python :: 3",

‎scripts/clean-wheel-smoke.sh‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ from oilpriceapi.resources.demo import DemoResource
2727
expected = sys.argv[1]
2828
assert __version__ == expected, (__version__, expected)
2929
assert OilPriceAPI(api_key="artifact-smoke").prices is not None
30-
assert DemoResource().base_url.startswith("https://")
30+
demo = DemoResource()
31+
assert demo.base_url.startswith("https://")
32+
prices = demo.prices()["prices"]
33+
brent = next((price for price in prices if price.get("code") == "BRENT_CRUDE_USD"), None)
34+
assert brent is not None
35+
assert isinstance(brent.get("price"), (int, float))
36+
assert brent.get("updated_at")
3137
' "$expected_version"
3238

33-
echo "clean wheel smoke passed for oilpriceapi $expected_version"
39+
echo "clean wheel install and production demo smoke passed for oilpriceapi $expected_version"

‎tests/test_release_readiness.py‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,27 @@ 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:
21+
examples = (ROOT / "EXAMPLES.md").read_text()
22+
23+
assert "50 requests/day" in examples
24+
assert not re.search(r"free requests?/(?:month|monthly)", examples, re.IGNORECASE)
25+
26+
2027
def test_publish_gate_audits_and_installs_the_built_wheel() -> None:
2128
workflow = (ROOT / ".github" / "workflows" / "publish.yml").read_text()
2229

2330
assert "pip-audit" in workflow
2431
assert "scripts/clean-wheel-smoke.sh" in workflow
32+
assert "continue-on-error: true" not in workflow
2533

2634

27-
def test_packaging_configuration_uses_current_metadata_forms() -> None:
35+
def test_packaging_configuration_remains_compatible_with_supported_python() -> None:
2836
project = (ROOT / "pyproject.toml").read_text()
2937

30-
assert 'license = "MIT"' in project
31-
assert "License :: OSI Approved :: MIT License" not in project
38+
# Python 3.8 resolves a setuptools release whose schema does not yet accept
39+
# the PEP 639 string form. Keep the PEP 621 table while 3.8 is supported.
40+
assert 'requires = ["setuptools>=70.1,<77", "wheel"]' in project
41+
assert 'license = {file = "LICENSE"}' in project
42+
assert 'requires-python = ">=3.8"' in project
3243
assert "[tool.ruff.lint]" in project

0 commit comments

Comments
 (0)