Package development of a not yet public package

I am having a little trouble with package development. It seems, Pkg3 prefers to do some caching here and there.

I hava a MyPack.jl/ folder containing my package (with git repository src/``docs/ test/ and such)
When I am in Atom (Juno) I do something like
>pkg develop .
which adds a relative path from the .Julia/ folder in my home dir to said MyPack.jl/folder.

Then I can just run the tests (include('test/runtests.jl')or generate the documentation (that’s what I am working on at this moment) include('docs/make.jl'). Either way I might have a bug somewhere, let’s say even in an early stage at compile time, so this include errors…

On the old 0.6 (where I had the MyPack.jlin my PATH) I fix the bug and restarted Julia (maybe even that could get nicer) and would just using MyPackor reissue above test/make.

On 0.7 however with the above approach it quite often keeps the bug I just fixed (and I am sure I saved the file and such).
The one thing that does work is a git commit, but for every character that I fix and test a commit would really clutter my history.
Neither pkg> update . nor pkg> update MaPack nor a new pkg> develop . solve this issue, also neither of them after restarting Julia.

So what’s the best workflow to develop a package with Julia 0.7/1.0 and Pkg3 (with Atom on Mac OS for example)?

Could you show status output. It seems that you have done add and is tracking the repo instead of the actual files.

1 Like

Actually that is exactly what I fear it does. So in any way I would be interested in how to do the one and the other to learn the difference :slight_smile:

(v0.7) pkg> status
    Status `~/.julia/environments/v0.7/Project.toml`
  [c52e3926] Atom v0.7.3
  [e30172f5] Documenter v0.19.6
  [e5e0dc1b] Juno v0.5.2
  [0fc0a36d] MyPack v0.0.0 [`~/.julia/environments/v0.7/../../../Repositories/Software/MyPack.jl`]
  [0796e94c] Tokenize v0.5.2
  [d6f4376e] Markdown
  [10745b16] Statistics

Also note the version number, since I did not yet get used to the Project.toml (for example looking up uuids for deps) and I am glad having gotten REQUIRE to work

That looks indeed like it is tracking by path. What does Base.find_package("MyPack") say?

Seems to be right:
"/Users/[...]/Repositories/Software/MyPack.jl/src/MyPack.jl"– so maybe in one of the restarts I did the right thing to switch to not using the git repository but the folder.

Check out Revise.jl if you want to reduce the number of times that you need to restart julia.

1 Like

That looks really neat. I am still missing (just a few) things that made writing code in Matlab nice (wile a lot other are already far better in Julia) – Revise seems to fix one dev-step for me :slight_smile: (just a few plot features to go then).

1 Like