Yelp / bravado-core

Other
109 stars 98 forks source link

Accelerate YAML parsing when LibYAML is available #377

Closed hiromu closed 4 years ago

hiromu commented 4 years ago

When a Swagger definition is provided in YAML, the current implementation uses a Python loader for parsing. However, it can be accelerated by using a native loader when LibYAML is available.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.1%) to 99.074% when pulling bfa66abc01ddd8427d7197ce7a2884af47a7a420 on hiromu:enable-libyaml-loader into 3f04ce5d9f5fa8deeff7f76f1f9025e5dd30e888 on Yelp:master.

hiromu commented 4 years ago

Thank you for your reply. I updated this pull request to pass all the tests.

For the mypy issue, I simply skipped the line in the same manner as people discussing in the mypy repository: https://github.com/python/mypy/issues/1153

hiromu commented 4 years ago

After hours of investigation, I found there are several issues in pip and pyyaml which we cannot easily address:

Thus, I decided to explicitly skip building pyyaml in the case of Python 2.7. I believe this is a reasonable way under these restrictions.

sjaensch commented 4 years ago

Thanks for your contribution @hiromu!