svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 325 forks source link

All dependencies not included with package #215

Open pd-448482 opened 7 years ago

pd-448482 commented 7 years ago

Hey, so I installed pyresttest via pip and was following some of the content on the advanced guide, in particular, use of jmespath. But I using it inside my own python code and noticed the following error:

[08:37:26.238] ERROR: pyresttest error: No valid extractor name to use in input: {'comparator': 'gt', 'expected': 0, 'jmespath': 'length([])'}

And I noticed this occurs because the jmespath package is not installed with pyresttest. Is there a reason this is not done as the documentation doesn't seem to mention having to install additional packages for normal usage. I ask because I use this package in another script whose setup.py only has pyresttest as a dependency since I didn't see additional optional dependencies listed here. Thanks for the help!

mvitiuk commented 7 years ago

@pldimarco saw same behaviour: error when I just try to use 'jmespath' out of the box and error is gone once I've install 'jmespath' with easy_install.

compelling commented 7 years ago

Got same behaviour when I try to use jmespath, "Exception: No valid extractor name to use in input". Funny thing is that jmespath seems to be installed: `$ pip install jmespath

Requirement already satisfied: jmespath in /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages`

svanoort commented 7 years ago

JmesPath is not explicitly not a hard dependency to keep the requirements minimal for lightweight uses (such as server healthchecks) -- there's a clever / "clever" (depending on how you look at it) mechanism to only load that extension if the library is present.

I'll try to clarify documentation around this extension & installation so that it's clearer, and perhaps the error.

@compelling Can you open a separate issue and please include the Python version used to run PyRestTest?