findpython icon indicating copy to clipboard operation
findpython copied to clipboard

fix(!windows): prevents mypy from complaining about findpython.pep514tools

Open Adirelle opened this issue 2 years ago • 1 comments

On non-windows platform, using mypy src/ or pre-commit run -a yields error on findpython.pep514tools because of the missing libraries winreg (or _winreg for python 2.7).

This PR fixes this parsing errors by checking sys.platform and sys.version_info in findpython.pep514tools either to import the right module or defines placeholders. mypy detects these tests and acts accordingly, cf. https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks.

Adirelle avatar Jul 17 '23 14:07 Adirelle

https://github.com/frostming/findpython/actions/runs/5577259406/job/15673230632?pr=23#step:5:136

src/findpython/providers/base.py:32: error: Name "t.Self" is not defined

I have already seen this error but I cannot remember how to fix it.

Adirelle avatar Aug 07 '23 13:08 Adirelle