From 28973f0821d2fabe5a696d4eed0b2a66925038fe Mon Sep 17 00:00:00 2001 From: Paul Tax Date: Mon, 24 Aug 2015 20:39:02 +0200 Subject: Add requirements file for dev, fix PEP8 --- .gitignore | 2 +- awsauth.py | 11 ++++++----- requirements.txt | 2 ++ setup.py | 5 ++--- test.py | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index 097e1aa..ca8b11d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .DS_Store -requests/ +env/ *.pyc *.*~ \ No newline at end of file diff --git a/awsauth.py b/awsauth.py index 9414420..1c71faf 100644 --- a/awsauth.py +++ b/awsauth.py @@ -41,7 +41,7 @@ class S3Auth(AuthBase): def __call__(self, r): # Create date header if it is not created yet. - if not 'date' in r.headers and not 'x-amz-date' in r.headers: + if 'date' not in r.headers and 'x-amz-date' not in r.headers: r.headers['date'] = formatdate( timeval=None, localtime=False, @@ -127,8 +127,8 @@ class S3Auth(AuthBase): buf += q else: - # Riak CS multipart upload ids look like this, `TFDSheOgTxC2Tsh1qVK73A==`, is should be escaped to - # be included as part of a query string. + # Riak CS multipart upload ids look like this, `TFDSheOgTxC2Tsh1qVK73A==`, + # is should be escaped to be included as part of a query string. # # A requests mp upload part request may look like # resp = requests.put( @@ -141,8 +141,9 @@ class S3Auth(AuthBase): # auth=S3Auth('access_key', 'secret_key') # ) # - # Requests automatically escapes the values in the `params` dict, so now our uploadId is - # `TFDSheOgTxC2Tsh1qVK73A%3D%3D`, if we sign the request with the encoded value the signature will + # Requests automatically escapes the values in the `params` dict, so now + # our uploadId is `TFDSheOgTxC2Tsh1qVK73A%3D%3D`, + # if we sign the request with the encoded value the signature will # not be valid, we'll get 403 Access Denied. # So we unquote, this is no-op if the value isn't encoded. buf += '{}={}'.format(k, urllib.unquote(v)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3a3a480 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests==2.7.0 +wheel==0.24.0 diff --git a/setup.py b/setup.py index e15b17a..ace430c 100644 --- a/setup.py +++ b/setup.py @@ -15,15 +15,14 @@ if sys.argv[-1] == 'publish': setup( name='requests-aws', - version='0.1.6', + version='0.1.7', author='Paul Tax', author_email='paultax@gmail.com', include_package_data=True, - install_requires = ['requests>=0.14.0'], + install_requires=['requests>=0.14.0'], py_modules=['awsauth'], url='https://github.com/tax/python-requests-aws', license='BSD licence, see LICENCE.txt', description='AWS authentication for Amazon S3 for the python requests module', long_description=open('README.md').read(), ) - diff --git a/test.py b/test.py index ce38e68..3fcc5ea 100644 --- a/test.py +++ b/test.py @@ -127,7 +127,7 @@ class TestAWS(unittest.TestCase): # tag is default def test_canonical_string_not_using_encoded_query_params(self): - url = 'https://bucket.ca.tier3.io/object-name?partNumber=1&uploadId=TFDSheOgTxC2Tsh1qVK73A%3D%3D' + url = 'https://bucket.ca.tier3.io/object-name?partNumber=1&uploadId=TFDSheOgTxC2Tsh1qVK73A%3D%3D' # NOQA headers = { 'Content-Length': 0, 'Accept-Encoding': 'gzip, deflate', -- cgit v1.2.1