# Modifying and testing a registered package in a directory outside of .julia

**URL:** <https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882>\
**Category:** General Usage\
**Tags:** package, git\
**Created:** [July 16, 2017, 2:33pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882 "2017-07-16T14:33:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew-wingate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matthew-wingate/32/28472_2.png) [@matthew-wingate](https://discourse.julialang.org/u/matthew-wingate)\
**Post date:** [July 16, 2017, 2:33pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/1 "2017-07-16T14:33:43Z")

</div>

I am in the process of editing a file in a standard package (SpecialFunctions). For better or worse, I’ve already done my work using the standard git procedure, but outside the .julia directory structure. I can’t find any advice on how to test my updated branch of the package. I would appreciate help as I’ve already created havoc with some kludgy guesses.

To elaborate, I have cloned [https://github.com/JuliaMath/SpecialFunctions.jl/](https://github.com/JuliaMath/SpecialFunctions.jl/) , started a new branch on my local machine ~/Julia/Testing, and pushed this to [https://github.com/matthew-wingate/SpecialFunctions.jl/](https://github.com/matthew-wingate/SpecialFunctions.jl/) . In my julia session, I’d like to use my new branch rather than the registered master branch.

Is there a way to toggle between versions of packages, in the way a python user would call `import mytestdir/special` vs `import scipy.special`? I have a feeling the solution lies in `Pkg.init()`, but there isn’t enough documentation there for me to follow. Also it seems I’d have to keep pushing changes to my git-hub repo; it would be more convenient to test before making commits, I’d think.

I’ve found [https://docs.julialang.org/en/release-0.6/manual/packages](https://docs.julialang.org/en/release-0.6/manual/packages) rather late in the day. From this I gather that I should be doing my work all within julia, although as a git tyro, this feels even more likely to lead to workflow problems.

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 16, 2017, 3:13pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/2 "2017-07-16T15:13:48Z")

</div>

I did a workflow video here:

[![](https://img.youtube.com/vi/tx8DRc7_c9I/maxresdefault.jpg "Developing and Editing Julia Packages") ](https://www.youtube.com/watch?v=tx8DRc7_c9I)

Notice that Julia packages are just Github repos. So you can `Pkg.checkout("MyPackage")` and now you’re on master, do your stuff, push to your remote, `Pkg.test("MyPackage")`, and then `Pkg.free("MyPackage")` to go back to the release version. That’s why I think it’s easiest to just work from `.julia/v0.x/MyPackage`.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 16, 2017, 6:45pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/3 "2017-07-16T18:45:39Z")

</div>

> [@ChrisRackauckas](#):
>
> That’s why I think it’s easiest to just work from .julia/v0.x/MyPackage.

Or symlink it there.

---

<div class="post-metadata">

**Author:** ![matthew-wingate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matthew-wingate/32/28472_2.png) [@matthew-wingate](https://discourse.julialang.org/u/matthew-wingate)\
**Post date:** [July 17, 2017, 12:15am UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/4 "2017-07-17T00:15:03Z")

</div>

I tried that, but git was unhappy, complaining about a detached HEAD. I’ll try more carefully. Thanks.

---

<div class="post-metadata">

**Author:** ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Post date:** [July 17, 2017, 2:48am UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/5 "2017-07-17T02:48:01Z")

</div>

I made an issue related to this on Juleps a few months ago:

[https://github.com/JuliaLang/Juleps/issues/31](https://github.com/JuliaLang/Juleps/issues/31)

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [July 17, 2017, 8:27am UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/6 "2017-07-17T08:27:11Z")

</div>

> [@ChrisRackauckas](#):
>
> Notice that Julia packages are just Github repos.

Really? I was under the impression, that Julia packages are git repos and github is just the default sharing platform.

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [July 17, 2017, 9:00am UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/7 "2017-07-17T09:00:53Z")

</div>

I don’t know if this may be too dirty, but since you have a copy of your repository in Github, you might change your local copy of METADATA inside ~/.julia, so that your link to the “SpecialFunctions” package points to your fork of the package, instead of the original one.

You may find the file with the target url in ~.julia/v0.X/METADATA/SpecialFunctions/url (with “X” equal to the version of Julia you are using - 0.6 if you are working with the latest released version).

Then, if I’m not wrong, Pkg.update() should update that package to your fork. I have not tested that myself, so I’m not really sure if this works or it would break…

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 17, 2017, 2:08pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/8 "2017-07-17T14:08:43Z")

</div>

> [@lobingera](#):
>
> Really? I was under the impression, that Julia packages are git repos and github is just the default sharing platform.

Yes, that is correct. I wrote that down incorrectly.

---

<div class="post-metadata">

**Author:** ![matthew-wingate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matthew-wingate/32/28472_2.png) [@matthew-wingate](https://discourse.julialang.org/u/matthew-wingate)\
**Post date:** [August 5, 2017, 1:31pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/9 "2017-08-05T13:31:48Z")

</div>

Thanks for the suggestion, but is this syntax depricated? I find

> MethodError: no method matching add(::String, ::String)  
> Closest candidates are:  
> add(::AbstractString, ::VersionNumber…) at pkg/pkg.jl:117
> 
> Stacktrace:  
> [1] include\_string(::String, ::String) at ./loading.jl:515

---

<div class="post-metadata">

**Author:** ![matthew-wingate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/matthew-wingate/32/28472_2.png) [@matthew-wingate](https://discourse.julialang.org/u/matthew-wingate)\
**Post date:** [August 5, 2017, 3:46pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/11 "2017-08-05T15:46:49Z")

</div>

Thanks, that was very helpful! GitKraken was a sanity-saver!

---

<div class="post-metadata">

**Author:** ![adithya.vasudevan](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@adithya.vasudevan](https://discourse.julialang.org/u/adithya.vasudevan)\
**Post date:** [January 11, 2022, 6:48am UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/12 "2022-01-11T06:48:42Z")

</div>

Dear Chris,

I’m new to Julia (have had previous experience with C, C++, Java, JavaScript, Python).

I’m attempting to modify HTTP.jl, to allow websocket client connections with self-signed certificates (and therefore not attempt to validate certificates).

I have followed your instructions, made a fork of HTTP.jl.

However, both the fork and the registered package show that most of the source code has been commented out/ placed within nested multi-line strings. However, when I attempt to access the same package by following VSCode definition tracing (Go to definition), the multi-line strings are gone.

Is there something that I’m missing here, like a pre-processing step?

I’d be grateful if you could look at the open function in HTTP.jl, which is the function I want to modify.

Sorry if this appears to be a naive question!

regards.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 11, 2022, 1:12pm UTC](https://discourse.julialang.org/t/modifying-and-testing-a-registered-package-in-a-directory-outside-of-julia/4882/13 "2022-01-11T13:12:58Z")

</div>

> [@adithya.vasudevan](#):
>
> However, both the fork and the registered package show that most of the source code has been commented out/ placed within nested multi-line strings. However, when I attempt to access the same package by following VSCode definition tracing (Go to definition), the multi-line strings are gone.

Seems like you might’ve had a merge error?
