Skip to content

Commit

Permalink
Add PYTHON3_SWSSCOMMON as build time dependency to Mellanox platform …
Browse files Browse the repository at this point in the history
…API (#13847)

- Why I did it
Add PYTHON3_SWSSCOMMON as build time dependency to Mellanox platform API to avoid issue like:

19:34:11  ImportError while loading conftest '/sonic/platform/mellanox/mlnx-platform-api/tests/conftest.py'.
19:34:11  tests/conftest.py:28: in <module>
19:34:11      from sonic_platform import utils
19:34:11  sonic_platform/__init__.py:18: in <module>
19:34:11      from sonic_platform import *
19:34:11  sonic_platform/platform.py:28: in <module>
19:34:11      raise ImportError(str(e) + "- required module not found")
19:34:11  E   ImportError: No module named 'swsscommon'- required module not found- required module not found
19:34:11  [  FAIL LOG END  ] [ target/python-wheels/bullseye/mlnx_platform_api-1.0-py3-none-any.whl ]
The issue only happens when calling below command:

make target/python-wheels/bullseye/mlnx_platform_api-1.0-py3-none-any.whl 

- How I did it
Add PYTHON3_SWSSCOMMON as build time dependency to Mellanox platform API

- How to verify it
Run build
  • Loading branch information
Junchao-Mellanox committed Feb 20, 2023
1 parent bceb154 commit cac95c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions platform/mellanox/mlnx-platform-api.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SONIC_PLATFORM_API_PY3 = mlnx_platform_api-1.0-py3-none-any.whl
$(SONIC_PLATFORM_API_PY3)_SRC_PATH = $(PLATFORM_PATH)/mlnx-platform-api
$(SONIC_PLATFORM_API_PY3)_PYTHON_VERSION = 3
$(SONIC_PLATFORM_API_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_CONFIG_ENGINE_PY3) $(SONIC_PLATFORM_API_PY2)
$(SONIC_PLATFORM_API_PY3)_DEBS_DEPENDS = $(PYTHON3_SWSSCOMMON)
SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY3)

export mlnx_platform_api_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY3))"

0 comments on commit cac95c2

Please sign in to comment.