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's meta checks missing dependencies #270805

Closed
l0b0 opened this issue Nov 29, 2023 · 0 comments · Fixed by #306444
Closed

pre-commit's meta checks missing dependencies #270805

l0b0 opened this issue Nov 29, 2023 · 0 comments · Fixed by #306444
Labels
0.kind: bug Something is broken

Comments

@l0b0
Copy link
Contributor

l0b0 commented Nov 29, 2023

Describe the bug

nix-shell --pure --run 'pre-commit run --all-files' fails with this message after moving from the nixos-23.05 channel to nixos-unstable:

Check hooks apply to the repository......................................Failed
- hook id: check-hooks-apply
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/nix/store/8icgy8r45srni7mqmh4ykj0m8d46c4z0-pre-commit-3.3.3/lib/python3.11/site-packages/pre_commit/meta_hooks/check_hooks_apply.py", line 7, in <module>
    from pre_commit import git
  File "/nix/store/8icgy8r45srni7mqmh4ykj0m8d46c4z0-pre-commit-3.3.3/lib/python3.11/site-packages/pre_commit/git.py", line 9, in <module>
    from pre_commit.util import CalledProcessError
  File "/nix/store/8icgy8r45srni7mqmh4ykj0m8d46c4z0-pre-commit-3.3.3/lib/python3.11/site-packages/pre_commit/util.py", line 16, in <module>
    from pre_commit import parse_shebang
  File "/nix/store/8icgy8r45srni7mqmh4ykj0m8d46c4z0-pre-commit-3.3.3/lib/python3.11/site-packages/pre_commit/parse_shebang.py", line 7, in <module>
    from identify.identify import parse_shebang_from_file
ModuleNotFoundError: No module named 'identify'

Check for useless excludes...............................................Failed
- hook id: check-useless-excludes
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/nix/store/8icgy8r45srni7mqmh4ykj0m8d46c4z0-pre-commit-3.3.3/lib/python3.11/site-packages/pre_commit/meta_hooks/check_useless_excludes.py", line 7, in <module>
    from cfgv import apply_defaults
ModuleNotFoundError: No module named 'cfgv'

Looks like missing runtime dependencies, but based on this it could possibly be a deeper problem?

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable the check-hooks-apply and check-useless-excludes pre-commit "meta" hooks
  2. Switch to nixpkgs 5a09cb4
  3. Run pre-commit run --all-files

Expected behavior

This should run successfully, same as before the nixpkgs bump.

Notify maintainers

@borisbabic

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.1.63, NixOS, 23.05 (Stoat), 23.05.4969.1216a5ba22a9
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.13.6
  • channels(root): "nixos-23.05, nixos-hardware"
  • channels(username): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Priorities

Add a 👍 reaction to issues you find important.

@l0b0 l0b0 added the 0.kind: bug Something is broken label Nov 29, 2023
@l0b0 l0b0 changed the title pre-commit's check-useless-excludes can't find cfgv pre-commit's meta checks missing dependencies Dec 2, 2023
l0b0 added a commit to linz/emergency-management-tools that referenced this issue Feb 20, 2024
Also comment out broken pre-commit meta hook
<NixOS/nixpkgs#270805>.
l0b0 added a commit to linz/emergency-management-tools that referenced this issue Feb 20, 2024
Also comment out broken pre-commit meta hook
<NixOS/nixpkgs#270805>.
l0b0 added a commit to linz/emergency-management-tools that referenced this issue Feb 27, 2024
Also comment out broken pre-commit meta hook
<NixOS/nixpkgs#270805>.
@l0b0 l0b0 mentioned this issue Apr 24, 2024
13 tasks
l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 13, 2024
Also comment out broken pre-commit hooks
<NixOS/nixpkgs#270805>,
<NixOS/nixpkgs#273831>.
l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 13, 2024
Also comment out broken pre-commit hooks
<NixOS/nixpkgs#270805>,
<NixOS/nixpkgs#273831>.
l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 14, 2024
Also comment out broken pre-commit hooks
<NixOS/nixpkgs#270805>,
<NixOS/nixpkgs#273831>.
l0b0 added a commit to l0b0/nixpkgs that referenced this issue Oct 10, 2024
Closes NixOS#270805 by verifying that NixOS#251418 fixes the issue.
l0b0 added a commit to l0b0/nixpkgs that referenced this issue Nov 22, 2024
Closes NixOS#270805 by verifying that NixOS#251418 fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant