Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DEV: Add name-tests-test to pre-commit hooks#23213

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

matthewfeickert
Copy link
Contributor

@matthewfeickertmatthewfeickert commentedJun 7, 2022
edited
Loading

PR Summary

Add the'name-tests-test' pre-commit hook which verifies that test files underlib/matplotlib/tests/ conform topytest naming conventions. Use the--django option to match thetest*.py naming convention.

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (andpytest passes).
  • [N/A] IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@matthewfeickert
Copy link
ContributorAuthor

matthewfeickert commentedJun 7, 2022
edited
Loading

@greglucas Given that wediscussed this on Gitter, this is ready for review as pre-commit.ci is passing. Also

$pre-commit run name-tests-test --all-filespython tests naming......................................................Passed

Obviously no rush here, and I'm very happy to explain any questions that anyone might have. 👍

@jklymak
Copy link
Member

If we are going to keep adding to pre-commit, then we need to ask everyone to run pre-commit locally before pushing to CI, which I don't believe we currently do in the dev guide.

@matthewfeickert
Copy link
ContributorAuthor

matthewfeickert commentedJun 7, 2022
edited
Loading

If we are going to keep adding to pre-commit, then we need to ask everyone to run pre-commit locally before pushing to CI, which I don't believe we currently do in the dev guide.

@jklymak I thought that part of the resolution from the discussions starting at#22777 (comment) (most of it linked up for reference here in Issue#22949) was that having pre-commmit.ci turned on wouldn't require everyone to use pre-commit locally if they didn't want to as it would fail out (quickly) with decently explicit logs. While I'm coming fromthe cultural view that wanting people to use pre-commit locally is a good idea, I believe that the matplotlib dev team consensus was that pre-commit should not be a required part of the dev environment to avoid any barriers to contribution (thought I can't find a reference for this at the moment easily, so I'll defer to you here).

So, while I certainly don't mind editing the dev guide to recommend this, I believe this isn't/wasn't desired. Or are you just suggesting that pre-commit be listed as an optional but recommended dependency in theAdditional dependencies for development section of the dev guide (it currently is not)?

@oscargus
Copy link
Member

Should one make running the rest of the tests dependent on pre-commit passing?

@matthewfeickert
Copy link
ContributorAuthor

matthewfeickert commentedJun 7, 2022
edited
Loading

Should one make running the rest of the tests dependent on pre-commit passing?

While it is possible with GitHub Actions to depend on the completion of another workflow with theworkflow_run event I personally don't know how easily/if it can be done for an arbitrary webhook.

The additional complexity that it would add to the CI maintenance is also maybe not worth it when you could just throw in aconcurrency block so that a follow up push (from the correction that pre-commit found) automatically cancels the previous running job (if there is one).

@oscargus
Copy link
Member

No, I do not know either. Not even sure if one can make it depend on e.g. linting which is in a separate file (without moving it to the same).

I think it cancels now (as I quite often to follow-up pushes and try to get quite a few emails that something was cancelled), but if there is a better way one should probably look into that (and confirm that it does cancel now).

@matthewfeickert
Copy link
ContributorAuthor

I think it cancels now (as I quite often to follow-up pushes and try to get quite a few emails that something was cancelled), but if there is a better way one should probably look into that (and confirm that it does cancel now).

Ah yeah, you're right.

concurrency:
group:${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress:true

got added in PR#22919 (:rocket:) which is great.

oscargus reacted with thumbs up emoji

@matthewfeickertmatthewfeickertforce-pushed thedev/add-name-tests-test-to-pre-commit branch 3 times, most recently from23cd6d4 to547819dCompareJune 14, 2022 01:16
@matthewfeickert
Copy link
ContributorAuthor

@jklymak gentle ping to see if you have follow up thoughts/clarification on recommendations on pre-commit checks.

@jklymak
Copy link
Member

Sorry, I'm neutral on this - but I did install the hooks locally so I stop pushing bad commits 😄

matthewfeickert reacted with thumbs up emoji

@matthewfeickert
Copy link
ContributorAuthor

Sorry, I'm neutral on this

Cool. :) Do you have anything that you'd like to see added to this PR then?

but I did install the hooks locally so I stop pushing bad commits smile

👍 I hope that you are finding the experience okay and hopefully nice. If you have feedback on your experience of installing the hooks and getting going I would be very happy to try to incorporate that as suggested recommendations into the developer docs if that's viewed as helpful.

@jklymak
Copy link
Member

Installing it was fine. Its just one more thing to install, that's all, and I work on different machines, so I tend to be resistant to too many "extras"

@matthewfeickertmatthewfeickertforce-pushed thedev/add-name-tests-test-to-pre-commit branch 4 times, most recently from2561ef3 to00983baCompareJune 16, 2022 17:50
* Add the 'name-tests-test' pre-commit hook which verifies that test filesunder lib/matplotlib/tests/ conform to pytest naming conventions.   - Use the '--django' option to match the 'test*.py' naming convention.
@matthewfeickertmatthewfeickertforce-pushed thedev/add-name-tests-test-to-pre-commit branch from00983ba toade569eCompareJune 17, 2022 00:52
@tacaswelltacaswell added this to thev3.6.0 milestoneJun 17, 2022
@tacaswelltacaswell merged commit0fe4b08 intomatplotlib:mainJun 17, 2022
@matthewfeickertmatthewfeickert deleted the dev/add-name-tests-test-to-pre-commit branchJune 17, 2022 02:48
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

5 participants
@matthewfeickert@jklymak@oscargus@greglucas@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp