Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option of running stubtest using tox #27618

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Jan 9, 2024

This gives developers the option of running stubtests using tox. This is useful, because the stubtests can't be run on local editable installs (see #27580).

I've added a test commit that breaks stubtest deliberately to show this works - I will leave this here for review purposes, then force push it away once this has one approved review.

I can't get this to give me a true negative result locally though 馃槩 . With the below diff (saved, but unstaged in git), running tox -e stubtest still gives me a successful result. I'll investigate a bit further, but I don't suppose anyone has any ideas?

Fixes #27580.

PR summary

PR checklist

@dstansby dstansby changed the title Stubtest tox Add option of running stubtest using tox Jan 9, 2024
@dstansby dstansby added this to the v3.9.0 milestone Jan 9, 2024
@QuLogic
Copy link
Member

QuLogic commented Jan 10, 2024

I tried modifying tools/stubtest.py to use installed sources, but it also didn't seem to complain about issues, which is odd. It definitely complains on CI.

@dstansby
Copy link
Member Author

It looks like I added an error that stubest doesn't check for. I've go tox/stubtest working now, just need to fix reviewdog.

@dstansby
Copy link
Member Author

Fab, this seems to be working now

@dstansby dstansby marked this pull request as ready for review January 10, 2024 13:52
@dstansby dstansby requested a review from ksunden January 10, 2024 13:52
pip3 install -r requirements/testing/mypy.txt \
-r requirements/testing/all.txt
pip3 install .
python-version: 3.11
Copy link
Member

Choose a reason for hiding this comment

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

I think we do want to run on the oldest supported python version to avoid accidentally allowing typing features that were introduced more recently.

Copy link
Member Author

Choose a reason for hiding this comment

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

馃憤 done

@@ -40,6 +40,10 @@
}


def new_func(x):
Copy link
Member

Choose a reason for hiding this comment

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

This test func should be removed, it did error on CI.

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 removed the commit with this in

Co-authored-by: Kyle Sunden <git@ksunden.space>
@QuLogic QuLogic merged commit fd332aa into matplotlib:main Jan 16, 2024
41 of 42 checks passed
@dstansby dstansby deleted the stubtest-tox branch January 17, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Running stubtest locally fails
3 participants