Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:MarketSquare Robotframework browser Development Environment Setup

From Leeroopedia

Overview

The robotframework-browser project requires both Python and Node.js toolchains to develop, build, and test. Setting up a reproducible development environment is the first step for any contributor. The project provides a bootstrap script that automates virtual environment creation and dependency installation, ensuring every developer works with a consistent set of tools and versions.

Core Concept

A reproducible development environment means that every developer, regardless of their system-level Python or Node.js installation, works within an isolated and consistent set of dependencies. The key mechanisms are:

  • Python virtual environment (venv) -- Isolates Python packages from the system installation, preventing version conflicts
  • uv -- A fast Python package installer (written in Rust) that replaces pip install for speed, used to install both development and project dependencies
  • npm -- The Node.js package manager, used separately (via inv deps) for Node.js dependencies

Bootstrap Process

The bootstrap script performs these steps in sequence:

  1. Check for existing virtual environment -- If .venv/ already exists, skip creation
  2. Create virtual environment -- Uses Python's built-in venv.EnvBuilder with pip enabled
  3. Install uv -- Upgrades pip and installs the uv package installer into the virtual environment
  4. Install development dependencies -- Uses uv pip install with Browser/dev-requirements.txt
  5. Install project dependencies -- Uses uv pip install with pyproject.toml
  6. Print activation instructions -- Displays the OS-appropriate command to activate the virtual environment

Dependency Categories

The project has two distinct sets of Python dependencies:

Category Source File Contents
Development dependencies Browser/dev-requirements.txt Testing tools (pytest, robotstatuschecker, pabot), linting (ruff, mypy), build tools (invoke, build, twine), and other development utilities
Project dependencies pyproject.toml Runtime dependencies of the Browser library itself (robotframework, grpcio, etc.)

Node.js dependencies are defined in package.json and package-lock.json and are installed separately via the inv deps task.

Platform Awareness

The bootstrap script is platform-aware:

  • On Unix/macOS: The virtual environment Python is at .venv/bin/python and activation is source .venv/bin/activate
  • On Windows: The virtual environment Python is at .venv/Scripts/python.exe and activation is .venv\Scripts\activate.bat

Why uv Instead of pip

The project uses uv for dependency installation because:

  • It is significantly faster than pip for resolving and installing packages
  • It supports the same requirements file formats and pyproject.toml
  • It provides the --system flag for CI environments where virtual environments are not used
  • It is installed as a pip package itself, so it can be bootstrapped from any Python environment

Domains

  • Development_Tooling -- The bootstrap script is a developer productivity tool
  • Environment_Management -- Virtual environments provide dependency isolation

Implemented By

Related Topics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment