From 6fac92dd9d875384959b0ecd08800504fccfa9a9 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 1 Nov 2022 21:06:06 +0800 Subject: [PATCH] feat(whl): force import megbrain before import megengine GitOrigin-RevId: dc48c56b8ab6e581ba3fdf5665c426e1f452e986 --- imperative/python/test/run.sh | 5 +++-- scripts/whl/BUILD_PYTHON_WHL_README.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/imperative/python/test/run.sh b/imperative/python/test/run.sh index f8295a75..6132ad74 100755 --- a/imperative/python/test/run.sh +++ b/imperative/python/test/run.sh @@ -42,9 +42,10 @@ else cd $(dirname "${BASH_SOURCE[0]}")/.. test_dirs="megengine test" echo "test develop env" - PYTHONPATH="." PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'not isolated_distributed' + TEST_PY_PATH="." + PYTHONPATH=${TEST_PY_PATH} PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'not isolated_distributed' if [[ "$TEST_PLAT" =~ "cuda" ]]; then echo "test GPU pytest now" - PYTHONPATH="." PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'isolated_distributed' + PYTHONPATH=${TEST_PY_PATH} PY_IGNORE_IMPORTMISMATCH=1 python3 -m pytest -s -v $test_dirs -m 'isolated_distributed' fi fi diff --git a/scripts/whl/BUILD_PYTHON_WHL_README.md b/scripts/whl/BUILD_PYTHON_WHL_README.md index 9bfdc265..daa8ba4d 100755 --- a/scripts/whl/BUILD_PYTHON_WHL_README.md +++ b/scripts/whl/BUILD_PYTHON_WHL_README.md @@ -98,4 +98,4 @@ If you do not want to create whl file when debug Python3 binding, you can call ` * cuda with `RelWithDebInfo` mode: `EXTRA_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo" scripts/cmake-build/host_build.sh -c -t` * cpu only with `RelWithDebInfo` mode: `EXTRA_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo" scripts/cmake-build/host_build.sh -t` -Start `Python3 ` with env for support `MegEngine` after build: `PYTHONPATH=imperative/python:$PYTHONPATH python3 ` +Start `Python3 ` with env for support `MegEngine` after build: `PYTHONPATH=imperative/python:python_module:$PYTHONPATH python3 `