I often ]dev Pkg
but I want the dev
ved 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?
One or more modules can be stored in a package, and these are managed using the git version control system. Most Julia packages, including the official ones, are stored on GitHub, where each Julia package is, by convention, named with a ". jl" suffix.
Julia uses Git as a repository for itself and for its package and that the installation has a built-in package manager called pkg. jl.
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.
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>"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With