Converting existing Package from old Pkg to new Pkg

Hello everyone,

I couldn’t find an up to date answer to this question.
I have this very old package generated under julia 0.6.
How can I update to Pkg3 without loosing git history and without changing the name?

Many thanks in advance,
Olivier

These things are orthogonal. You just make a commit, which adds Project.toml and updates code to a julia 1.0+ version and you’re good to go. Since it’s just a new commit, no git history would be lost, quite the contrary.

1 Like

ok, thanks.
I see your point.

I should have phrased a bit differently. What I’m most interested in is to know how I add a legal project file, with legal UUID and remove the require file. Can I just erase the latter?

Yes, surely you can delete it. Here is an example of GeoIP.jl which was recently updated from pre 1.0 to 1.0+ version: https://github.com/JuliaWeb/GeoIP.jl/pull/29/files

I removed REQUIRE, add Project.toml and some CI scripts.

If you doubt about uuid and other things, then the easiest way is to generate new project with the same name with the help of PkgTemplates.jl and just copy all files (except src and README of course) to your old project.

This should work smoothly if it was removed from the Registry. If it is a registered package, you should use it’s current uuid.

great!
That worked like a charm.
Thanks a lot

1 Like