Skip to content

improve julia language support#3494

Closed
ericphanson wants to merge 8 commits intopre-commit:mainfrom
ericphanson:eph/jl
Closed

improve julia language support#3494
ericphanson wants to merge 8 commits intopre-commit:mainfrom
ericphanson:eph/jl

Conversation

@ericphanson
Copy link
Copy Markdown
Contributor

This PR fixes three issues I ran into when trying to use pre-commit's native Julia language support for ExplicitImports.jl (JuliaTesting/ExplicitImports.jl#100) in Pkg (JuliaLang/Pkg.jl#4326):

  1. Adds --startup-file=no to both invocations of Julia (install & run). The startup file is a Julia script that users can configure to run commands before the start of their Julia session. It is typically used to load developer packages like Revise and not used "in-production". Here when we run our pre-commit hooks we do not want to run the user's startup file which could have dependencies the current environment does not have.
  2. 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).
  3. Adds basic support for customizing the Julia version by setting the JULIAUP_CHANNEL environmental variable. This support is limited in a couple ways:
    • We don't check that the user is using juliaup. They could have installed julia some other way in which case the JULIAUP_CHANNEL does not do anything and setting the language_version will not have any effect. That however is the status quo (currently setting the language_version does not have any effect) and many users use juliaup, so I think we could just document that language_version support requires your julia to be from juliaup.
    • If the user passes a channel which is not installed, they will get a juliaup error that the channel can not be found. If we were confident they were using juliaup we could install it on their behalf instead, but I'm not sure this is necessary.

With these changes, JuliaLang/Pkg.jl#4329 can run successfully.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants