Skip to content

[BUG] lint-salt/lint-tests pre-commit hooks broken on macOS #69932

Closed

Description

@BrianHa94

Summary

The lint-salt/lint-tests pre-commit hooks fail outright on macOS.
Digging into why surfaced three separate, stacked problems.

1. _lint() hardcodes linux.lock regardless of host OS

noxfile.py's _lint() helper builds its base requirements path directly
as requirements/static/ci/<pydir>/linux.lock, instead of branching on host
OS the way every other nox session in the file does. On macOS this means pip
tries to install pyinotify, a Linux-only package with no macOS build path,
which fails immediately (inotify is not available on macosx-...).

2. Several pip-compile hooks in .pre-commit-config.yaml don't actually exist

A handful of per-Python-version pip-compile hook blocks are missing their
own - id: pip-compile list marker, which causes YAML to silently merge
them into the preceding hook's mapping instead of creating a separate list
item. Since duplicate keys in a YAML mapping resolve to "last one wins" with
no parse error, the earlier hook is completely clobbered with no warning at
all — pre-commit run <that-hook's-alias> reports "No hook with id ... in
stage pre-commit" as if it never existed.

At least the Darwin, Linux, FreeBSD, and Windows Py3.14 ZeroMQ requirements
hooks, and the Docs CI Py3.14 hook, are affected — meaning their lock files
can never be regenerated via pre-commit run <alias> and may have drifted
stale indefinitely. A related instance elsewhere in the file has two
duplicate exclude: keys on the enforce-tornado-imports hook, silently
dropping the intended salt/ext/.* exclusion (vendored code).

3. lint.lock redeclares the full dependency graph, causing cross-platform version conflicts

lint.lock is a single, Linux-pinned file compiled from the entire
base.txt/common.txt/linux.txt/pkg/linux.txt dependency graph, not
just the lint tooling itself (pylint/astroid/etc). Since _lint() installs
a platform's own CI lock alongside this shared lint.lock, any package
pinned to a different version between the two (observed with boto3 and
aiohttp) causes a hard pip resolution conflict on any platform other than
Linux.

This is made worse by uv pip compile's default behavior of preferring
already-pinned versions unless --upgrade is explicitly passed — so lock
files regenerated at different times or on different machines don't
naturally converge on their own, even after fixing bug 2 above.

Notably, Salt's own .pylintrc already disables both import-error and
no-member, the two pylint checks that would actually care whether a given
third-party package is installed — meaning lint.lock including
integration-only dependencies (ansible, boto3, kubernetes, moto, mercurial,
etc.) doesn't appear to be required for pylint's enabled checks to run
correctly.

To reproduce

On macOS, run pre-commit run lint-salt --files noxfile.py (or any change
touching salt//tools/). It fails at the pip install step — first with a
pyinotify build error, and if that's worked around, with a boto3/
aiohttp version conflict between the platform's own lock file and
lint.lock.

Activity

  1. self-assigned this
    on Aug 3, 2026
  2. added theissue type on Aug 3, 2026
  3. added
    bug
    on Aug 3, 2026
  4. changed the title [-]lint-salt/lint-tests pre-commit hooks broken on macOS[/-] [+][BUG] lint-salt/lint-tests pre-commit hooks broken on macOS[/+] on Aug 3, 2026
  5. BrianHa94 commented on Aug 24, 2026

    @BrianHa94
    CollaboratorAuthor

    Fix has been merged. #69933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions