[Feature][Docs] Add Python-only quick install mode (BUILD_WHEEL=2) to build.sh (#6503)

* add pythononly func

* add

* add more feature

* add safe check

* add rsync check

* add

* add

* refine docs

* add installation

* add installation
This commit is contained in:
gongweibao
2026-02-26 16:17:41 +08:00
committed by GitHub
parent 47bfd45bb6
commit 2541462f7e
5 changed files with 278 additions and 1 deletions
@@ -125,6 +125,44 @@ After the build completes, the operator binaries can be found in `FastDeploy/fas
> - For custom architectures or modified operator logic, please use **source compilation (Section 4)**.
> - You can check whether the precompiled wheel for a specific commit has been successfully built on the [FastDeploy CI Build Status Page](https://github.com/PaddlePaddle/FastDeploy/actions/workflows/ci_image_update.yml).
## 6. Python-only Quick Install (For Development)
If you have already completed a full build (`bash build.sh 1 ...`) and only modified Python files, you can use the python-only mode to quickly sync changes to `site-packages` **without recompiling C++ Custom Ops or rebuilding the wheel**.
### Prerequisites
A full build must have been completed at least once:
```shell
bash build.sh 1 python false [80,90]
```
### Usage
```shell
# Argument 1: Must be 2 to enable python-only mode
# Argument 2 (optional): Python interpreter path (default: python)
# Use default python
bash build.sh 2
# Use a specific python interpreter
bash build.sh 2 python3
# Use an absolute path to the interpreter
bash build.sh 2 /path/to/your/python
```
This command syncs `.py` files from the source tree directly into the installed `site-packages/fastdeploy/` directory via `rsync`. Compiled artifacts (`.so` files) are preserved.
### When to Use
| Scenario | Recommended Command |
|---|---|
| Only modified Python files | `bash build.sh 2` |
| Modified C++/CUDA code | `bash build.sh 1 python false [80,90]` |
| First-time build | `bash build.sh 1 python false [80,90]` |
## Environment Verification
After installation, verify the environment with this Python code: