Using my local copy of a package

I would like to add changes to some packages, I guess I really mean make a pull request.

I’m following the instructions in “Making changes to an existing package”.

Pkg.checkout("name")

So now I have my local copy and I can go in and edit it.

What I’m not clear on is how to make sure the next time I say

using PackageName

that it will actually be using my local copy of the package ?

I do realize that I could add my functionality and then a corresponding test and do

Pkg.test("PackageName")

But I would also like to run some code that depends on the package.

Thanks !

You always have a local copy. Pkg.checkout just makes it the master branch (when you don’t specify a second argument).

You need to create and checkout a branch (a git concept, read up on it), which you can then submit as a PR. If, in the meantime, you want to revert to master or a released version, just commit your changes on your branch and checkout the one you need.

2 Likes

If your workplace does not allow you to contribute changes upstream as a PR, then you could push changes in your private git repo and instead of the ‘package name’ you can give your private git url to checkout.

@Tamas_Papp oh - i didn’t realize the package source was actually sitting in .julia. I’m sort of stuck in the object file mentality where I assumed that there was some sort of binary blob which is being loaded when you execute “using”. So now that I’ve actually looked in .julia, I see that the full packages are sitting there.

But I also see that there is a lib directory with .ji files. Don’t those files need to be re-generated when I modify the existing library ?

@svaksha it’s not a matter of not being able to submit changes. I’m simply unclear if I have to take some sort of action, e.g. a precompilation step, so that when I modify the library the changes are picked up by my existing code.

I should just modify the library, put in some changes, and see if things do what I expect.

That should happen automatically.