Python Environment, Installation, CLI, Editors, and First Suite: Configuration, Design Patterns, and Trade-Offs
Choose environment, dependency, launcher, and editor strategies deliberately, comparing standard venv/pip with uv, exact pins with ranges, and shared configuration with local-only settings.
Learning objectives
- Compare venv/pip and uv without confusing tool choice with Robot semantics.
- Choose between global and project-isolated installations using reproducibility criteria.
- Reason about exact pins, compatible ranges, and lock evidence.
- Choose an authoritative CLI/editor configuration boundary.
- Account for current RobotCode requirements and built-in Testdoc deprecation.
Design principle. Reproducibility is an invariant,
not a particular tool. A
venv + requirements.txt project, a uv-managed project,
or another manager can all be valid if interpreter selection,
dependency resolution, execution, and artifacts are explicit and
reconstructible.
1. Configuration choices solve different problems
Environment tooling is often debated as if one command determines project quality. It does not. The important design questions are: Who chooses Python? Where are dependencies declared? Are resolved versions reproducible? Which command is authoritative locally and in CI? What editor configuration is shared, and what remains personal?
This lesson compares those decisions without requiring learners to
install every tool. The mandatory path remains the standard-library
venv plus pip because it is available wherever
supported Python is available.
2. Standard venv versus uv-managed environments
| Dimension | venv + pip |
uv |
|---|---|---|
| Environment creation | python -m venv .venv |
uv venv or project-managed environment |
| Dependency installation | python -m pip install ... |
uv pip install ... or higher-level project
commands
|
| Tool dependency | Uses Python standard library + pip. | Requires the separate uv executable. |
| Locking/project workflow | Needs an explicit requirements/constraints/lock strategy chosen by the team. |
uv project mode provides project metadata, lock/sync, and
uv run.
|
| Best teaching value | Makes Python interpreter/package relationships very visible. | Shows a modern project manager that can enforce environment synchronization. |
Current uv documentation creates a default .venv with
uv venv and can install an exact package with
uv pip install 'robotframework==7.4.2'. In project
mode, uv run checks that the environment is
synchronized with project/lock data before execution. Those are
useful properties, but they do not change Robot Framework's own
execution semantics.
# Optional alternative, not required for the chapter
uv venv
uv pip install 'robotframework==7.4.2'
uv run --with 'robotframework==7.4.2' robot --version
Do not mix low-level and project-managed uv workflows casually. If a team adopts uv project mode, follow uv's project dependency commands and lockfile conventions rather than manually mutating the managed environment.
3. Global install versus project isolation
A global Robot Framework install can be convenient for one-off personal experiments, but it creates hidden coupling between unrelated projects. Upgrading one global package may change all projects at once. It also weakens CI reproducibility because a clean runner starts without that workstation history.
Global install
Useful only when the environment itself is intentionally disposable or controlled, such as some container images. Record the interpreter and package versions explicitly.
Project isolation
Preferred for development. The project owns dependency declarations while each workstation recreates its environment.
Do not treat pip install --user or a machine-wide
robot launcher as a project dependency strategy.
4. Exact pins versus compatible ranges
This course pins robotframework==7.4.2 because a
teaching lab should behave the same next week and because the
current pre-release must not be pulled accidentally. Product
projects may choose compatible ranges during dependency declaration,
but deployment or CI should still have a resolved, reviewable
version set.
| Strategy | Example | Benefit | Risk / mitigation |
|---|---|---|---|
| Exact pin | robotframework==7.4.2 |
Highly reproducible lab and incident replay. | Requires deliberate upgrade cadence. |
| Compatible range | robotframework>=7.4,<7.5 |
Allows bug-fix resolution. | Fresh installs can resolve differently; pair with lock/constraints and evidence. |
| Floating latest | robotframework |
Minimal declaration. | Not acceptable for reproducible course/CI examples because behavior can change over time. |
Never use a pre-release in a mandatory lab unless the lesson explicitly targets that pre-release and provides a stable fallback.
5. python -m robot versus the
robot launcher
For local development inside an activated environment,
robot is concise and conventional. For diagnostics,
bootstrap scripts, and documentation that must prove interpreter
ownership, python -m robot is clearer. CI can use
either, provided the job constructs the environment
deterministically and records versions.
A useful production convention is to make one repository command authoritative—perhaps a Make target, task runner command, PowerShell script, or documented module invocation—then have editors and CI call the same underlying command or configuration rather than duplicating flags independently.
6. IDE convenience versus CLI reproducibility
Editor integrations can discover tests, provide completion, linting, navigation, debug execution, and environment selection. They should not create a second invisible configuration universe. The learner should always be able to leave the editor, open a clean shell, recreate the environment, and run the same suite.
Current RobotCode boundary. Robot Framework 7.4.2 supports Python 3.8+, while current RobotCode requires Python 3.10+. If a project deliberately targets Python 3.8 or 3.9, choose an editor/tool version compatible with that policy or run editor tooling in a separate supported environment. Do not misdiagnose an editor requirement as a Robot Framework core requirement.
Current RobotCode encourages selecting a Python environment rather than hard-coding an extension-specific absolute interpreter path. Keep machine-specific paths out of shared repository configuration.
7. Committed configuration versus local-only settings
| Configuration | Usually committed? | Reason |
|---|---|---|
requirements.txt, lockfile,
pyproject.toml
|
Yes | Defines reproducible project dependencies. |
Robot project config such as shared robot.toml
|
Yes when adopted by the team | Can standardize paths, variables, profiles, and run options. |
Local override such as .robot.toml when
supported
|
Normally no | Personal machine/editor overrides. |
.venv/ |
No | Platform/runtime artifact recreated from dependency inputs. |
| Absolute interpreter path in a home directory | No | Machine-specific and often leaks usernames/workstation layout. |
| Secrets/tokens | No | Use secret stores or protected environment injection. |
8. Tool deprecations belong in environment design
Robot Framework 7.4.2 deprecated the built-in Testdoc tool in favor of the enhanced external Testdoc project. The built-in implementation still works in 7.4.2, but the release notes state that deprecation warnings begin in 7.5 and removal is planned for Robot Framework 8.0. New course workflows should therefore avoid building automation around the built-in Testdoc command.
This is a broader lesson: environment design must track not only the core framework version but also tool lifecycle. A pinned environment can be perfectly reproducible and still be strategically obsolete if it pins a deprecated workflow forever.
9. Worked decision table
| Scenario | Recommended baseline | Why |
|---|---|---|
| Beginner course lab |
Python 3.12 + venv + exact RF 7.4.2 pin +
explicit python -m robot
|
Few moving parts; ownership is visible. |
| Team adopting uv |
uv project/lock workflow + reviewed RF pin/range +
uv run
|
Central project metadata and lock/sync behavior. |
| Developer wants RobotCode | Project environment Python 3.10+ + selected interpreter + CLI baseline | Satisfies current editor runtime while preserving shell reproducibility. |
| CI container | Image with pinned/recorded Python + installed lock set + explicit result mount | Environment is intentionally controlled; no interactive activation needed. |
| Legacy Python 3.8/3.9 target | RF-compatible environment; verify every external tool separately | Core framework support does not imply current ecosystem-tool support. |
10. Security and privacy implications
Package indexes, proxy configuration, editor settings, and shell
histories can carry credentials. Do not place private-index tokens
in requirements.txt, example URLs, or command history.
Avoid publishing absolute home-directory paths in logs when they
expose usernames or internal directory structure. Result artifacts
can also capture arguments and environment-derived values; Chapter
23 treats secrets in depth.
The environment itself should be replaceable. If a dependency installation is suspected of tampering or corruption, recreating the isolated environment from reviewed dependency inputs is safer than manually editing installed files.
Environment choices also affect evidence handling: regardless of
whether the run is launched through venv, uv, an editor, or CI, keep
output.xml, log.html, and
report.html in an explicit result location so tool
choice does not change the evidence contract.
11. Knowledge check
Is uv required to run Robot Framework?
No. uv is an optional environment/project manager. Robot
Framework requires a supported Python runtime; the course
baseline uses standard venv and pip.
Why can an exact pin still need an upgrade policy?
A pin reproduces a version; it does not keep that version secure, supported, or compatible forever. Upgrades should be deliberate and tested.
Should an editor's personal absolute interpreter path be committed?
Normally no. It is machine-specific and can break teammates/CI or expose local path information.
Why should new workflows avoid the built-in Testdoc tool?
Robot Framework 7.4.2 deprecated it in favor of the external Testdoc project, with warnings planned in 7.5 and removal in 8.0.
12. Summary and next step
Choose environment tools by invariants: explicit interpreter, isolated dependencies, reviewable version inputs, reproducible execution, portable editor configuration, and retained artifacts. Lesson 4 uses those invariants to diagnose command, interpreter, path, permission, encoding, and CI-portability failures without guessing.
Further reading and current primary references
Version-sensitive statements in this lesson were checked on 2026-08-30. The mandatory path pins Robot Framework 7.4.2, the current stable release at the time of authoring. Robot Framework 7.5b1 is a pre-release and is not required. Robot Framework itself requires Python 3.8+; the current RobotCode toolchain has a stricter Python 3.10+ runtime requirement, so editor compatibility must be checked separately from framework compatibility.
- Robot Framework on PyPI — installation, Python requirement, release history
- Robot Framework 7.4.2 User Guide
- Robot Framework 7.4.2 release notes
- Python documentation — venv
- pip User Guide
- uv documentation — virtual environments
- RobotCode — current getting-started and environment guidance
- RobotCode project — current runtime requirements and configuration model
- External Testdoc — replacement for the deprecated built-in Testdoc
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.