GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Julia: copy src files by ericphanson · Pull Request #3497 · pre-commit/pre-commit

Conversation

@ericphanson

@ericphanson ericphanson commented Jul 21, 2025

Copy link
Copy Markdown
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
@ericphanson
Julia: copy src files
30382b9
@ericphanson ericphanson mentioned this pull request Jul 21, 2025
improve julia language support #3494
Closed
@asottile

asottile commented Aug 9, 2025

Copy link
Copy Markdown
Member

so I feel like there might be something really wrong with the way julia is currently approached in pre-commit -- and honestly I don't have any experience in julia and mostly have been leaning on contributors to have that knowledge

I suspect that we're approaching installation in a way that doesn't really represent how a julia package would get normally installed. for instance in python when you pip install . it will appropriately copy the files it needs to the particular environment it is being installed to! in julia it seems like we're manually doing that copying and we're manually specifying the list of files to copy -- that to me seems not quite correct 🤔. I imagine we're missing some sort of "pack" step (ala what language: node does) or some sort of other package manager manipulation. ideally we'd be in some place where we're not manually copying files out of the source repository and just running some julia installer command to do the right thing. what we're doing now seems fragile -- and this PR also seems kinda fragile (I'm not even sure source files are required to be in src for instance).

do you have experience in julia that you could lend some advice? this seems odd either way

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gdalle

gdalle commented Aug 15, 2025

Copy link
Copy Markdown

Just starting to look into pre-commit for Julia myself, so take this with a grain of salt, but perhaps the hook packages should be installed with Julia's package manager Pkg instead of the files being manually copied? If this has to happen from Python, then PythonCall.jl might be a solution?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericphanson

ericphanson commented Aug 16, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonas-schulze

jonas-schulze commented Oct 30, 2025

Copy link
Copy Markdown

Why not copy everything?

Disclaimer: I'm also just starting to look into pre-commit for Julia myself.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jonas-schulze added a commit to jonas-schulze/ExplicitImports.jl that referenced this pull request Oct 30, 2025
@jonas-schulze
WIP Refactor pre-commit hook (not actually WIP)
ed64642
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.
@jonas-schulze jonas-schulze mentioned this pull request Oct 30, 2025
Pre-commit hook JuliaTesting/Aqua.jl#348
Open
@KristofferC KristofferC mentioned this pull request Nov 3, 2026
Add explicit-imports pre-commit hook JuliaLang/Pkg.jl#4329
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ericphanson @asottile @gdalle @jonas-schulze
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.