Skip to content

Dev setup

Olivier Cots edited this page Oct 30, 2025 · 18 revisions

🧰 Dev Setup

This page explains how to set up your Julia environment to develop or use packages from the control-toolbox ecosystem.


πŸ“¦ Packages (1/2): Official vs Local Registry

All packages of the ecosystem are now available in the official Julia General Registry β€”
you no longer need to manually add a local registry.

Note

The local registry (ct-registry) is deprecated and should only be used for legacy setups or historical purposes.

If you still need it for compatibility reasons, you can add it manually:

SSH:

pkg> registry add git@github.com:control-toolbox/ct-registry.git

HTTP:

pkg> registry add https://github.com/control-toolbox/ct-registry.git

You can either use a stable (registered) version of a package,
or develop one locally or from a Git repository.

  • Use a registered version (recommended for users):
pkg> add MyPackage
  • Develop a local version (for contributors):
pkg> dev /home/user/OptimalControl.jl
  • Return to the registered version:
pkg> free OptimalControl.jl

πŸ‘₯ Person: Developer vs User

πŸ‘¨β€πŸ’» Developer

If you are contributing to a package:

  1. Activate the project (from the directory containing Project.toml):

    pkg> activate .
  2. Instantiate dependencies:

    pkg> instantiate
  3. Run tests:

    pkg> test

    or equivalently from the shell:

    julia --project=. -e 'using Pkg; Pkg.test()' |& tee -a /tmp/log

πŸ™‹β€β™€οΈ User

If you only need to use the developed package (for example, inside a notebook):

using MyPackage

🧠 Misc

To import a module defined inside your current project, use a relative reference:

using .MyModule

πŸ”„ Update a Dependency

To check for outdated dependencies and update your Project.toml compat entries:

julia> ]
pkg> activate .
pkg> update
pkg> st --outdated
pkg> compat

βœ… Summary

Role Typical actions
User pkg> add MyPackage
Developer pkg> dev /path/to/MyPackage then pkg> activate . and pkg> test
Maintainer Update dependencies and check compat entries
Legacy setups May still require adding the local registry (ct-registry)

πŸ“š See also:

Clone this wiki locally