Fix #910: Use python venv for macOS build

With this commit macOS build starts using Python virtual environment so
that our build steps can comply with PEP 668 [1].

This is only about the build procedure. There must be no behavior change
in the build artifacts.

#codehealth

 [1]: https://peps.python.org/pep-0668/

PiperOrigin-RevId: 621123606
This commit is contained in:
Yohei Yukawa
2024-04-02 10:59:27 +00:00
committed by Hiroyuki Komatsu
parent 9c5fc40cba
commit e8d25a2bee
3 changed files with 49 additions and 12 deletions

View File

@@ -9,11 +9,14 @@ If you are not sure what the following commands do, please check the description
and make sure the operations before running them.
```
python3 -m pip install requests
git clone https://github.com/google/mozc.git
cd mozc/src
export PYTHON_VENV_ROOT=${PWD}/python-venv
python3 -m venv ${PYTHON_VENV_ROOT}
source ${PYTHON_VENV_ROOT}/bin/activate
python3 -m pip install requests
python3 build_tools/update_deps.py
# CMake is also required to build Qt.
@@ -62,6 +65,19 @@ cd mozc/src
Hereafter you can do all the operations without changing directory.
### Set up and enable Python virtual environment
The following commands set up Python virtual environment under `mozc/src/python-venv`.
```
export PYTHON_VENV_ROOT=${PWD}/python-venv
python3 -m venv ${PYTHON_VENV_ROOT}
source ${PYTHON_VENV_ROOT}/bin/activate
python3 -m pip install requests
```
Using `mozc/src/python-venv` as the virtual environment location is not mandatory. Any other location should also work.
### Check out additional build dependencies
```