GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — Julia: copy src files by ericphanson · Pull Request #3497 · pre-commit/pre-commit Conversation
Contributor
Copies src files in addition to Project/Manifest. This allows pre-commit hooks to live inside a package (like https://github.com/JuliaTesting/ExplicitImports.jl/blob/main/.pre-commit-hooks.yaml) instead of being in a separate repo (like https://github.com/fredrikekre/runic-pre-commit). Split out from #3494
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
This does feel a bit weird, I agree. The case here is when the precommit hook lives in a package, like JuliaTesting/ExplicitImports.jl#128. The existing hook support copies the Project/Manifest from the directory the hook lives in and tries to install the dependencies. But if the Project corresponds to a package, it (a) refuses to use Pkg to install that package as a dep (since the project name/uuid matches) and (b) fails as it lacks the src code. An alternative way to use hooks that does work is to create a separate repo for the hook (outside the package) and use a Project.toml there to specify the package so it can be installed. This is done for example here: https://github.com/fredrikekre/runic-pre-commit. However I think it’s pretty inconvenient to maintain a second repo just for precommit support. Precommit is not a main way people use ExplicitImports for example, and it’s easy enough to add a hook file, but it’s a bit more to need to update/maintain a Project in a secondary repo. The reason copying src feels ok in the scenario to me is that with the current setup is that we copy the Project.toml and when that is for a package, it needs the src code to run. So it is an expansion of the existing Project support. Either way, we definitely do not need PythonCall. We already install deps. The question is just how to do it when the hook lives in the package itself. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Why not copy everything? Disclaimer: I'm also just starting to look into pre-commit for Julia myself. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Declare hook to be a Julia project, so that users don't have to install ExplicitImports manually. Inspired by runic-pre-commit. Edit: just found pre-commit/pre-commit#3497 so this won't work.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.