From abd729ee19dfd3d061641cff555d4d6c7cc809d4 Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Thu, 23 Jul 2026 18:46:01 +0200 Subject: [PATCH 1/4] Use python-build for package artifacts Replace direct setup.py invocations with python -m build for DALI wheels and\nsource distributions. Preserve existing wheel configuration through backend\nconfig settings and avoid isolated dependency resolution in container builds. Signed-off-by: Janusz Lisiecki --- dali_tf_plugin/make_dali_tf_sdist.sh | 2 +- docker/build_helper.sh | 10 +++++----- plugins/video/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dali_tf_plugin/make_dali_tf_sdist.sh b/dali_tf_plugin/make_dali_tf_sdist.sh index 36e3e642547..c623883b13e 100644 --- a/dali_tf_plugin/make_dali_tf_sdist.sh +++ b/dali_tf_plugin/make_dali_tf_sdist.sh @@ -18,7 +18,7 @@ cmake .. \ -DTIMESTAMP=${DALI_TIMESTAMP} \ -DGIT_SHA=${GIT_SHA} make -j install -python setup.py sdist +python -m build --sdist --no-isolation mkdir -p /dali_tf_sdist cp dist/*.tar.gz /dali_tf_sdist popd diff --git a/docker/build_helper.sh b/docker/build_helper.sh index 99420987661..7ff57aef184 100755 --- a/docker/build_helper.sh +++ b/docker/build_helper.sh @@ -143,11 +143,11 @@ if [ "${BUILD_PYTHON}" = "ON" ]; then # use stored as a compression method to make it faster as bundle-wheel.sh need to repack anyway # call setup.py to avoid slow copy to tmp dir pushd dali/python - python setup.py bdist_wheel \ - --verbose \ - --compression=stored \ - --python-tag=py3 \ - --plat-name=${WHL_PLATFORM_NAME} + python -m build --wheel --no-isolation \ + -C--global-option=--verbose \ + -C--global-option=--compression=stored \ + -C--global-option=--python-tag=py3 \ + -C--global-option="--plat-name=${WHL_PLATFORM_NAME}" popd mv dali/python/dist/*.whl ./ diff --git a/plugins/video/CMakeLists.txt b/plugins/video/CMakeLists.txt index 49420ef28d2..03006d8ad63 100644 --- a/plugins/video/CMakeLists.txt +++ b/plugins/video/CMakeLists.txt @@ -33,7 +33,7 @@ add_custom_command( TARGET dali-plugin-video POST_BUILD WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pkg_src - COMMAND ${PYTHON_EXECUTABLE} setup.py sdist) + COMMAND ${PYTHON_EXECUTABLE} -m build --sdist --no-isolation) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pkg_src/dist DESTINATION . FILES_MATCHING PATTERN "*.tar.gz") From 64acf0db2c166a6d3eb60c68a91b049bc74ff9b2 Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Thu, 23 Jul 2026 18:59:38 +0200 Subject: [PATCH 2/4] Fix python-build wheel options Pass bdist_wheel options as backend build options and update the stale build comment. Signed-off-by: Janusz Lisiecki --- docker/build_helper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/build_helper.sh b/docker/build_helper.sh index 7ff57aef184..2df702c57a2 100755 --- a/docker/build_helper.sh +++ b/docker/build_helper.sh @@ -141,13 +141,13 @@ bundle_wheel() { if [ "${BUILD_PYTHON}" = "ON" ]; then # use stored as a compression method to make it faster as bundle-wheel.sh need to repack anyway - # call setup.py to avoid slow copy to tmp dir + # avoid isolated venv creation and use dependencies already installed in the image pushd dali/python python -m build --wheel --no-isolation \ -C--global-option=--verbose \ - -C--global-option=--compression=stored \ - -C--global-option=--python-tag=py3 \ - -C--global-option="--plat-name=${WHL_PLATFORM_NAME}" + -C--build-option=--compression=stored \ + -C--build-option=--python-tag=py3 \ + -C--build-option="--plat-name=${WHL_PLATFORM_NAME}" popd mv dali/python/dist/*.whl ./ From c64e9a48bb2cdfe13404347327e4b1cfe7e3ea45 Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Thu, 23 Jul 2026 23:40:06 +0200 Subject: [PATCH 3/4] Install build module for plugin sdists Signed-off-by: Janusz Lisiecki --- docker/Dockerfile.make_sdist_plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.make_sdist_plugins b/docker/Dockerfile.make_sdist_plugins index b14baeac24c..a9635f1b156 100644 --- a/docker/Dockerfile.make_sdist_plugins +++ b/docker/Dockerfile.make_sdist_plugins @@ -4,7 +4,7 @@ FROM ${BASE_IMAGE} ARG DEBIAN_FRONTEND=noninteractive RUN apt update && apt install -y python3 python3-pip build-essential git wget && \ - python3 -m pip install "setuptools>=70" scikit-build && \ + python3 -m pip install "setuptools>=70" build scikit-build && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /root/.cache/pip/ From 0af6507341e33d9dec9c2ff14037073c4826be27 Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Fri, 24 Jul 2026 06:47:12 +0200 Subject: [PATCH 4/4] Allow plugin sdist metadata without DALI Signed-off-by: Janusz Lisiecki --- plugins/setup.py.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/setup.py.in b/plugins/setup.py.in index 09cee5807e5..6633f8146e0 100644 --- a/plugins/setup.py.in +++ b/plugins/setup.py.in @@ -47,7 +47,8 @@ def require(req_spec: str) -> None: sys.exit(1) if __name__ == "__main__": - if len(sys.argv) > 1 and sys.argv[1] != 'sdist': + # PEP 517 uses egg_info to query requirements before creating an sdist. + if len(sys.argv) > 1 and sys.argv[1] not in ('sdist', 'egg_info'): try: os.environ['DALI_PRELOAD_PLUGINS'] = "" # no need to load plugins import nvidia.dali as dali