Contributing to packages

I’m working on adding a distribution to Distributions.jl and am curious how to get a good workflow for making contributions. I first created a new environment with ]activate MyDist, added Distributions.jl and the other needed packages, and then setup a git clone with ]develop --local Distributions. I’ve added my files and modified other files in the dev/Distributions directory. When I run in the REPL include("runtests.jl") or compile the documents with include("make.jl") in the dev/Distributions/docs/ directory, my tests aren’t being run and my documentation isn’t showing in the created html file.

Is what I’ve done so far the correct way to test my additions to a package before working on a pull request?

1 Like

I suppose you’d need to activate the Distributions environment.

Isn’t activating a new environment different than adding and developing packages in an environment?

My typical workflow for developing a package is:

  • Clone the package repository into a folder somewhere convenient. You can do this with ]dev PackageName, but I personally prefer to clone packages manually into a folder other than .julia.
  • cd into the package folder
  • Start Julia and run ]activate . to activate the package’s project environment.
  • Make changes, and run ]test PackageName to run the tests.

Rather than creating a whole new environment to work on the package, we can just work in the package’s environment. That means that any references to PackageName are always unambiguously the one you’re developing right now, and any edits you make to the local files are guaranteed to have an effect.

6 Likes

@rdeits That seems to have done the trick. I’m curious, though, why activating a new environment then running ]develop --local Distributions didn’t work if the environment is now tracking the local files and the changes I’ve made?

I’m not sure–I don’t see anything obviously wrong with what you’re doing. If you want to really get to the bottom of it, the thing to do would be to write down the exact set of steps you took and exactly what the unexpected result was. Otherwise it’s hard to be sure.

1 Like