xiaodai
xiaodai

Reputation: 16064

Julia: How to set the package Dev path?

I often ]dev Pkg but I want the devved packaged to be stored somewhere other than the default location for convenient access.

I don't want to change the path of the ]add Pkg. This seems to be controlled by the environment parameter DEPOT_PATH.

Is there a way to change only the path for dev Pkg, i.e. the path in which the dev package is stored?

Upvotes: 7

Views: 2458

Answers (2)

Cameron Bieganek
Cameron Bieganek

Reputation: 7704

You can set the environment variable JULIA_PKG_DEVDIR to change where development packages are installed. See the develop docs for more info.

As @crstnbr noted, an alternative is to use the --local option to the pkg> dev command to install a development version of the package in a dev directory within the current project. This could make sense if you're developing your own package MyCode.jl which relies on Example.jl and you need to make a hot fix to Example.jl. Then your Pkg REPL command would look like this:

(MyCode) pkg> dev --local Example

If you would like to make changes to a third-party package and submit those changes as a pull request on Github, there are a few more steps in the process. See this Discourse thread for more details on that process.

Upvotes: 7

carstenbauer
carstenbauer

Reputation: 10147

Not quite what you're asking for but you can of course always git clone the package to a path of your choice and then dev path/to/the/local/clone/of/the/pkg.

You can even do this from within julia:

using Pkg
Pkg.GitTools.clone("<pkg url>", "<local path>")
Pkg.develop(PackageSpec(path="<local path>"))

Upvotes: 5

Related Questions