Skip to content

♻️ refactor(plugin): name loader entry point - #220

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/public-patch-entrypoint
Nov 13, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/public-patch-entrypoint

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

The .pth loader previously called pre_commit_uv._pre_commit_patch._patch(). It now calls pre_commit_uv._pre_commit_patch.patch(). The loader needs the public-spelled patch entry point in that private module; _health_check stays private and its tests use the installed pre_commit.languages.python.health_check. The package root exports stay unchanged.

The plug-in again uses pre-commit's _read_pyvenv_cfg through a narrow inline ignore. The install test reloads pre_commit.main before reloading the plug-in: when the tests ran in the opposite order, the reload captured the patched function as its own original and recursed.

This corrects the entry point moved in #219.

@gaborbernat gaborbernat added enhancement New feature or request skip news No user-facing changelog entry is needed labels Nov 13, 2026
@gaborbernat
gaborbernat force-pushed the fix/public-patch-entrypoint branch from 60b09af to 9fb49e0 Compare November 13, 2026 01:07
The startup loader called a private name across modules after the hook
moved out of the package root. Give that loader an entry point within
the private module and keep the health check internal. Reuse pre-commit's
pyvenv.cfg parser. Reload pre-commit before the plug-in in the install
test so a prior patch cannot become its own original function.
@gaborbernat gaborbernat changed the title ♻️ refactor(plugin): name shared entry points ♻️ refactor(plugin): name loader entry point Nov 13, 2026
@gaborbernat
gaborbernat force-pushed the fix/public-patch-entrypoint branch from 9fb49e0 to 640d488 Compare November 13, 2026 01:23
@gaborbernat
gaborbernat merged commit d95d879 into tox-dev:main Nov 13, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request skip news No user-facing changelog entry is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant