diff --git a/cli/conftest.py b/cli/conftest.py index 5f78ff3ba35..06c0a0c6c64 100644 --- a/cli/conftest.py +++ b/cli/conftest.py @@ -43,7 +43,7 @@ PYPROJECT = """\ [project] name = "{ext_name}" version = "0.0.1" -requires-python = ">=3.10,<4" +requires-python = ">=3.11,<4" dependencies = ["openbb-core"] [project.entry-points."openbb_core_extension"] diff --git a/cli/openbb_cli/config/loader.py b/cli/openbb_cli/config/loader.py index cad13003fa8..98f9bceebab 100644 --- a/cli/openbb_cli/config/loader.py +++ b/cli/openbb_cli/config/loader.py @@ -3,15 +3,10 @@ from __future__ import annotations import os -import sys +import tomllib from pathlib import Path from typing import Any -if sys.version_info >= (3, 11): # pragma: no cover - import tomllib -else: # pragma: no cover - import tomli as tomllib - DEFAULT_CONFIG_NAMES: tuple[str, ...] = ("openbb.toml", ".openbb.toml") PYPROJECT_NAME = "pyproject.toml" PYPROJECT_TABLE: tuple[str, ...] = ("tool", "openbb-cli") diff --git a/cli/pyproject.toml b/cli/pyproject.toml index d4c5e523ef4..77bdc8ef8cc 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -14,7 +14,6 @@ dependencies = [ "openpyxl>=3.1.5,<4.0.0", "httpx>=0.28.0,<1.0.0", "pyyaml>=6.0", - "tomli>=2.0;python_version<'3.11'", ] [project.optional-dependencies] diff --git a/cli/tests/test_config_loader.py b/cli/tests/test_config_loader.py index 6ce7988e8e4..f7db14b99f7 100644 --- a/cli/tests/test_config_loader.py +++ b/cli/tests/test_config_loader.py @@ -213,10 +213,8 @@ def test_render_config_template_returns_valid_toml(): rendered = loader.render_config_template() # Strip the all-comment lines so tomllib has something to parse — even # an empty result is fine; the assertion is "no parse error". - if loader.sys.version_info >= (3, 11): - import tomllib - else: # pragma: no cover - import tomli as tomllib + import tomllib + tomllib.loads(rendered) diff --git a/cli/uv.lock b/cli/uv.lock index f90d8ab1f0a..288f774a404 100644 --- a/cli/uv.lock +++ b/cli/uv.lock @@ -6,13 +6,13 @@ resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and sys_platform == 'win32'", - "python_full_version == '3.12.*' and sys_platform == 'win32'", - "python_full_version < '3.12' and sys_platform == 'win32'", "python_full_version == '3.13.*' and sys_platform == 'emscripten'", - "python_full_version == '3.12.*' and sys_platform == 'emscripten'", - "python_full_version < '3.12' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'emscripten'", "python_full_version == '3.12.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.12' and sys_platform == 'win32'", + "python_full_version < '3.12' and sys_platform == 'emscripten'", "python_full_version < '3.12' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] @@ -1514,10 +1514,10 @@ resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and sys_platform == 'win32'", - "python_full_version == '3.12.*' and sys_platform == 'win32'", "python_full_version == '3.13.*' and sys_platform == 'emscripten'", - "python_full_version == '3.12.*' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'emscripten'", "python_full_version == '3.12.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] sdist = { url = "https://files.pythonhosted.org/packages/95/b0/c7453d0b6e2073c3264468b106ee1563750cecc910965e67357e3698c83e/numpy-2.5.4.tar.gz", hash = "sha256:9a94cf751c9ad8ebaa835bcd3d40dacf8534ad086b88c38029b65123c7999d2a", size = 20866315, upload-time = "2026-10-10T20:05:31.422Z" } @@ -1647,7 +1647,6 @@ requires-dist = [ { name = "pywry", marker = "extra == 'interactive'", specifier = ">=2.0.6" }, { name = "pyyaml", specifier = ">=6.0" }, { name = "rich", specifier = ">=14.0.0,<15.0.0" }, - { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0" }, ] provides-extras = ["charting", "interactive", "all"] @@ -2887,10 +2886,10 @@ resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.13.*' and sys_platform == 'win32'", - "python_full_version == '3.12.*' and sys_platform == 'win32'", "python_full_version == '3.13.*' and sys_platform == 'emscripten'", - "python_full_version == '3.12.*' and sys_platform == 'emscripten'", "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'win32'", + "python_full_version == '3.12.*' and sys_platform == 'emscripten'", "python_full_version == '3.12.*' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] dependencies = [ diff --git a/cookiecutter/tests/test_template.py b/cookiecutter/tests/test_template.py index 2c9897089d4..9caf64956c3 100644 --- a/cookiecutter/tests/test_template.py +++ b/cookiecutter/tests/test_template.py @@ -3,6 +3,7 @@ import shutil import subprocess import sys +import tomllib from pathlib import Path import pytest @@ -11,11 +12,6 @@ from cookiecutter.main import cookiecutter from openbb_cookiecutter import get_template_path -if sys.version_info >= (3, 11): - import tomllib -else: - import tomli as tomllib - PACKAGE = "extension_template" diff --git a/openbb_platform/core/integration/conftest.py b/openbb_platform/core/integration/conftest.py index df03b23ca28..e1a7af55457 100644 --- a/openbb_platform/core/integration/conftest.py +++ b/openbb_platform/core/integration/conftest.py @@ -44,7 +44,7 @@ PYPROJECT = """\ [project] name = "{ext_name}" version = "0.0.1" -requires-python = ">=3.10,<4" +requires-python = ">=3.11,<4" dependencies = ["openbb-core"] [project.entry-points."openbb_core_extension"] diff --git a/openbb_platform/core/openbb_core/app/config/loader.py b/openbb_platform/core/openbb_core/app/config/loader.py index 309aa9ea254..aa5003486a3 100644 --- a/openbb_platform/core/openbb_core/app/config/loader.py +++ b/openbb_platform/core/openbb_core/app/config/loader.py @@ -79,15 +79,10 @@ output for a fully documented version. from __future__ import annotations import os -import sys +import tomllib from pathlib import Path from typing import Any -if sys.version_info >= (3, 11): # pragma: no cover — version-conditional import - import tomllib -else: # pragma: no cover — exercised only on the 3.10 backport path - import tomli as tomllib - from openbb_core.app.constants import OPENBB_DIRECTORY DEFAULT_CONFIG_NAMES: tuple[str, ...] = ("openbb.toml", ".openbb.toml") diff --git a/openbb_platform/core/pyproject.toml b/openbb_platform/core/pyproject.toml index 30b8be8918e..e6e45a2085f 100644 --- a/openbb_platform/core/pyproject.toml +++ b/openbb_platform/core/pyproject.toml @@ -19,7 +19,6 @@ dependencies = [ "aiohttp>=3.14.2", "ruff>=0.15", "pyjwt>=2.13.0", - "tomli>=2.0.0; python_version<'3.11'", ] [project.optional-dependencies] diff --git a/openbb_platform/core/tests/app/charting/conftest.py b/openbb_platform/core/tests/app/charting/conftest.py index bb57c42a6e8..5cec3b8823e 100644 --- a/openbb_platform/core/tests/app/charting/conftest.py +++ b/openbb_platform/core/tests/app/charting/conftest.py @@ -137,7 +137,7 @@ ENGINE_METADATA = f"""\ Metadata-Version: 2.1 Name: {DIST_NAME} Version: {DIST_VERSION} -Requires-Python: >=3.10,<4 +Requires-Python: >=3.11,<4 Requires-Dist: openbb-core """ diff --git a/openbb_platform/core/uv.lock b/openbb_platform/core/uv.lock index 2c6611a9d82..cbbe941952d 100644 --- a/openbb_platform/core/uv.lock +++ b/openbb_platform/core/uv.lock @@ -6,13 +6,13 @@ resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", - "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'win32'", - "python_full_version < '3.11.5' and sys_platform == 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", - "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'emscripten'", - "python_full_version < '3.11.5' and sys_platform == 'emscripten'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'win32'", + "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'emscripten'", "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.11.5' and sys_platform == 'win32'", + "python_full_version < '3.11.5' and sys_platform == 'emscripten'", "python_full_version < '3.11.5' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] @@ -1532,10 +1532,10 @@ version = "2.4.6" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'win32'", - "python_full_version < '3.11.5' and sys_platform == 'win32'", "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'emscripten'", - "python_full_version < '3.11.5' and sys_platform == 'emscripten'", "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.11.5' and sys_platform == 'win32'", + "python_full_version < '3.11.5' and sys_platform == 'emscripten'", "python_full_version < '3.11.5' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } @@ -1747,7 +1747,6 @@ requires-dist = [ { name = "python-multipart", specifier = ">=0.0.29" }, { name = "requests", specifier = ">=2.34.2" }, { name = "ruff", specifier = ">=0.15" }, - { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0.0" }, { name = "uuid7", specifier = ">=0.1.0" }, { name = "uvicorn", specifier = ">=0.48.0" }, { name = "websockets", specifier = ">=15.0" }, @@ -2716,10 +2715,10 @@ resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", - "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", - "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'emscripten'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'win32'", + "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform == 'emscripten'", "python_full_version >= '3.11.5' and python_full_version < '3.12' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] sdist = { url = "https://files.pythonhosted.org/packages/5e/77/2dcfa996b01702ab8fd0763d84098f6a640d6162a328f1c04c2697579a1a/soupsieve-3.0.3.tar.gz", hash = "sha256:7dcf6022eed0399eb9934a75e020148f7a2024c37b7dfcd3cf2c5505d69c364e", size = 115923, upload-time = "2026-10-12T13:21:17.696Z" } diff --git a/openbb_platform/dev_install.py b/openbb_platform/dev_install.py index 4cfb69feb1a..71b112c49bb 100644 --- a/openbb_platform/dev_install.py +++ b/openbb_platform/dev_install.py @@ -9,6 +9,7 @@ import shutil import subprocess import sys import time +import tomllib from importlib.util import find_spec from pathlib import Path @@ -94,15 +95,6 @@ def load_toml(path: Path) -> dict: dict The parsed document. """ - if sys.version_info >= (3, 11): - import tomllib - else: - if find_spec("tomli") is None: - subprocess.run( - [*get_uv(), "pip", "install", "--python", sys.executable, "tomli>=2"], - check=True, - ) - import tomli as tomllib return tomllib.loads(path.read_text(encoding="utf-8")) diff --git a/openbb_platform/extensions/mcp_server/openbb_mcp_server/app/config.py b/openbb_platform/extensions/mcp_server/openbb_mcp_server/app/config.py index d88af5834dc..f65fb876af8 100644 --- a/openbb_platform/extensions/mcp_server/openbb_mcp_server/app/config.py +++ b/openbb_platform/extensions/mcp_server/openbb_mcp_server/app/config.py @@ -55,14 +55,9 @@ def resolve_explicit_config_path( def _validate_explicit_toml(explicit_path: str) -> None: """Pre-parse the user-supplied config so malformed TOML fails loudly.""" - import sys as _sys + import tomllib from pathlib import Path - if _sys.version_info >= (3, 11): # pragma: no cover - import tomllib - else: # pragma: no cover - import tomli as tomllib - p = Path(explicit_path) if not p.is_file(): return diff --git a/openbb_platform/extensions/mcp_server/pyproject.toml b/openbb_platform/extensions/mcp_server/pyproject.toml index b496c741cf7..a51323ffd92 100644 --- a/openbb_platform/extensions/mcp_server/pyproject.toml +++ b/openbb_platform/extensions/mcp_server/pyproject.toml @@ -10,7 +10,6 @@ dependencies = [ "openbb-core>=2.0.1", "fastapi>=0.138.2", "fastmcp>=4.0.9", - "tomli>=2.0;python_version<'3.11'", ] [project.optional-dependencies] diff --git a/openbb_platform/extensions/mcp_server/uv.lock b/openbb_platform/extensions/mcp_server/uv.lock index c1a49e0ce04..b6366e150cc 100644 --- a/openbb_platform/extensions/mcp_server/uv.lock +++ b/openbb_platform/extensions/mcp_server/uv.lock @@ -6,12 +6,12 @@ resolution-markers = [ "python_full_version >= '3.15' and sys_platform == 'emscripten'", "python_full_version >= '3.15' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.14.*' and sys_platform == 'emscripten'", - "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version == '3.14.*' and sys_platform != 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version < '3.12' and sys_platform == 'win32'", "python_full_version < '3.12' and sys_platform == 'emscripten'", - "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version < '3.12' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] @@ -1861,8 +1861,8 @@ resolution-markers = [ "python_full_version >= '3.15' and sys_platform == 'emscripten'", "python_full_version >= '3.15' and sys_platform != 'emscripten' and sys_platform != 'win32'", "python_full_version == '3.14.*' and sys_platform == 'emscripten'", - "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version == '3.14.*' and sys_platform != 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", ] @@ -2049,7 +2049,6 @@ requires-dist = [ { name = "fastmcp", specifier = ">=4.0.9" }, { name = "openbb-cli", marker = "extra == 'cli'", specifier = ">=2.0.1" }, { name = "openbb-core", specifier = ">=2.0.1" }, - { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0" }, ] provides-extras = ["cli"] diff --git a/openbb_platform/extensions/platform_api/openbb_platform_api/app/config.py b/openbb_platform/extensions/platform_api/openbb_platform_api/app/config.py index 436c8a41c52..6fe6a8e3425 100644 --- a/openbb_platform/extensions/platform_api/openbb_platform_api/app/config.py +++ b/openbb_platform/extensions/platform_api/openbb_platform_api/app/config.py @@ -127,14 +127,9 @@ def _validate_explicit_toml(explicit_path: str) -> None: Missing files are tolerated (cascade behavior) — only parse failures escalate. """ - import sys as _sys + import tomllib from pathlib import Path - if _sys.version_info >= (3, 11): # pragma: no cover — version-conditional - import tomllib - else: # pragma: no cover — exercised only on the 3.10 backport path - import tomli as tomllib # ty: ignore[unresolved-import] - p = Path(explicit_path) if not p.is_file(): return diff --git a/openbb_platform/extensions/platform_api/pyproject.toml b/openbb_platform/extensions/platform_api/pyproject.toml index 4efcc5f3297..005a4787cdc 100644 --- a/openbb_platform/extensions/platform_api/pyproject.toml +++ b/openbb_platform/extensions/platform_api/pyproject.toml @@ -9,8 +9,6 @@ requires-python = ">=3.11,<4" dependencies = [ "openbb-core>=2.0.1", "deepdiff>=8.6.2", - # Backport of stdlib ``tomllib`` for py3.10. - "tomli>=2.0;python_version<'3.11'", ] [project.scripts] diff --git a/openbb_platform/extensions/platform_api/uv.lock b/openbb_platform/extensions/platform_api/uv.lock index 70c8a6bb93f..ad671101f10 100644 --- a/openbb_platform/extensions/platform_api/uv.lock +++ b/openbb_platform/extensions/platform_api/uv.lock @@ -3,8 +3,8 @@ revision = 3 requires-python = ">=3.11, <4" resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'emscripten'", - "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.14' and sys_platform != 'emscripten'", + "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "(python_full_version < '3.14' and sys_platform != 'emscripten') or (python_full_version < '3.12' and sys_platform == 'emscripten')", ] @@ -1496,7 +1496,6 @@ dev = [ requires-dist = [ { name = "deepdiff", specifier = ">=8.6.2" }, { name = "openbb-core", specifier = ">=2.0.1" }, - { name = "tomli", marker = "python_full_version < '3.11'", specifier = ">=2.0" }, ] [package.metadata.requires-dev]