Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Replace swsssdk.ConfigDBConnector and SonicDBConfig with swsscommon implementation in sonic-py-common #7655

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 4 additions & 0 deletions rules/sonic-py-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
SONIC_PY_COMMON_PY2 = sonic_py_common-1.0-py2-none-any.whl
$(SONIC_PY_COMMON_PY2)_SRC_PATH = $(SRC_PATH)/sonic-py-common
$(SONIC_PY_COMMON_PY2)_DEPENDS += $(SWSSSDK_PY2)
$(SONIC_PY_COMMON_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) \
$(PYTHON_SWSSCOMMON)
$(SONIC_PY_COMMON_PY2)_PYTHON_VERSION = 2
SONIC_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY2)

Expand All @@ -11,6 +13,8 @@ SONIC_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY2)
SONIC_PY_COMMON_PY3 = sonic_py_common-1.0-py3-none-any.whl
$(SONIC_PY_COMMON_PY3)_SRC_PATH = $(SRC_PATH)/sonic-py-common
$(SONIC_PY_COMMON_PY3)_DEPENDS += $(SWSSSDK_PY3)
$(SONIC_PY_COMMON_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) \
$(PYTHON3_SWSSCOMMON)
# Synthetic dependency to avoid building the Python 2 and 3 packages
# simultaneously and any potential conflicts which may arise
$(SONIC_PY_COMMON_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY2)
Expand Down
10 changes: 1 addition & 9 deletions src/sonic-py-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

dependencies = [
'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2
'pyyaml',
'swsssdk>=2.0.1',
]

high_performance_deps = [
'swsssdk[high_perf]>=2.0.1',
'pyyaml'
]

setup(
Expand All @@ -21,9 +16,6 @@
maintainer='Joe LeVeque',
maintainer_email='[email protected]',
install_requires=dependencies,
extras_require={
'high_perf': high_performance_deps,
},
packages=[
'sonic_py_common',
],
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from natsort import natsorted

# TODO: Replace with swsscommon
from swsssdk import ConfigDBConnector, SonicDBConfig, SonicV2Connector
from swsscommon.swsscommon import ConfigDBConnector, SonicDBConfig, SonicV2Connector

USR_SHARE_SONIC_PATH = "/usr/share/sonic"
HOST_DEVICE_PATH = USR_SHARE_SONIC_PATH + "/device"
Expand Down
1 change: 1 addition & 0 deletions src/system-health/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'pytest-runner'
],
tests_require=[
'swsssdk>=2.0.1',
'pytest',
'mock>=2.0.0'
],
Expand Down