cookie icon indicating copy to clipboard operation
cookie copied to clipboard

sp_repo_review: false positive and false negative mypy checks

Open Saransh-cpp opened this issue 1 year ago • 3 comments

The MY101 and MY102 have been passing and failing (respectively) on the develop branch of PyBaMM, but it should be the other way.

Running sp_repo_review: https://learn.scientific-python.org/development/guides/repo-review/?repo=pybamm-team%2FPyBaMM&branch=develop

Actual mypy config: https://github.com/pybamm-team/PyBaMM/blob/94aa498176d0b6bb1186aa63bebd9c85f7b74bff/pyproject.toml#L272-L282

I noticed that running the develop version of sp_repo_review and repo_review does not give these false results. Please feel free to close this if this has been fixed but has not been released. Thanks!

Saransh-cpp avatar Feb 29 '24 15:02 Saransh-cpp

Just started a new release. Could you see if it still persists?

henryiii avatar Mar 11 '24 02:03 henryiii

Thank you! But, I still see the same results for some reason.

Saransh-cpp avatar Mar 11 '24 15:03 Saransh-cpp

I'm not sure what's wrong with these checks in WebAssembly, but they aren't working correctly (only in WebAssembly).

Running them manually in the pyodide terminal seems fine.

henryiii avatar May 04 '24 12:05 henryiii

Likewise, the MY102 failure on abravalheri/validate-pyproject looks like a false positive:

https://learn.scientific-python.org/development/guides/repo-review/?repo=abravalheri%2Fvalidate-pyproject&branch=main

validate-pyproject/pyproject.toml Lines 10 to 19 in e1aa946

[tool.mypy]
show_traceback = true
strict = true
# Scaling back on some of the strictness for now
disallow_any_generics = false
disallow_subclassing_any = false

[[tool.mypy.overrides]]
module = ["fastjsonschema"]
ignore_missing_imports = true

DimitriPapadopoulos avatar Aug 07 '24 09:08 DimitriPapadopoulos

I think I've finally made a little progress: I've seen this on a local repo. This shows no failures on boost-histogram (local branch with changes to make it pass):

uvx --with sp-repo-review[cli] repo-review .

But this shows MY102 failing:

uvx --with sp-repo-review[cli] --with validate-pyproject-schema-store[all] repo-review .

So there's some sort of interaction between checks going on here.

henryiii avatar Aug 23 '24 20:08 henryiii

0.11.2 is out and this now produces a warning and then self-corrects! This fix is live on the WebAssembly version due to the fact it's a patch release.

henryiii avatar Aug 24 '24 03:08 henryiii

https://github.com/abravalheri/validate-pyproject/issues/197 proposes fixing the warning.

henryiii avatar Aug 24 '24 03:08 henryiii