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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit-hooks is not needed to run tests using tox #15530

Closed
mtelka opened this issue Jun 27, 2023 · 2 comments
Closed

pre-commit-hooks is not needed to run tests using tox #15530

mtelka opened this issue Jun 27, 2023 · 2 comments
Labels
bug mypy got something wrong topic-tests

Comments

@mtelka
Copy link
Contributor

mtelka commented Jun 27, 2023

Bug Report

The tox.ini file specifies via the test-requirements.txt file that pre-commit-hooks is needed to run tests, but that's not the case for testing invoked using the tox command.

To Reproduce

Run tox without the pre-commit-hooks installed and all tests will pass.

Expected Behavior

pre-commit-hooks is not listed as dependency for tox testing.

Actual Behavior

pre-commit-hooks is needed for tox testing.

Your Environment

  • Mypy version used: 1.4.1
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: N/A
@mtelka mtelka added the bug mypy got something wrong label Jun 27, 2023
@AlexWaygood
Copy link
Member

It's not required to run the tests, no, but it's included in case contributors want to manually run any of the hooks locally, e.g. by invoking trailing-whitespace some_file_i_changed.test. Does it cause any problems for it to be included in test-requirements.txt?

@mtelka
Copy link
Contributor Author

mtelka commented Jun 27, 2023

I'm packaging mypy for OpenIndiana and during packaging we run tests. Usually using tox. To be able to do that we need to satisfy testing dependencies listed in tox.ini. In this case we either need the pre-commit-hooks package installed (we do not have pre-commit-hooks packaged yet for OpenIndiana), or patch it out from test-requirements.txt (we do this). This creates small maintenance burden, but not a big deal. The removal of pre-commit-hooks from test-requirements.txt would allow us to drop a patch from our build recipe. Not critical, just nice to have improvement for us. Thank you.

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-tests
Projects
None yet
Development

No branches or pull requests

2 participants