Finalizing Your Julia Package: Documentation, Testing, Coverage, and Publishing
Christopher Rackauckas · 2018
In this tutorial we will go through the steps to finalizing a Julia package.At this point you have some functionality you wish to share with the world... what do you do?You want to have documentation, code testing each time you commit (on all the major OSs), a nice badge which shows how much of the code is tested, and put it into metadata so that people could install your package just by typing Pkg.add("Pkgname").How do you do all of this?Note: At anytime feel free to checkout my package repository DifferentialEquations.jl which should be a working example. GENERATE THE PACKAGE AND GET IT ON GITHUBFirst you will want to generate your package and get it on Github repository.Make sure you have a Github account, and then setup the environment variables in the git shell: $ git config --global user.name"FULL NAME" $ git config --global user.email"EMAIL" $ git config --global github.user"USERNAME" Now you can generate your package via using PkgDev PkgDev.generate("PkgName","license")For the license, I tend to use MIT since it is quite permissive.This will tell you where your package was generated (usually in your Julia library folder).Take your function files and paste them into the /src folder in the package.In your /src folder, you will have a file PkgName.jl.This file defines your module.Generally you will want it to look something like this: module PkgName #Import your packages using Pkg1, Pkg2, Pkg3 import Base: func1 #Any function you add dispatches to need to be imported directly abstract AbType #Define abstract types before the types they abstract!include("functionsForPackage.jl")#Include all the functionality export coolfunc, coolfunc2 #Export the functions you want users to use end Now try on your computer using PkgName.Try your functions out.Once this is all working, this means you have your package working locally.