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

Appearance settings

Make it easier to run pre-commit hooks #549

Copy link
Copy link
@hombit

Description

@hombit
Issue body actions

Currently "jupyter-nb-clear-output", "pylint", "mypy" (see also #531), "sphinx-build", and "pytest" pre-commit hooks assume that a Python environment with numerous Python executables is activated. It causes two sorts of problems: 1) CI and local versions of packages may be different, making runs inconsistent, and 2) in some cases, it is tricky to have the right environment active when git commit is being run, e.g., in an IDE, or when using uv-based setup without an active environment (i.e., via uv run pytest instead of python -m pytest, etc.).

It is a multi-factor problem, and maybe a solution is excluding some slow and environment-dependent hooks, such as pytest and sphinx-build, entirely, while switching to pre-commit-controlled environments for things like jupyter-nb-clear-output, pylint, and mypy.

This is based on observations of the problems people have in the team and external users: a lot of people do not run pre-commit because it is slow, or because of mypy's inconsistent behavior, or because they didn't install Sphinx dependencies and sphinx-build fails even if they haven't touched any code or documentation.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.