Habitat is a lightweight command line tool to manage source and binary dependencies in monorepo, plus dependency integration in CI environment.
It is also easy to use for developers. No need to execute many commands manually, just run ./hab sync .
to set up
local development environment.
We provide both a binary (hab.pex) and a wrapper script. You can find them in the releases and choose to download one of them as your need.
The simplest way is to download the wrapper using following instruction:
curl -L -O https://github.com/tiktok/habitat/releases/download/0.3.134/hab
-
Generate habitat configuration file in the repo.
./hab config <repo remote uri>
A .habitat file will be generated. it should look like this.
solutions = [ { 'name': '.', 'deps_file': 'DEPS', # dependency list 'url': '[email protected]:namespace/repo.git' # main repo's remote url } ]
-
Add a dependency in DEPS file.
deps = { 'lib/example': { 'type': 'git', 'url': '[email protected]:namespace/lib.git', 'branch': 'dev' } }
-
Track habitat wrapper script and configuration files.
git add hab .habitat DEPS && git commit -m "Add habitat to manage dependencies."
-
Integrate the
dev
branch of dependency to pathlib/example
../hab sync .
Recommend to develop with Python higher than 3.9.
python3 -m venv _venv
source _venv/bin/activate
make install_dev
Running tests after making any changes is strongly recommended.
make check