Files
OpenBB/openbb_platform/providers/imf/pyproject.toml
dlee-bq 7f04334398 - example.py: mark the base Example.scope field frozen so the (#7798)
Literal[api]/Literal[python] subclass overrides are covariant
  read-only narrowings. Subclass fields stay writable at runtime.
- method_definition.py, options_chains.py: pydantic 2.14 types
  FieldInfo.annotation as TypeForm[Any] | None, which ty rejects in
  Union[]/Annotated[] and where  is expected; bind it as Any.
  Use FieldInfo.get_default(call_default_factory=True) instead of
  calling the default_factory union directly.
- economy_views.py: read data/obbject_item without None defaults in the
  IMF shipping views. charting always sets obbject_item, and data is
  only popped when present and not None.- finra, jodi, eia: annotate @asynccontextmanager/@contextmanager
  functions with AsyncGenerator/Generator instead of the deprecated
  AsyncIterator/Iterator return types.
- charting: cast the darts forecast dataset to TimeSeries before
  indexing so .all_values resolves instead of hitting ndarray.
- fred, imf, nasdaq, sec, tmx: turn off invalid-attribute-override and
  invalid-mutable-override for models/** only, following the cboe
  precedent. Provider models extend the standard models by narrowing
  query params to Literals or widening fields to Optional, which these
  rules flag by design.

Co-authored-by: dlee-bq <325002271+dlee-bq@users.noreply.github.com>
2026-10-17 20:50:39 +00:00

136 lines
4.5 KiB
TOML
Vendored

[project]
name = "openbb-imf"
version = "3.0.0"
description = "IMF provider extension for OpenBB Platform."
authors = [{ name = "OpenBB Team", email = "hello@openbb.co" }]
license = { text = "Apache-2.0" }
readme = "README.md"
requires-python = ">=3.10,<4"
dependencies = [
"openbb-core[pandas]>=2.0.0",
"requests>=2.31",
"async-lru>=2",
"defusedxml>=0.7.1",
]
[project.optional-dependencies]
charting = ["openbb-charting>=4.0.0"]
[project.scripts]
generate-imf-cache = "openbb_imf.utils.generate_cache:main"
[project.entry-points."openbb_provider_extension"]
imf = "openbb_imf:imf_provider"
[project.entry-points."openbb_core_extension"]
imf = "openbb_imf.imf_router:router"
[project.entry-points."openbb_charting_extension"]
imf = "openbb_imf.imf_views:ImfViews"
[project.urls]
Homepage = "https://openbb.co"
Repository = "https://github.com/OpenBB-finance/OpenBB"
[dependency-groups]
dev = ["openbb-devtools>=2.0.1"]
[build-system]
requires = ["hatchling>=1.25", "requests>=2.31"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["openbb_imf"]
[tool.hatch.build.targets.sdist]
# The cache asset is gitignored; the build hook materializes it before
# packaging so both sdist and wheel ship a self-contained artifact.
include = [
"openbb_imf",
"openbb_imf/assets/imf_cache.json.xz",
"hatch_build.py",
"README.md",
"pyproject.toml",
]
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"
[tool.ruff]
line-length = 88
target-version = "py310"
fix = true
[tool.ruff.lint]
select = ["D", "E", "W", "F", "S", "UP", "I", "PLC", "PLE", "PLR", "PLW", "SIM", "T20"]
ignore = [
"PLR2004", "PLR0913", "PLR0915", "PLR0917", "PLC0415",
"E402", "E501",
"D202", "D203", "D205", "D206", "D210", "D212", "D213", "D214",
"D215", "D300", "D400", "D404", "D405", "D406", "D407", "D408",
"D409", "D410", "D411", "D413", "D415", "D416", "D417",
]
[tool.ruff.lint.per-file-ignores]
"openbb_imf/imf_router.py" = ["ARG001", "PLC0415", "SLF001", "PLR0911", "PLR0912", "PLR0913", "PLR0914", "PLR0915", "PLR0917"]
"openbb_imf/utils/generate_cache.py" = ["T201", "PLR0912", "PLR0914", "PLR0915", "PLR0917", "BLE001", "S112", "S113"]
"openbb_imf/utils/helpers.py" = ["PLR0912"]
"openbb_imf/utils/metadata/_query_mixin.py" = ["PLR0911", "PLR0912", "PLR0913", "PLR0914", "PLR0915", "PLR0917", "SLF001"]
"openbb_imf/utils/metadata/_table_mixin.py" = ["PLR0911", "PLR0912", "PLR0914", "PLR0915", "PLR0917", "SLF001", "BLE001", "S112", "B023"]
"openbb_imf/utils/metadata/_search_mixin.py" = ["PLR0912", "BLE001", "S112"]
"openbb_imf/utils/metadata/_indicator_mixin.py" = ["PLR0912", "BLE001"]
"openbb_imf/utils/metadata/_loader_mixin.py" = ["BLE001"]
"openbb_imf/utils/query_builder.py" = ["PLR0911", "PLR0912", "PLR0913", "PLR0917", "SLF001"]
"openbb_imf/utils/table_builder.py" = ["PLR0912", "PLR0913", "PLR0914", "PLR0915", "PLR0917", "SLF001", "B023"]
"openbb_imf/utils/progressive_helper.py" = ["PLR0912"]
"openbb_imf/utils/dot_helpers.py" = ["PLR0912"]
"openbb_imf/utils/port_watch_helpers.py" = ["PLR0912"]
"openbb_imf/utils/table_presentation.py" = ["PLR0911", "PLR0912", "PLR0914", "PLR0915"]
"openbb_imf/models/*.py" = ["ARG002", "PLC0415", "PLR0912"]
"openbb_imf/views/*.py" = ["PLR0912", "T201"]
"tests/**" = ["S101", "S108", "D", "SIM105", "SIM117"]
"integration/**" = ["S101", "S108", "D", "SIM105", "SIM117", "PLC0415", "ARG001"]
"**/__init__.py" = ["F401"]
[tool.ruff.lint.isort]
combine-as-imports = true
force-wrap-aliases = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ty]
[tool.ty.environment]
python-version = "3.10"
[tool.ty.src]
include = ["openbb_imf"]
exclude = ["tests", "integration", "openbb_imf/utils/generate_cache.py"]
[tool.ty.rules]
unresolved-import = "ignore"
[[tool.ty.overrides]]
include = ["openbb_imf/models/**"]
[tool.ty.overrides.rules]
invalid-attribute-override = "ignore"
invalid-mutable-override = "ignore"
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q --strict-markers"
markers = [
"record_http: VCR-backed HTTP cassette tests",
"integration: live integration tests against the IMF API",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning:openbb_core.provider.utils.client",
"ignore::async_lru.AlruCacheLoopResetWarning",
# Plotly and asyncio leak unclosed UNIX sockets / event loops on import
# in older Python; pytest's ``PytestUnraisableExceptionWarning`` turns
# those teardown traces into failures on whichever test runs next.
"ignore::pytest.PytestUnraisableExceptionWarning",
]