diff options
author | Tom Rini <trini@konsulko.com> | 2025-04-15 12:10:26 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-04-24 15:37:27 -0600 |
commit | efd00b03455644b18eaf2b6dcd07f6d55b95b39e (patch) | |
tree | 037d898da2753ccf92134099cc643e51b7b3d38d /doc/develop | |
parent | 10f48365112b164bee6564033ab682747efcb483 (diff) |
python: Use and refer to the venv module rather than virtualenv
Using some form of sandbox with Python modules is a long standing best
practice with the language. There are a number of ways to have a Python
sandbox be created. At this point in time, it seems the Python community
is moving towards using the "venv" module provided with Python rather
than a separate tool. To match that we make the following changes:
- Refer to a "Python sandbox" rather than virtualenv in comments, etc.
- Install the python3-venv module in our container and not virtualenv.
- In our CI files, invoke "python -m venv" rather than "virtualenv".
- In documentation, tell users to install python3-venv and not
virtualenv.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'doc/develop')
-rw-r--r-- | doc/develop/py_testing.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/develop/py_testing.rst b/doc/develop/py_testing.rst index 502053f09fc..217ae447035 100644 --- a/doc/develop/py_testing.rst +++ b/doc/develop/py_testing.rst @@ -69,19 +69,19 @@ To create disk images we have helper functions located in `test/py/tests/fs_helper.py` which shall be used in any tests that require creating disk images. -Using `virtualenv` to provide requirements -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Using a Python sandbox to provide requirements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The recommended way to run the test suite, in order to ensure reproducibility -is to use `virtualenv` to set up the necessary environment. This can be done -via the following commands: +is to use a Python sandbox such as `python -m venv` to set up the necessary +environment. This can be done via the following commands: .. code-block:: console $ cd /path/to/u-boot - $ sudo apt-get install python3 python3-virtualenv - $ virtualenv -p /usr/bin/python3 venv + $ sudo apt-get install python3 python3-venv + $ python3 -m venv venv $ . ./venv/bin/activate $ pip install -r test/py/requirements.txt |