Skip to content

Conversation

@jl-wynen
Copy link
Member

@jl-wynen jl-wynen commented Jul 8, 2024

This run mypy in PR builds and on main. It excludes a large number of files which have not been fixed to pass type checks yet. But these tests should prevent backsliding in files that have already been updated.

The mypy run is part of the same job as other tests because it requires the C++ package to be built. We may ultimately want to split it off. This could, e.g., be achieved by uploading the binary as an artefact.

JUPYTER_PLATFORM_DIRS = 1
PYTHONWARNDEFAULTENCODING = 1
commands = python -m pytest -n auto -v {posargs:tests}
commands = python -X PYTHONWARNDEFAULTENCODING -m pytest -n auto -v {posargs:tests}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this because mypy raises encoding warnings when the env var is set. See also #3154

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does mypy raise encoding warnings when the env var is set? 🤔

Copy link
Contributor

@jokasimr jokasimr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Left a few questions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the renames for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were several files in different directories that have the same name. Mypy does not like this because it treats every file as a Python module and those need to be unique.

JUPYTER_PLATFORM_DIRS = 1
PYTHONWARNDEFAULTENCODING = 1
commands = python -m pytest -n auto -v {posargs:tests}
commands = python -X PYTHONWARNDEFAULTENCODING -m pytest -n auto -v {posargs:tests}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does mypy raise encoding warnings when the env var is set? 🤔

@jokasimr jokasimr self-assigned this Jul 9, 2024
@jl-wynen
Copy link
Member Author

jl-wynen commented Jul 9, 2024

Why does mypy raise encoding warnings when the env var is set? 🤔

I don't know. All I could find is this: python/mypy#17057 and this: realpython/pytest-mypy#152 But they relate to pypy and pytest-mypy which we don't use.

@jl-wynen jl-wynen enabled auto-merge July 9, 2024 11:36
@jl-wynen jl-wynen merged commit 12976fe into main Jul 9, 2024
@jl-wynen jl-wynen deleted the appease-mypy branch July 9, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants