Add py.typed marker for PEP 561 support (#151)#153
Add py.typed marker for PEP 561 support (#151)#153asukaminato0721 merged 2 commits intoopen-spaced-repetition:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
==========================================
- Coverage 98.62% 97.73% -0.90%
==========================================
Files 7 7
Lines 653 661 +8
==========================================
+ Hits 644 646 +2
- Misses 9 15 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It hasn't passed the ci. |
|
https://pytorch.org/blog/pyrefly-now-type-checks-pytorch/ so actually I recommend pyrefly ( |
Hi! Fixed — ty 0.0.17 reclassified union attribute access from possibly-missing-attribute, so the ignore directives needed updating. Pushed the fix, CI needs approval to run. |
I can give pyrefly a try. Happy to fix them and switch to pyrefly in this PR if you'd like, or we can leave that for #149. |
|
try switch, let's see the results. Since for now too many ignore |
- Replace ty with pyrefly in dev deps, CI workflow, and pyproject config - Add @overload on _clamp_difficulty/_clamp_stability for proper float/Tensor typing - Replace isinstance(x, Real) with isinstance(x, (int, float)) for pyrefly narrowing - Add wildcard match branches for exhaustive pattern checking - Remove all type ignore comments (0 errors, 0 suppressed)
Hi! I've pushed the transition from ty to pyrefly now. Eliminates all 4 ignore comments. Code changes in fsrs/scheduler.py:
Code changes in pyproject.toml:
Code changes in .github/workflows/type-check.yml:
|
let me try to reproduce it. so pyrefly can prove exhaustiveness. Edit: (oh I got this, it's another issue). |
sorry I found the problem, could you drop my two commits. And we will merge this. |
a3804a6
Thanks for the approval! |
|
Could you update the version here? Line 7 in a3804a6 The new release depends on this version number. |
Add PEP 561 py.typed marker file so type checkers (pyright/pylance) recognize the package as typed
Configure pyproject.toml to include py.typed in the distribution
Closes #151