Skip to main content

Development Toolchain Management

Firmware Vault uses mise to standardize and manage developer tooling across all platforms. A single committed configuration file (mise.toml) pins the exact versions of the runtime tools and linters needed for local development, keeping local environments aligned with the CI/CD pipeline and container images.


Why mise?​

Local development in Firmware Vault spans multiple ecosystems: Python for backend microservices and analysis tools, Node.js and Angular for the web frontend, and Docusaurus for documentation.

Previously, setting up a development workstation required manually installing separate versions of Python, Node, npm, yarn, and pre-commit, as well as manually creating and activating virtual environments. This often led to version drift between local workstations and CI test environments.

With mise:

  • Deterministic tool versions: Tool versions are pinned in mise.toml to match CI runner images and production Dockerfiles.
  • Separation of concerns: mise.toml manages tools and system runtimes (Python, Node, uv, etc.), while application dependencies remain in their native manifests (requirements.txt, package-lock.json, yarn.lock).
  • Zero-friction Python virtual environment: Mise automatically provisions and activates a .venv using uv when entering the repository directory, including setting PYTHONPATH.
  • Cross-platform task runner: Common workflows (installing dependencies, running linters, starting compose stacks, applying database migrations) are standardized as mise run <task> commands.

Installation​

Install mise following the instructions for your operating system:

Linux​

Install via the standalone installer:

curl https://mise.run | sh

Or install via your distribution's package manager (e.g. apt, pacman). Refer to the official mise installation guide for package repository setup.

macOS​

Install via Homebrew:

brew install mise
Anaconda / Conda Users on macOS

