aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-12-18 18:47:27 -0500
committerOle Tr�an <otroan@employees.org>2021-02-09 18:32:40 +0000
commitb552ff2e939b8c058c4f11b311b932c4f198cb89 (patch)
tree1952c96dfe96d3b9595a14b69cd742d449d7e719
parent3ca4b14e2d3df439a6088401baace95a9f79f855 (diff)
papi: expose vpp_papi version to client
root@ae2a2e85c5d4:/vpp/src/vpp-api/python# python3 Python 3.6.9 (default, Oct 8 2020, 12:12:24) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import vpp_papi >>> vpp_papi.__version__ '1.6.2' Type: feature Change-Id: I73025427a58214a842245fceaa77daa7acd3e6f8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--src/vpp-api/python/vpp_papi/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vpp-api/python/vpp_papi/__init__.py b/src/vpp-api/python/vpp_papi/__init__.py
index 609001e3751..b2b4fc78fc1 100644
--- a/src/vpp-api/python/vpp_papi/__init__.py
+++ b/src/vpp-api/python/vpp_papi/__init__.py
@@ -9,3 +9,9 @@ from . macaddress import MACAddress, mac_pton, mac_ntop # noqa: F401
from .vpp_serializer import BaseTypes # noqa: F401
from .vpp_serializer import VPPEnumType, VPPType, VPPTypeAlias # noqa: F401
from .vpp_serializer import VPPMessage, VPPUnionType # noqa: F401
+
+import pkg_resources # part of setuptools
+try:
+ __version__ = pkg_resources.get_distribution("vpp_papi").version
+except (pkg_resources.DistributionNotFound):
+ """Can't find vpp_papi via setuptools"""