Skip to content

[Feature] Retarget remaining 32 packages to Python 3.11 for ruff and ty - #7826

Open
isihussain wants to merge 9 commits into
openbq-org:developfrom
isihussain:chore/retarget-py311-monorepo
Open

isihussain wants to merge 9 commits into
openbq-org:developfrom
isihussain:chore/retarget-py311-monorepo

Conversation

@isihussain

Copy link
Copy Markdown
Contributor

Pull Request the OpenBB Platform

Description

  • Summary of the change / bug fix:
    • Completes the Python 3.10 deprecation follow-up noted as out-of-scope in [Feature] Drop Python 3.10 and Resolve Open Dependabot Alerts #7804.
    • Updates target-version = "py311" under [tool.ruff] and python-version = "3.11" under [tool.ty.environment] across the remaining 32 packages and project templates in openbb_platform/extensions, openbb_platform/providers, openbb_platform/obbject_extensions, and cookiecutter.
    • All 32 packages already declare requires-python = ">=3.11,<4" (bumped in [Feature] Drop Python 3.10 and Resolve Open Dependabot Alerts #7804); this aligns their linter and type-checker targets with the rest of the monorepo (matching core, cli, and root
      uff.toml).
  • Relevant motivation and context:
    Ensures consistent tooling configuration across all monorepo packages, enabling Python 3.11 ruff rules and ty type-checking across all extensions and providers.

How has this been tested?

  • Verified TOML syntax and configuration across all 32 modified pyproject.toml files.
  • Verified alignment with root
    uff.toml ( arget-version = "py311").

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have adhered to the GitFlow naming convention and my branch name is in the format of chore/chore-name.
  • I ensure that I am following the CONTRIBUTING guidelines.

@dlee-bq

dlee-bq commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, @isihussain. We missed one in the cli folder, cli/openbb_cli/codegen/project_gen.py:96 still generates target-version = "py310"

Additionally, we'll find that running ruff check --no-fix --target-version py311 per package reveals new violations - most of which can be fixed automatically.

@isihussain

Copy link
Copy Markdown
Contributor Author

Good catch, @dlee-bq! Updated cli/openbb_cli/codegen/project_gen.py:96 to target py311 as well in d8b9c9c.

Regarding the new violations revealed across packages under py311: would you prefer having those auto-fixed directly in this PR, or keeping this change scoped strictly to the configuration retargeting and addressing lint fixes in a follow-up PR? Happy to run --fix across the packages here if you'd like them bundled together!

@isihussain

Copy link
Copy Markdown
Contributor Author

Thanks for catching that, @dlee-bq! Updated cli/openbb_cli/codegen/project_gen.py to target py311 in d8b9c9c.

Regarding the new violations under py311: would you prefer I run ruff check --fix and push the automated fixes directly into this PR, or keep this PR strictly scoped to the retargeting configurations and follow up with the automated fixes in a dedicated PR to keep the diff clean? Happy to do whichever workflow you prefer!

@dlee-bq

dlee-bq commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching that, @dlee-bq! Updated cli/openbb_cli/codegen/project_gen.py to target py311 in d8b9c9c.

Regarding the new violations under py311: would you prefer I run ruff check --fix and push the automated fixes directly into this PR, or keep this PR strictly scoped to the retargeting configurations and follow up with the automated fixes in a dedicated PR to keep the diff clean? Happy to do whichever workflow you prefer!

We should do the full task here in this PR, no sense in putting it off.

@isihussain

Copy link
Copy Markdown
Contributor Author

Understood! Working on running ruff check --fix --target-version py311 across all monorepo packages now and will push the automated fixes directly into this PR.

dlee-bq and others added 2 commits November 13, 2026 18:57
- Fix UP017 violations replacing timezone.utc with datetime.UTC across providers and extensions
- Fix UP041 violations replacing asyncio.TimeoutError with builtin TimeoutError
- Resolve SIM102 nested if statements in openbb_sec financials and non-xbrl parser
- Verify all 36 packages pass ruff check --target-version py311 with 0 errors
@isihussain

Copy link
Copy Markdown
Contributor Author

Ran ruff check --fix --target-version py311 across all monorepo packages.

Pushed the fixes in commit 8f272ec:

  • Converted timezone.utc references to datetime.UTC (UP017) across 53 files in extensions and providers.
  • Replaced asyncio.TimeoutError with builtin TimeoutError (UP041).
  • Combined nested if statements (SIM102) in openbb_sec/models/sec_financials.py and openbb_sec/utils/non_xbrl_parser.py.
  • Verified all 36 packages pass ruff check --target-version py311 with zero errors.

@dlee-bq

dlee-bq commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Thanks, @isihussain. Let's take a look at the TY rule name changes:

warning[renamed-rule]: Rule `unresolved-import` has been renamed to `import-not-found`
  --> pyproject.toml:96:1
   |
96 | unresolved-import = "ignore"
   | ^^^^^^^^^^^^^^^^^

Found 1 diagnostic

@isihussain

Copy link
Copy Markdown
Contributor Author

Renamed unresolved-import to import-not-found across ty.toml and all 34 package pyproject.toml configurations in commit 7b03f40. This resolves the TY diagnostic warning.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants