A lightweight command line tool to manage source and binary dependencies.
Find a file
2025-03-03 21:14:40 +08:00
.github/workflows chore: fix release workflow on github 2024-11-22 11:48:27 +08:00
bin chore: add a wrapper script for the habitat binary 2024-11-22 11:06:25 +08:00
core chore: add essential documents. 2025-03-03 10:27:56 +08:00
tests fix: add cycle detection for dependency's requirement 2024-10-15 11:50:40 +08:00
.editorconfig Initial commit 2024-10-09 11:47:05 +08:00
.flake8 Initial commit 2024-10-09 11:47:05 +08:00
.gitignore Initial commit 2024-10-09 11:47:05 +08:00
__init__.py Initial commit 2024-10-09 11:47:05 +08:00
CODE_OF_CONDUCT chore: add a blank line in documents 2025-03-03 21:14:40 +08:00
CONTRIBUTING.md Initial commit 2024-10-09 11:47:05 +08:00
LICENSE Initial commit 2024-10-09 11:47:05 +08:00
Makefile chore: add --sh-boot to make hab.pex executable in a bash script 2024-10-09 11:47:10 +08:00
MANIFEST.in Initial commit 2024-10-09 11:47:05 +08:00
NOTICE chore: add a blank line in documents 2025-03-03 21:14:40 +08:00
README.md chore: add essential documents. 2025-03-03 10:27:56 +08:00
requirements.txt chore: upgrade version of setuptools. 2025-02-27 12:03:08 +08:00
SECURITY chore: add a blank line in documents 2025-03-03 21:14:40 +08:00
setup.py chore: use pex to build cross platform artifact 2024-10-09 11:47:10 +08:00
THIRD-PARTY-LICENSE Initial commit 2024-10-09 11:47:05 +08:00
tox.ini Initial commit 2024-10-09 11:47:05 +08:00

habitat

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.

Installation

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/lynx-infra/habitat/releases/latest/download/hab

Usage

  1. 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': 'git@github.com:namespace/repo.git'  # main repo's remote url
        }
    ]
    
  2. Add a dependency in DEPS file.

    deps = {
        'lib/example': {
            'type': 'git',
            'url': 'git@github.com:namespace/lib.git',
            'branch': 'dev'
        }
    }
    
  3. Track habitat wrapper script and configuration files.

    git add hab .habitat DEPS && git commit -m "Add habitat to manage dependencies."
    
  4. Integrate the dev branch of dependency to path lib/example.

    ./hab sync .
    

Development

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

Contributing

See the contributing file!

License

Apache License 2.0