Skip to content

Make vmnet Python package installable with pip #175

@nirs

Description

@nirs

Make the vmnet Python package installable with pip install -e . to simplify the developer experience. Currently users need to manually create a venv, install dependencies, and source the venv before running scripts.

Current workflow

python3 -m venv .venv
source .venv/bin/activate
pip install pytest scapy pyyaml black
./example server

Proposed workflow

./bootstrap.sh       # creates venv and installs everything (run once)
source venv          # enter the venv (each new terminal)
pytest               # run tests
vmnet run server     # run vm named "server"

bootstap script

python3 -m venv .venv
ln -sf .venv/bin/activate venv
source venv 
pip install -e ".[dev]"

After bootstrap, the user just needs source venv in new terminals, then all tools are available (pytest, vmnet run, vmnet bench).

Changes needed

  • Add package metadata and entry points to pyproject.toml
  • Add dependency groups (core: pyyaml, dev: pytest scapy black, bench: matplotlib numpy)
  • Create a CLI entry point (vmnet) with subcommands (run, bench)
  • Update CI to use pip install -e ".[dev]"
  • Update README with simplified setup instructions

Benefits

  • Single install command sets up everything
  • Easier source command
  • Dependencies are declared in one place (pyproject.toml)
  • Standard Python packaging — familiar to contributors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions