From: sousaedu Date: Wed, 7 Apr 2021 22:16:18 +0000 (+0200) Subject: Bugfix 1491: Replacing pkg_resources for importlib.metadata X-Git-Tag: branch-sol006v331-start~8 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=commitdiff_plain;h=becd083422f214e1480a8ecfadc748af2ea41703 Bugfix 1491: Replacing pkg_resources for importlib.metadata Change-Id: I729ee2d5d3628c30a0a265978a355eb26f3a9bb2 Signed-off-by: sousaedu --- diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py index 94af5a17..681128ec 100644 --- a/NG-RO/osm_ng_ro/ns_thread.py +++ b/NG-RO/osm_ng_ro/ns_thread.py @@ -32,7 +32,7 @@ import yaml from copy import deepcopy from http import HTTPStatus from os import mkdir -from pkg_resources import iter_entry_points +from importlib_metadata import entry_points from shutil import rmtree from unittest.mock import Mock @@ -1229,8 +1229,8 @@ class NsWorker(threading.Thread): return self.plugins[name] try: - for v in iter_entry_points("osm_ro{}.plugins".format(type), name): - self.plugins[name] = v.load() + for ep in entry_points(group="osm_ro{}.plugins".format(type), name=name): + self.plugins[name] = ep.load() except Exception as e: raise NsWorkerException("Cannot load plugin osm_{}: {}".format(name, e)) diff --git a/requirements-dev.txt b/requirements-dev.txt index bced7bb0..edae3a59 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,4 @@ +####################################################################################### # Copyright ETSI Contributors and Others. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -## - +####################################################################################### git+https://osm.etsi.org/gerrit/osm/common.git@master#egg=osm-common # via -r requirements-dev.in diff --git a/requirements-dist.txt b/requirements-dist.txt index 59b68fe0..b32a04ab 100644 --- a/requirements-dist.txt +++ b/requirements-dist.txt @@ -1,3 +1,4 @@ +####################################################################################### # Copyright ETSI Contributors and Others. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,14 +13,7 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -## - -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements-dist.txt requirements-dist.in -# +####################################################################################### setuptools-version-command==2.2 # via -r requirements-dist.in stdeb==0.10.0 diff --git a/requirements-test.txt b/requirements-test.txt index 0cf35b8c..f2711aa5 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -14,16 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### - -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements-test.txt requirements-test.in -# -e RO-plugin # via -r requirements-test.in -coverage==5.4 +coverage==5.5 # via # -r requirements-test.in # nose2 diff --git a/requirements.in b/requirements.in index 2b6c8158..4ee7d89d 100644 --- a/requirements.in +++ b/requirements.in @@ -23,6 +23,7 @@ fog05==0.2.0 fog05-sdk==0.2.0 # TODO py3 genisoimage logutils +importlib-metadata netaddr networking-l2gw oca diff --git a/requirements.txt b/requirements.txt index bdafbaf2..c8762265 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +####################################################################################### # Copyright ETSI Contributors and Others. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,15 +13,8 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -## - -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file=requirements.txt requirements.in -# -adal==1.2.6 +####################################################################################### +adal==1.2.7 # via # azure-datalake-store # msrestazure @@ -28,11 +22,11 @@ aenum==3.0.0 # via pyone alabaster==0.7.12 # via sphinx -alembic==1.5.4 +alembic==1.5.8 # via # neutron # oslo.db -amqp==5.0.5 +amqp==5.0.6 # via # kombu # oslo.messaging @@ -48,7 +42,7 @@ azure-applicationinsights==0.1.0 # via azure azure-batch==4.1.3 # via azure -azure-common==1.1.26 +azure-common==1.1.27 # via # azure-applicationinsights # azure-batch @@ -128,7 +122,7 @@ azure-cosmosdb-nspkg==2.0.2 # via azure-cosmosdb-table azure-cosmosdb-table==1.0.6 # via azure -azure-datalake-store==0.0.51 +azure-datalake-store==0.0.52 # via azure azure-eventgrid==1.3.0 # via azure @@ -350,7 +344,7 @@ bcrypt==3.2.0 # via paramiko beautifulsoup4==4.9.3 # via webtest -bitarray==1.6.3 +bitarray==1.9.1 # via pyangbind boto==2.49.0 # via -r requirements.in @@ -373,7 +367,7 @@ cheroot==8.5.2 # via cherrypy cherrypy==18.1.2 # via -r requirements.in -cliff==3.6.0 +cliff==3.7.0 # via # osc-lib # python-designateclient @@ -383,7 +377,7 @@ cmd2==1.5.0 # via cliff colorama==0.4.4 # via cmd2 -cryptography==3.4.4 +cryptography==3.4.7 # via # -r requirements.in # adal @@ -411,7 +405,7 @@ debtcollector==2.2.0 # python-designateclient # python-keystoneclient # python-neutronclient -decorator==4.4.2 +decorator==5.0.5 # via # dogpile.cache # neutron @@ -421,7 +415,7 @@ dicttoxml==1.7.4 # via pyone dnspython==1.16.0 # via eventlet -docutils==0.16 +docutils==0.17 # via sphinx dogpile.cache==1.1.2 # via @@ -429,7 +423,7 @@ dogpile.cache==1.1.2 # oslo.cache enum34==1.1.10 # via pyangbind -eventlet==0.30.1 +eventlet==0.30.2 # via # neutron # os-ken @@ -465,9 +459,10 @@ greenlet==1.0.0 # eventlet # oslo.privsep # oslo.service + # sqlalchemy hexdump==3.3 # via yaks -httplib2==0.19.0 +httplib2==0.19.1 # via neutron humanfriendly==9.1 # via pyvcloud @@ -475,6 +470,8 @@ idna==2.10 # via requests imagesize==1.2.0 # via sphinx +importlib-metadata==3.10.0 + # via -r requirements.in iso8601==0.1.14 # via # keystoneauth1 @@ -483,9 +480,10 @@ iso8601==0.1.14 # oslo.versionedobjects # python-neutronclient # python-novaclient + # python-openstackclient isodate==0.6.0 # via msrest -jaraco.functools==3.2.0 +jaraco.functools==3.3.0 # via # cheroot # tempora @@ -497,11 +495,11 @@ jinja2==2.11.3 # sphinx jmespath==0.10.0 # via openstacksdk -jsonpatch==1.28 +jsonpatch==1.32 # via # openstacksdk # warlock -jsonpointer==2.0 +jsonpointer==2.1 # via jsonpatch jsonschema==3.2.0 # via @@ -509,7 +507,7 @@ jsonschema==3.2.0 # fog05-sdk # python-designateclient # warlock -keystoneauth1==4.3.0 +keystoneauth1==4.3.1 # via # keystonemiddleware # neutron @@ -532,7 +530,7 @@ logutils==0.3.5 # via # -r requirements.in # pecan -lxml==4.6.2 +lxml==4.6.3 # via # pyang # pyangbind @@ -674,19 +672,19 @@ netifaces==0.10.9 # neutron # openstacksdk # oslo.utils -networking-l2gw==17.0.1 +networking-l2gw==18.0.0 # via -r requirements.in -neutron-lib==2.8.0 +neutron-lib==2.10.1 # via # networking-l2gw # neutron -neutron==17.1.0 +neutron==17.1.1 # via networking-l2gw oauthlib==3.1.0 # via requests-oauthlib oca==4.10.0 # via -r requirements.in -openstacksdk==0.53.0 +openstacksdk==0.55.0 # via # neutron # os-client-config @@ -694,7 +692,7 @@ openstacksdk==0.53.0 # python-openstackclient os-client-config==2.1.0 # via python-neutronclient -os-ken==1.3.0 +os-ken==1.4.0 # via # neutron # neutron-lib @@ -702,9 +700,9 @@ os-service-types==1.7.0 # via # keystoneauth1 # openstacksdk -os-traits==2.4.0 +os-traits==2.5.0 # via neutron-lib -os-vif==2.3.0 +os-vif==2.4.0 # via neutron os-xenapi==0.3.4 # via neutron @@ -726,7 +724,7 @@ oslo.concurrency==4.4.0 # oslo.service # oslo.versionedobjects # osprofiler -oslo.config==8.4.0 +oslo.config==8.5.0 # via # keystonemiddleware # neutron @@ -746,7 +744,7 @@ oslo.config==8.4.0 # oslo.versionedobjects # pycadf # python-keystoneclient -oslo.context==3.1.1 +oslo.context==3.2.0 # via # keystonemiddleware # neutron @@ -799,21 +797,21 @@ oslo.log==4.4.0 # oslo.service # oslo.versionedobjects # python-neutronclient -oslo.messaging==12.7.0 +oslo.messaging==12.7.1 # via # neutron # neutron-lib # oslo.versionedobjects -oslo.middleware==4.1.1 +oslo.middleware==4.2.0 # via # neutron # oslo.messaging -oslo.policy==3.6.2 +oslo.policy==3.7.0 # via # neutron # neutron-lib # oslo.upgradecheck -oslo.privsep==2.4.0 +oslo.privsep==2.5.0 # via # neutron # os-vif @@ -845,7 +843,7 @@ oslo.service==2.5.0 # oslo.messaging oslo.upgradecheck==1.3.0 # via neutron -oslo.utils==4.7.0 +oslo.utils==4.8.0 # via # keystonemiddleware # neutron @@ -883,12 +881,12 @@ osprofiler==3.4.0 # via # neutron # neutron-lib -ovs==2.13.0 +ovs==2.13.3 # via # neutron # os-ken # ovsdbapp -ovsdbapp==1.8.0 +ovsdbapp==1.9.0 # via # networking-l2gw # neutron @@ -957,7 +955,7 @@ pecan==1.4.0 # via # neutron # neutron-lib -portend==2.7.0 +portend==2.7.1 # via cherrypy prettytable==0.7.2 # via @@ -984,7 +982,7 @@ pycadf==3.1.1 # via keystonemiddleware pycparser==2.20 # via cffi -pygments==2.7.4 +pygments==2.8.1 # via # pyvcloud # sphinx @@ -994,7 +992,7 @@ pyjwt==2.0.1 # via adal pynacl==1.4.0 # via paramiko -pyone==5.12.7 +pyone==6.0.0 # via -r requirements.in pyopenssl==20.0.1 # via @@ -1006,15 +1004,15 @@ pyparsing==2.4.7 # httplib2 # oslo.utils # packaging -pyperclip==1.8.1 +pyperclip==1.8.2 # via cmd2 -pyroute2==0.5.14 +pyroute2==0.5.17 # via # neutron # os-vif pyrsistent==0.17.3 # via jsonschema -python-cinderclient==7.3.0 +python-cinderclient==7.4.0 # via # -r requirements.in # python-openstackclient @@ -1029,7 +1027,7 @@ python-designateclient==4.2.0 # via neutron python-editor==1.0.4 # via alembic -python-glanceclient==3.2.2 +python-glanceclient==3.3.0 # via -r requirements.in python-keystoneclient==4.2.0 # via @@ -1044,12 +1042,12 @@ python-neutronclient==7.3.0 # -r requirements.in # networking-l2gw # neutron -python-novaclient==17.3.0 +python-novaclient==17.4.0 # via # -r requirements.in # neutron # python-openstackclient -python-openstackclient==5.4.0 +python-openstackclient==5.5.0 # via -r requirements.in pytz==2021.1 # via @@ -1071,7 +1069,7 @@ pyyaml==5.4.1 # oslo.messaging # oslo.policy # pyvcloud -regex==2020.11.13 +regex==2021.4.4 # via pyangbind repoze.lru==0.7 # via routes @@ -1121,7 +1119,6 @@ simplejson==3.17.2 # osc-lib # python-cinderclient # python-neutronclient - # python-novaclient six==1.15.0 # via # bcrypt @@ -1142,7 +1139,6 @@ six==1.15.0 # oslo.i18n # oslo.reports # oslo.rootwrap - # oslo.utils # osprofiler # paste # pecan @@ -1151,11 +1147,9 @@ six==1.15.0 # pynacl # pyone # pyopenssl - # python-cinderclient # python-dateutil # python-designateclient # python-keystoneclient - # python-openstackclient # pyvmomi # routes # sqlalchemy-migrate @@ -1169,9 +1163,9 @@ snowballstemmer==2.1.0 # via sphinx sortedcontainers==2.3.0 # via ovs -soupsieve==2.2 +soupsieve==2.2.1 # via beautifulsoup4 -sphinx==3.4.3 +sphinx==3.5.3 # via -r requirements.in sphinxcontrib-applehelp==1.0.2 # via sphinx @@ -1187,7 +1181,7 @@ sphinxcontrib-serializinghtml==1.1.4 # via sphinx sqlalchemy-migrate==0.13.0 # via oslo.db -sqlalchemy==1.3.23 +sqlalchemy==1.4.6 # via # alembic # neutron @@ -1222,9 +1216,9 @@ tblib==1.7.0 # via pyone tempita==0.5.2 # via sqlalchemy-migrate -tempora==4.0.1 +tempora==4.0.2 # via portend -tenacity==6.3.1 +tenacity==7.0.0 # via # neutron # tooz @@ -1246,7 +1240,7 @@ traceback2==1.4.0 # unittest2 unittest2==1.1.0 # via testtools -urllib3==1.26.3 +urllib3==1.26.4 # via requests uuid==1.30 # via -r requirements.in @@ -1254,13 +1248,13 @@ vine==5.0.0 # via amqp voluptuous==0.12.1 # via tooz -waitress==1.4.4 +waitress==2.0.0 # via webtest warlock==1.3.3 # via python-glanceclient wcwidth==0.2.5 # via cmd2 -webob==1.8.6 +webob==1.8.7 # via # keystonemiddleware # neutron @@ -1292,6 +1286,8 @@ zc.lockfile==2.0 # via cherrypy zenoh==0.3.0 # via -r requirements.in +zipp==3.4.1 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/tox.ini b/tox.ini index 2122fb59..61f96bd8 100644 --- a/tox.ini +++ b/tox.ini @@ -194,11 +194,12 @@ commands = ####################################################################################### [testenv:pip-compile] deps = pip-tools==5.5.0 +skip_install = true commands = - - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\ - out=`echo $file | sed "s/.in/.txt/"` ; \ - head -16 tox.ini >> $out ;\ - done' + - sh -c "for file in requirements*.in ; do pip-compile -rU --no-header $file ;\ + out=`echo $file | sed 's/.in/.txt/'` ; \ + sed -i -e '1 e head -16 tox.ini' $out ;\ + done" whitelist_externals = sh