diff --git a/slave.mk b/slave.mk index 95b7aeda38..bb72a4a36f 100644 --- a/slave.mk +++ b/slave.mk @@ -924,8 +924,13 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA ifneq ($(CROSS_BUILD_ENVIRON),y) # Use pip instead of later setup.py to install dependencies into user home, but uninstall self pip$($*_PYTHON_VERSION) install . && pip$($*_PYTHON_VERSION) uninstall --yes `python$($*_PYTHON_VERSION) setup.py --name` +ifeq ($(BLDENV),bookworm) + if [ ! "$($*_TEST)" = "n" ]; then pip$($*_PYTHON_VERSION) install ".[testing]" && pip$($*_PYTHON_VERSION) uninstall --yes `python$($*_PYTHON_VERSION) setup.py --name` && python$($*_PYTHON_VERSION) -m pytest $(LOG); fi + python$($*_PYTHON_VERSION) -m build -n $(LOG) +else if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) +endif else { export PATH=$(VIRTENV_BIN_CROSS_PYTHON$($*_PYTHON_VERSION)):${PATH}