Advice on creating packages in v0.7

Earlier in the day I was close to wingeing about how I couldn’t understand from the documentation how one was supposed to create a package for v0.7 with the new package manager.

I think I have figured it out and I am very impressed. @StefanKarpinski, @kristoffer.carlsson and the others who have worked on it should be proud of what they have accomplished. The transition is, understandably, rocky but the results are worth it.

My advice to others who are facing the problem of how to write a package for v0.7 is to forget everything you know about package creation in v0.6 and earlier and follow the examples in the section on “Creating your own packages” in the v0.7 manual. Create a tiny package with Pkg.generate and add some dependencies, then look at the contents of Project.toml. Eventually it will make sense.

It took me a while to realize (at least I hope this is true) that REQUIRE is not needed for a new package. I was misled by the mechanism for compatibility with earlier package styles.

10 Likes

Relevant link to doc. Thanks for the advice!

1 Like

I also found

shell> cd to/my/package/directory
pkg> init
pkg> add Dependency1
pkg> add Dependency2

very useful when converting existing packages. That’s basically all it took. (@ExpandingMan wrote a tool for this.)

I am finding the transition to v0.7 rather smooth.

3 Likes