Skip to content

Commit de8974a

Browse files
authored
[docs] add guide on using python venv for cp-caps test (openthread#11520)
Added comprehensive Python virtual environment setup guide to the cp-caps README.md file. This includes detailed sections for creation, activation, dependency installation, and deactivation of virtual environments to help users properly set up their testing environment and avoid package conflicts.
1 parent 0239041 commit de8974a

1 file changed

Lines changed: 39 additions & 8 deletions

File tree

tools/cp-caps/README.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ This test is used for testing RCP capabilities.
2020
- DUT : The device under test.
2121
- Reference Device : The device that supports all tested features.
2222

23-
### Python Dependences
24-
25-
Before running the test script on PC, testers should install dependences first.
26-
27-
```bash
28-
$ pip3 install -r ./tools/cp-caps/requirements.txt ./tools/otci
29-
```
30-
3123
### Reference Device
3224

3325
The [nRF52840DK][ot-nrf528xx-nrf52840] is set as the reference device by default. Testers can also select the other Thread device as the reference device.
@@ -47,6 +39,45 @@ $ nrfutil device program --firmware ot-cli-ftd.hex --options chip_erase_mode=ERA
4739
$ nrfutil device reset --reset-kind=RESET_PIN
4840
```
4941

42+
## Python Virtual Environment Setup
43+
44+
It is recommended to use a Python virtual environment to manage project dependencies and avoid conflicts with system-wide packages.
45+
46+
### Creation
47+
48+
Create a virtual environment named `.venv` in the project directory:
49+
50+
```bash
51+
$ cd openthread
52+
$ python3 -m venv .venv
53+
```
54+
55+
### Activation
56+
57+
Activate the virtual environment using the following command:
58+
59+
```bash
60+
$ source .venv/bin/activate
61+
```
62+
63+
After activation, your shell prompt should indicate that you are working within the virtual environment.
64+
65+
### Dependency Installation
66+
67+
Once the virtual environment is activated, install the required dependencies using `pip`:
68+
69+
```bash
70+
$ pip3 install -r ./tools/cp-caps/requirements.txt ./tools/otci
71+
```
72+
73+
### Deactivation
74+
75+
When you are finished working in the virtual environment, you can deactivate it by running the following command. This will return you to your system's global Python environment.
76+
77+
```bash
78+
$ deactivate
79+
```
80+
5081
## Test Commands
5182

5283
### Help Info

0 commit comments

Comments
 (0)