Skip to content

Installation

Installation

The repository has a dev container with everything needed to develop the CLI, .devcontainer/bmde-dev/, on the aleixmt/bmde-dev image: the full development environment of the BMDE (aleixmt/bmde-full, every NDS tool) plus Python, the packages of the integration tests and a Docker client that uses the Docker of your computer (Docker outside of Docker), so the docker backend of the CLI and the integration tests work inside it and share the images of your computer.

  1. Clone the repository and open it in VS Code, with the Dev Containers extension.
  2. Run Dev Containers: Reopen in Container and choose BMDE: bmde CLI development. On creation it checks out the submodules and runs make dev.
  3. Run make lint, make test or make run CMD="--help" in its terminal.

Graphical programs open in the X server of the host, like in the dev container of the students. The Docker daemon of your computer looks for the paths the CLI and the tests mount in your computer, not in the container, so the project is mounted at the same path as in your computer and the temporary files go to its tmp/ (TMPDIR, ignored by git). That is why this dev container is meant for Linux hosts (or WSL 2). Git worktrees can't be opened in it (their .git points to a path of the host).

The other configuration, BMDE: NDS development (.devcontainer/nds/), is the template for the projects of the students.

In your computer

You need Python 3.11+, git, make and Docker.

  1. Clone the repository with its submodules
    git clone --recurse-submodules https://github.com/URV-teacher/bmde
    cd bmde
    
  2. Create the virtual environment in venv/ and install the package, the development dependencies and the pre-commit hooks
    make dev
    
  3. Check that the CLI works
    ./venv/bin/bmde --help
    

The bmde command from your checkout

make dev installs the package in venv/ in editable mode, so ./venv/bin/bmde always runs the code of the checkout: the branch that is checked out, with your changes. To use it as the bmde command of your PATH (e.g. in your NDS projects), install the checkout in editable mode with pipx too:

pipx install --editable .   # pipx uninstall bmde to go back to the published one

The docker backend runs the published images of the components (latest, for a development version), which it pulls on every run, not the ones built from your checkout of components/ (see images).