Skip to content

Commit

Permalink
Changed CI to use requirements_build.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Aug 15, 2024
1 parent e948617 commit 4d25267
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ concurrency:

env:
PIP_VER: "23.2.1"
WHEEL_VER: "0.38.4"
STOOLS_VER: "67.3.2"
JEDI_VER: "0.17.2" # https://github.com/ipython/ipython/issues/12740
IDNA_VER: "2.8" # https://github.com/psf/requests/issues/5710
SRC_DIR: "D:\\a\\open3d\\open3d"
Expand Down Expand Up @@ -217,11 +215,9 @@ jobs:
working-directory: ${{ env.BUILD_DIR }}
run: |
$ErrorActionPreference = 'Stop'
python -m pip install --upgrade pip==${{ env.PIP_VER }} `
wheel==${{ env.WHEEL_VER }} `
setuptools==${{ env.STOOLS_VER }} `
jedi==${{ env.JEDI_VER }} `
idna==${{ env.IDNA_VER }}
python -m pip install -U pip==${{ env.PIP_VER }}
python -m pip install -U -r python/requirements_build.txt
python -m pip install -U jedi==${{ env.JEDI_VER }} idna==${{ env.IDNA_VER }}
cmake --build . --config ${{ matrix.CONFIG }} --target install-pip-package
- name: Import python package
# If BUILD_SHARED_LIBS == ON, Open3D.dll needs to be copied, which is not recommended for python.
Expand Down Expand Up @@ -298,9 +294,8 @@ jobs:
working-directory: ${{ env.BUILD_DIR }}
run: |
$ErrorActionPreference = 'Stop'
python -m pip install --upgrade pip==${{ env.PIP_VER }} `
wheel==${{ env.WHEEL_VER }} `
setuptools==${{ env.STOOLS_VER }}
python -m pip install -U pip==${{ env.PIP_VER }}
python -m pip install -U -r python/requirements_build.txt
cmake --build . --parallel ${{ env.NPROC }} --config Release --target pip-package
$PIP_PKG_NAME=(Get-ChildItem lib/python_package/pip_package/open3d*.whl).Name
echo "PIP_PKG_NAME=$PIP_PKG_NAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand Down Expand Up @@ -362,9 +357,8 @@ jobs:
python -m venv open3d_test_venv
open3d_test_venv\Scripts\Activate.ps1
python -m pip install --upgrade pip==${{ env.PIP_VER }} `
wheel==${{ env.WHEEL_VER }} `
setuptools==${{ env.STOOLS_VER }}
python -m pip install -U pip==${{ env.PIP_VER }}
python -m pip install -U -r python/requirements_build.txt
python -m pip install -U -r python/requirements_test.txt
$py_tag=(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')")
if (Test-Path -Path "pip_package") {
Expand Down
22 changes: 8 additions & 14 deletions util/ci_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ TORCH_VER="2.0.1"
TORCH_REPO_URL="https://download.pytorch.org/whl/torch/"
# Python
PIP_VER="23.2.1"
WHEEL_VER="0.38.4"
STOOLS_VER="67.3.2"
YAPF_VER="0.30.0"
PROTOBUF_VER="4.24.0"

OPEN3D_INSTALL_DIR=~/open3d_install
Expand All @@ -42,10 +39,10 @@ install_python_dependencies() {

echo "Installing Python dependencies"
options="$(echo "$@" | tr ' ' '|')"
python -m pip install --upgrade pip=="$PIP_VER" wheel=="$WHEEL_VER" \
setuptools=="$STOOLS_VER"
python -m pip install --upgrade pip=="$PIP_VER"
python -m pip install -U -r "${OPEN3D_SOURCE_ROOT}/python/requirements_build.txt"
if [[ "with-unit-test" =~ ^($options)$ ]]; then
python -m pip install -U -r python/requirements_test.txt
python -m pip install -U -r "${OPEN3D_SOURCE_ROOT}/python/requirements_test.txt"
fi
if [[ "with-cuda" =~ ^($options)$ ]]; then
TF_ARCH_NAME=tensorflow
Expand All @@ -64,7 +61,6 @@ install_python_dependencies() {
TORCH_GLNX="torch==${TORCH_VER}+cpu"
fi

# TODO: modify other locations to use requirements.txt
python -m pip install -r "${OPEN3D_SOURCE_ROOT}/python/requirements.txt"
if [[ "with-jupyter" =~ ^($options)$ ]]; then
python -m pip install -r "${OPEN3D_SOURCE_ROOT}/python/requirements_jupyter_build.txt"
Expand All @@ -88,7 +84,6 @@ install_python_dependencies() {
fi
fi
if [ "$BUILD_TENSORFLOW_OPS" == "ON" ] || [ "$BUILD_PYTORCH_OPS" == "ON" ]; then
python -m pip install -U yapf=="$YAPF_VER"
# Fix Protobuf compatibility issue
# https://stackoverflow.com/a/72493690/1255535
# https://github.com/protocolbuffers/protobuf/issues/10051
Expand Down Expand Up @@ -241,8 +236,8 @@ test_wheel() {
python -m venv open3d_test.venv
# shellcheck disable=SC1091
source open3d_test.venv/bin/activate
python -m pip install --upgrade pip=="$PIP_VER" wheel=="$WHEEL_VER" \
setuptools=="$STOOLS_VER"
python -m pip install -U pip=="$PIP_VER"
python -m pip install -U -r "${OPEN3D_SOURCE_ROOT}/python/requirements_build.txt"
echo -n "Using python: $(command -v python)"
python --version
echo -n "Using pip: "
Expand Down Expand Up @@ -283,7 +278,7 @@ test_wheel() {
run_python_tests() {
# shellcheck disable=SC1091
source open3d_test.venv/bin/activate
python -m pip install -U -r python/requirements_test.txt
python -m pip install -U -r "${OPEN3D_SOURCE_ROOT}/python/requirements_test.txt"
echo Add --randomly-seed=SEED to the test command to reproduce test order.
pytest_args=("$OPEN3D_SOURCE_ROOT"/python/test/)
if [ "$BUILD_PYTORCH_OPS" == "OFF" ] && [ "$BUILD_TENSORFLOW_OPS" == "OFF" ]; then
Expand Down Expand Up @@ -354,9 +349,8 @@ install_docs_dependencies() {
echo Install Python dependencies for building docs
command -v python
python -V
python -m pip install -U -q "wheel==$WHEEL_VER" \
"pip==$PIP_VER"
python -m pip install -U -q "yapf==$YAPF_VER"
python -m pip install -U -q "pip==$PIP_VER"
python -m pip install -U -r "${OPEN3D_SOURCE_ROOT}/python/requirements_build.txt"
if [[ -d "$1" ]]; then
OPEN3D_ML_ROOT="$1"
echo Installing Open3D-ML dependencies from "${OPEN3D_ML_ROOT}"
Expand Down

0 comments on commit 4d25267

Please sign in to comment.