From caa7f22b50abfeceb4d92cc176e87b5412a62b35 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Fri, 25 Sep 2020 08:07:49 +0000 Subject: [PATCH] Accelerate YAML operations with LibYAML Patch PyYAML (via the pylibyaml library) to automatically enable the LibYAML parser and emitter, which are faster than the Python versions. https://pypi.org/project/pylibyaml/ Change-Id: Iaddc0f30ed99b1f9a999f5365e9e8bf43349b82f --- python/drydock_provisioner/__init__.py | 2 ++ python/requirements-direct.txt | 3 ++- python/requirements-lock.txt | 3 ++- python/tests/unit/test_cli_task.py | 1 + python/tests/unit/test_schema_validation.py | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/drydock_provisioner/__init__.py b/python/drydock_provisioner/__init__.py index f10bbbf6..2f6229aa 100644 --- a/python/drydock_provisioner/__init__.py +++ b/python/drydock_provisioner/__init__.py @@ -11,3 +11,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +import pylibyaml # noqa: F401 # patch pyyaml to use libyaml bindings diff --git a/python/requirements-direct.txt b/python/requirements-direct.txt index 521957e2..e4799b48 100644 --- a/python/requirements-direct.txt +++ b/python/requirements-direct.txt @@ -1,4 +1,5 @@ -PyYAML==5.1 +pylibyaml~=0.1 +PyYAML~=5.3.1 pyghmi==1.0.18 netaddr falcon diff --git a/python/requirements-lock.txt b/python/requirements-lock.txt index c32234ba..8047d036 100644 --- a/python/requirements-lock.txt +++ b/python/requirements-lock.txt @@ -53,6 +53,7 @@ PTable==0.9.2 pycadf==2.8.0 pycrypto==2.6.1 pyghmi==1.0.18 +pylibyaml==0.1.0 pymongo==3.6.1 pyparsing==2.2.1 python-dateutil==2.7.3 @@ -60,7 +61,7 @@ python-editor==1.0.3 python-keystoneclient==3.17.0 python-mimeparse==1.6.0 pytz==2018.5 -PyYAML==5.1 +PyYAML==5.3.1 redfish==2.0.1 repoze.lru==0.7 requests==2.20.0 diff --git a/python/tests/unit/test_cli_task.py b/python/tests/unit/test_cli_task.py index 7065256f..736013f5 100644 --- a/python/tests/unit/test_cli_task.py +++ b/python/tests/unit/test_cli_task.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import pylibyaml # noqa: F401 # patch pyyaml to use libyaml bindings import yaml import pytest diff --git a/python/tests/unit/test_schema_validation.py b/python/tests/unit/test_schema_validation.py index faf5d3b7..2959a728 100644 --- a/python/tests/unit/test_schema_validation.py +++ b/python/tests/unit/test_schema_validation.py @@ -1,3 +1,4 @@ +import pylibyaml # noqa: F401 # patch pyyaml to use libyaml bindings import yaml import jsonschema import pkg_resources