Skip to content

Optionally run tests with mypy nightly #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 17, 2023
Merged

Conversation

twoertwein
Copy link
Member

Add an option to easily test the stubs with mypy nightly. Might be important to do that whenever mypy is close to a new release (especially if mypy advertises pandas-stubs, see python/mypy#14328).

Mypy nightly reports two unused ignores, so I didn't enable it on the CI.

poe --help:
image

@twoertwein
Copy link
Member Author

Enabled mypy nightly on the CI by disabling unused ignore errors.

@twoertwein twoertwein changed the title Optionally run test with mypy nightly Optionally run tests with mypy nightly Jan 17, 2023
@twoertwein twoertwein requested a review from Dr-Irv January 17, 2023 03:11
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

I'm OK with this, but I think we should add something to the documentation section about how we are handling the failures in the nightly and mypy-nightly CI runs.

My feeling is that if we have failures on either, we would still accept a PR, i.e., we are not expecting someone creating a PR for pandas-stubs that makes changes to the stubs to worry about the CI failing with those 2 jobs.

So can you add something to https://github.com/pandas-dev/pandas-stubs/blob/main/docs/tests.md about this new option, and also a paragraph related to what I wrote above?


# ignore unused ignore errors
config_file = Path("pyproject.toml")
config_file.write_text(
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 don't really like changing pyproject.toml. I'll see whether there is a better way.

I'm also open to not run it on the CI - if there are errors that cannot be resolved by warn_unused_ignores, it would be quite annoying to get a failed email for each PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't really like changing pyproject.toml. I'll see whether there is a better way.

We could put the options used for the nightly tests in a mypy_nightly.ini file and then do nightly with the mypy option --config-file mypy_nightly.ini . Then this allows us to turn off/on different options for the nightly.

I'm also open to not run it on the CI - if there are errors that cannot be resolved by warn_unused_ignores, it would be quite annoying to get a failed email for each PR.

If we use a special config file, then we just have to modify that config file

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jan 17, 2023

Thanks @twoertwein

@Dr-Irv Dr-Irv merged commit 2dfe36f into pandas-dev:main Jan 17, 2023
twoertwein added a commit to twoertwein/pandas-stubs that referenced this pull request Apr 1, 2023
* CI: option to use mypy nightly

* update pre-commit

* skip ignores to run on CI

* docs
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