If Anaconda or Miniconda is initialized in ~/.zshrc (conda init), its automatic base environment activation can override the mise .venv Python on PATH if conda runs after mise. To ensure mise takes precedence inside the repository, either place eval "$(mise activate zsh)" at the very end of ~/.zshrc (after the # >>> conda initialize >>> block) or disable automatic base activation:

conda config --set auto_activate_base false

Windows​

Recommendation

On Windows, WSL2 (Windows Subsystem for Linux) is strongly recommended. Developing inside WSL2 provides identical performance and shell behavior to Linux, and Docker Desktop integrates directly with WSL2. See the WSL Setup Guide for step-by-step instructions.

If you prefer native Windows development, install via winget:

winget install jdx.mise

Shell Activation​

To allow mise to automatically activate tools and environments when you navigate into the project directory, add the activation hook to your shell configuration file:

Bash (~/.bashrc):

eval "$(mise activate bash)"

Zsh (~/.zshrc):

eval "$(mise activate zsh)"

Fish (~/.config/fish/config.fish):

mise activate fish | source

PowerShell ($PROFILE on Windows):

mise activate pwsh | Out-String | Invoke-Expression

After modifying your shell configuration, restart your terminal or reload the profile. Alternatively, if you do not want to use shell hooks, you can use mise activate --shims or run commands prefixed with mise exec -- <command>.


First Run​

Once mise is installed and activated, navigate to the firmware_vault repository and execute:

# 1. Trust the repository configuration
mise trust

# 2. Download and install all pinned tools
mise install

# 3. Install all dependencies (Python, frontend, docs) and git hooks
mise run setup

The mise run setup task installs the Python requirements into .venv, installs the frontend and documentation npm/yarn packages, and installs the pre-commit git hooks.


Pinned Tool Versions​

The tools defined in firmware_vault/mise.toml are pinned to exact versions matching the CI/CD pipeline and container base images:

ToolVersionBackend / SourceCI / Docker EquivalentPurpose
Python3.11.18Core (python)python:3.11-slim / lint-pythonBackend services, API, and analysis tools
Node.js24.22.2Core (node)node:24 (lint-frontend, docs CI)Angular frontend & Docusaurus documentation
npm11.xBundled with Node 24Bundled with Node 24Frontend package management
uv0.13.7Aqua (uv)Used locallyUltra-fast Python package installation and .venv creation
yarn1.22.22npm:yarnnode:24-alpineDocumentation package management (docs/yarn.lock)
pre-commit4.7.0pipx:pre-commitCI linter jobsGit hook orchestration (Ruff, Codespell, Hadolint)

Python Environment (.venv)​

The repository configuration automatically manages a local virtual environment:

[env]
_.python.venv = { path = ".venv", create = true }
PYTHONPATH = "{{config_root}}/src"

Automatic Activation​

When you cd into firmware_vault, mise ensures .venv exists (creating it with uv if needed) and activates it in your current shell. Leaving the directory restores your shell's previous environment.

PYTHONPATH is automatically set to include the src/ directory, allowing local tools and Python scripts to import firmware_orm and core modules seamlessly.

Package Installation​

To install the consolidated Python dependencies, run:

mise run install:python

This task runs tests/integration/process_requirements.py to generate the deduplicated all_requirements.txt file and installs all requirements into .venv using uv pip install. This ensures your local development environment exactly matches the CI integration test container environment.

To add or test ad-hoc packages during development, you can use uv pip:

uv pip install <package-name>

Why Conda and Manual venvs are Deprecated​

Previous documentation suggested using Conda or manual python -m venv. These approaches are no longer recommended for the following reasons:

  • No manual activation overhead: mise manages .venv lifecycle automatically.
  • CI Parity: Conda uses separate binary package repositories that can drift from Debian/Alpine Linux wheels used in Docker containers and CI pipelines.
  • Licensing: Default Conda channels carry commercial restrictions in enterprise and academic settings; mise and uv rely entirely on standard PyPI wheels.

Task Reference​

Mise provides a built-in cross-platform task runner. Run mise tasks to list all available tasks:

TaskDescriptionCommand Executed
mise run setupInstall all dependencies and git hooksDepends on install:python, install:frontend, install:docs, hooks
mise run install:pythonInstall merged Python requirementsResolves all_requirements.txt and runs uv pip install
mise run install:frontendInstall Angular frontend dependenciesRuns npm ci in frontend/
mise run install:docsInstall Docusaurus docs dependenciesRuns yarn install --frozen-lockfile in docs/
mise run hooksInstall pre-commit Git hooksRuns pre-commit install
mise run lintRun all pre-commit hooks on all filesRuns pre-commit run --all-files (Ruff, Codespell, Hadolint)
mise run lint:frontendRun ESLint on the Angular frontendRuns npm run lint in frontend/
mise run configureGenerate config.json and .envRuns python configure --headless --developer_mode=y
mise run compose:upBuild and start Docker Compose stackRuns docker compose up -d --build in docker_compose_dir/
mise run compose:watchStart stack with file watchingRuns docker compose -f docker-compose.yaml -f compose.dev.yaml up --watch
mise run compose:downStop Docker Compose stackRuns docker compose down in docker_compose_dir/
mise run compose:rebuildRebuild and restart stackRuns compose:down followed by compose:up
mise run db:upStart MySQL and run migrations containerRuns docker compose up -d mysql_db db_migrations
mise run db -- <args>Run Alembic with .env variablesRuns alembic <args> with environment from docker_compose_dir/.env
mise run db:migrateApply database migrationsRuns alembic upgrade head
mise run db:revision "<msg>"Generate autogenerated migrationRuns alembic revision --autogenerate -m "<msg>"
mise run frontend:startStart Angular development serverRuns npm start in frontend/
mise run frontend:buildBuild Angular frontend for productionRuns npm run build in frontend/
mise run docs:startServe documentation locallyRuns yarn start in docs/ (port 3000)
mise run docs:buildBuild documentation bundleRuns yarn build in docs/

Upgrading Tools​

To check for newer versions of installed tools:

mise outdated

To upgrade pinned versions in mise.toml:

mise upgrade --bump
Maintain CI Parity

When upgrading tool versions in mise.toml (for example, upgrading Python or Node.js), make sure to update the corresponding Dockerfiles, CI image tags in .gitlab-ci.yml, and documentation to keep them consistent.


Personal Overrides (mise.local.toml)​

Developers can customize their local configuration using a local overrides file named mise.local.toml (or .mise.local.toml). This file is ignored by Git and will never be committed:

# mise.local.toml - local developer overrides (gitignored)
[env]
# Override database host for native local database instances
DATABASE_HOST = "127.0.0.1"

# Personal development tools
[tools]
ripgrep = "latest"
Do Not Commit Secrets

Never commit API tokens, passwords, or credentials into mise.toml. Store personal access tokens in your local environment, gitignored mise.local.toml, or your operating system's credential store.


Manual Setup (Without mise)​

If you cannot use mise, you can set up your development environment manually by ensuring the following software versions are installed on your system:

  • Python: 3.11.x
  • Node.js: 24.x (LTS) and npm: 11.x
  • yarn: 1.22.x
  • pre-commit: 4.7.x

Manual setup steps:

# 1. Create and activate Python virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate

# 2. Set PYTHONPATH to include src
export PYTHONPATH="$(pwd)/src" # On Windows: set PYTHONPATH=%CD%\src

# 3. Install Python requirements
pip install packaging
python tests/integration/process_requirements.py
pip install -r all_requirements.txt

# 4. Install frontend dependencies
cd frontend && npm ci && cd ..

# 5. Install docs dependencies
cd docs && yarn install --frozen-lockfile && cd ..

# 6. Install git hooks
pre-commit install