Skip to content

Refactor pyproject.toml and cleanup pyright restrictions#1770

Closed
mhusnain-tech wants to merge 1 commit intosbi-dev:mainfrom
mhusnain-tech:patch-1
Closed

Refactor pyproject.toml and cleanup pyright restrictions#1770
mhusnain-tech wants to merge 1 commit intosbi-dev:mainfrom
mhusnain-tech:patch-1

Conversation

@mhusnain-tech
Copy link

This PR updates the pyproject.toml to align with recent changes in the repository. Main changes include:

  • Cleaned up Pyright configuration by removing redundant 'false' flags for torch-related issues.
  • Updated project metadata and classifiers for better consistency.
  • Standardized dependency formatting.

This follows the work initiated in PR #1768 to handle Torch 2.5+ type-stub issues more cleanly.

This PR updates the pyproject.toml to align with recent changes in the repository. 
Main changes include:
- Cleaned up Pyright configuration by removing redundant 'false' flags for torch-related issues.
- Updated project metadata and classifiers for better consistency.
- Standardized dependency formatting.

This follows the work initiated in PR sbi-dev#1768 to handle Torch 2.5+ type-stub issues more cleanly.
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b546366). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1770   +/-   ##
=======================================
  Coverage        ?   86.75%           
=======================================
  Files           ?      141           
  Lines           ?    12317           
  Branches        ?        0           
=======================================
  Hits            ?    10685           
  Misses          ?     1632           
  Partials        ?        0           
Flag Coverage Δ
fast 83.30% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

@manuelgloeckler
Copy link
Contributor

Hey @mhusnain-tech ,

thanks for the suggestions. Yet, as visible in the CI. The current flags are necessary for newer torch versions.

This is due to errors like /home/runner/work/sbi/sbi/sbi/inference/trainers/npe/npe_c.py:289:32 - error: Operator "-" not supported for types "Tensor" and "Tensor | Module" appearing from mathematical operations with e.g. buffers. This is due to new torch stubs for type hints. Sure, some of these errors are indeed incomplete/imprecise typing on our end, but many are due to external imprecise typing which we cannot influence.

If you have expertise in pyright and know a better solution than the current one, open for any suggestions. But otherwise I would close this PR.

@manuelgloeckler
Copy link
Contributor

Closing, as seemingly moved to #1773

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