Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

asyncsnmp depends on sonic-utilities so it is possible to import sonic_psu #1212

Merged
merged 2 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dockers/docker-snmp-sv2/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ COPY [ \
"/debs/"]

# Install Python SwSSSDK (SNMP subagent dependency)
COPY python-wheels/sonic_utilities-*-py3-*.whl /python-wheels/
COPY python-wheels/swsssdk-*-py3-*.whl /python-wheels/
COPY python-wheels/asyncsnmp-*-py3-*.whl /python-wheels/

Expand Down
3 changes: 2 additions & 1 deletion rules/asyncsnmp-py3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
ASYNCSNMP_PY3 = asyncsnmp-2.1.0-py3-none-any.whl
$(ASYNCSNMP_PY3)_SRC_PATH = $(SRC_PATH)/sonic-snmpagent
$(ASYNCSNMP_PY3)_PYTHON_VERSION = 3
$(ASYNCSNMP_PY3)_DEPENDS += $(SWSSSDK_PY3)
# Depends on sonic-utilities so it is possible to import sonic_psu
$(ASYNCSNMP_PY3)_DEPENDS += $(SWSSSDK_PY3) $(SONIC_UTILS_PY3)
SONIC_PYTHON_WHEELS += $(ASYNCSNMP_PY3)
8 changes: 8 additions & 0 deletions rules/sonic-utilities.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ SONIC_UTILS = python-sonic-utilities_1.1-1_all.deb
$(SONIC_UTILS)_SRC_PATH = $(SRC_PATH)/sonic-utilities
$(SONIC_UTILS)_WHEEL_DEPENDS = $(SONIC_CONFIG_ENGINE)
SONIC_PYTHON_STDEB_DEBS += $(SONIC_UTILS)

# Build sonic-utilities into python3 wheel, so we can use PSU code
# Note: _DEPENDS macro is not defined
SONIC_UTILS_PY3 = sonic_utilities-1.1-py3-none-any.whl
$(SONIC_UTILS_PY3)_SRC_PATH = $(SRC_PATH)/sonic-utilities
$(SONIC_UTILS_PY3)_PYTHON_VERSION = 3
Copy link
Collaborator

@lguohan lguohan Dec 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add
$(SONIC_UTILS_PY3)_TEST = n to disable the test.

It is more useful. #Resolved

$(SONIC_UTILS_PY3)_TEST = n
SONIC_PYTHON_WHEELS += $(SONIC_UTILS_PY3)
2 changes: 1 addition & 1 deletion slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA
pushd $($*_SRC_PATH) $(LOG)
# apply series of patches if exist
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi
python$($*_PYTHON_VERSION) setup.py test $(LOG)
[ "$($*_TEST)" = "n" ] || python$($*_PYTHON_VERSION) setup.py test $(LOG)
python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG)
# clean up
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; fi
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-utilities