Developing
Here is some basic information for developing.
Juliaup
Juliaup is the official version manager for Julia. It allows multiple Julia versions to be installed side by side, provides a simple way to switch between them or select a specific version when starting Julia, and keeps installed versions up to date. Juliaup manages the Julia executables themselves, while packages and package environments continue to be managed separately through Julia's built-in package manager (Pkg).
Install with:
curl -fsSL https://install.julialang.org | shInstall the latest stable release:
juliaup add releaseSet the default:
juliaup default releaseThen
juliastarts the default version. To run a specific version without changing the default:
julia +ltsUpdate the release version:
juliaup update releaseSeparate development and release environments
It is useful to have separate development and release environments.
mkdir -p ~/julia-envs/dev
mkdir -p ~/julia-envs/relNow set up the development environment:
julia --project=~/julia-envs/devThen:
using Pkg
Pkg.develop(path=expanduser("~/Oscar.jl"))
Pkg.develop(path=expanduser("~/TensorCategories.jl"))
Pkg.add("Revise")
Pkg.instantiate()Set up the release environment:
julia --project=~/julia-envs/relusing Pkg
Pkg.add("Oscar")
Pkg.add("TensorCategories")
Pkg.instantiate()Add Bash aliases:
alias jldev='julia --project=$HOME/julia-envs/dev'
alias jlrel='julia --project=$HOME/julia-envs/rel'Building documentation
Only once initialize the docs environment:
cd ~/TensorCategories.jl
julia --project=docsusing Pkg
Pkg.develop(path=pwd())
Pkg.instantiate()Then build the docs with:
julia --project=docs docs/make.jlWhen working on a remote machine, clone the built documentation to the local machine for viewing:
rsync -avz --delete remote:~/TensorCategories.jl/docs/build/ tc-docsOn the local machine it's best to serve the documentation via little web server:
python3 -m http.server 8000Then open:
http://localhost:8000For convenience, add a script serv.sh for starting the server:
python3 -m http.server 8000Moreover, a script pull.sh to pull the documentation from the server:
rsync -avz --delete --exclude='/pull.sh' --exclude='/serv.sh' remote:~/TensorCategories.jl/docs/build/ .