From 8dbb1c7871b9918e01695a18afe65f0f3557e2df Mon Sep 17 00:00:00 2001 From: Sam Van Oort Date: Mon, 12 Oct 2015 06:57:01 -0400 Subject: [PATCH] Fix install quirks and document dependencies after release testing Setup requires changed to install-requires Bump version Document pycurl install fix --- README.md | 18 +++++++++++++++--- setup.py | 4 ++-- util/install-smoketests.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 util/install-smoketests.sh diff --git a/README.md b/README.md index 5a43aefb..019f6771 100644 --- a/README.md +++ b/README.md @@ -49,14 +49,26 @@ Apache License, Version 2.0 The best way to install PyRestTest is via Python's pip packaging tool. If that is not installed, we'll need to install it first: -```shell -wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py -``` +* Ubuntu/Debian: (sudo) `apt-get install python-pip` +* CentOS/RHEL: (sudo) `yum install python-pip` +* Mac OS X with homebrew: `brew install python` (it's included) +* Or with just python installed: `wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py` + +**Then install package python-pycurl:** +* Ubuntu: (sudo) `apt-get install python-pycurl` +* CentOS/RHEL: (sudo) `yum install python-pycurl` +*This is needed because the pycurl dependency may fail to install by pip.* + Then we install pyresttest: ```shell sudo pip install pyresttest ``` +**If it fails like this:** +`__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory` + +Then you need to install python-pycurl (pip tried and failed to install it) + There are also options to [install from repo](#installation-without-pip), or [build an RPM](#pure-rpm-based-install). # How Do I Use It? diff --git a/setup.py b/setup.py index 5a20c4af..01dfeeaa 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='pyresttest', - version='1.6.0.dev', + version='1.6.0', description='Python RESTful API Testing & Microbenchmarking Tool', long_description='Python RESTful API Testing & Microbenchmarking Tool \n Documentation at https://github.com/svanoort/pyresttest', maintainer='Sam Van Oort', @@ -22,7 +22,7 @@ 'pyresttest.parsing', 'pyresttest.validators', 'pyresttest.contenthandling', 'pyresttest.benchmarks', 'pyresttest.tests', 'pyresttest.ext.validator_jsonschema'], license='Apache License, Version 2.0', - requires=['pyyaml', 'pycurl'], + install_requires=['pyyaml', 'pycurl'], # Make this executable from command line when installed scripts=['util/pyresttest', 'util/resttest.py'], provides=['pyresttest'] diff --git a/util/install-smoketests.sh b/util/install-smoketests.sh new file mode 100644 index 00000000..9aeb657f --- /dev/null +++ b/util/install-smoketests.sh @@ -0,0 +1,32 @@ +# bdist will cause *issues* + +# CentOS install script to test it +# docker run -it --rm -v `pwd`:/tmp/pyresttest centos:centos6 /bin/bash +rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm +yum install -y python-pip +pip install -i https://testpypi.python.org/pypi pyresttest + + +#Interactive test to see if it works +resttest.py +python -c "import pyresttest" +pip show version pyresttest + +# test (each returns exit code) +resttest.py 2>/dev/null | grep 'Usage' +pyresttest 2>/dev/null | grep 'Usage' +resttest.py https://api.github.com /tmp/pyresttest/github_api_smoketest.yaml + + +# Install on Ubuntu14 +# docker run -it --rm -v `pwd`:/tmp/pyresttest ubuntu:14.04 /bin/bash +apt-get update && apt-get install -y python-pip +apt-get install python-pycurl +pip install -i https://testpypi.python.org/pypi --pre pyresttest + +# Same tests +# Now we do the more involved tests using prebaked images with test server +# docker run -it --rm -v `pwd`:/tmp/pyresttest pyresttest-build-ubuntu-14:latest /bin/bash +# docker run -it --rm -v `pwd`:/tmp/pyresttest pyresttest-build-centos6:latest /bin/bash +python /tmp/pyresttest/pyresttest/testapp/manage.py testserver /tmp/pyresttest/pyresttest/testapp/test_data.json & +pyresttest http://localhost:8000 /tmp/pyresttest/pyresttest/content-test.yaml \ No newline at end of file