Skip to content

Commit 326cc6a

Browse files
shaileshmishrashaileshmishra
authored andcommitted
Retry Policy & Timeout
1 parent dea39e5 commit 326cc6a

File tree

9 files changed

+37
-51
lines changed

9 files changed

+37
-51
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
Date: 26-Feb-2021
88

99
- Retry policy and timeout support included
10-
- set default timeout 30 sec
11-
-----------------------------
10+
- Set default timeout 30 sec
1211

12+
-----------------------------
1313

1414
## _v1.2.0_
1515

contentstack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .asset import Asset
1313
from .contenttype import ContentType
1414
from .https_connection import HTTPSConnection
15-
from .stack import Stack
15+
from contentstack.stack import Stack
1616
from .utility import Utils
1717

1818
__title__ = 'contentstack-python'

contentstack/https_connection.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
import logging
99
import platform
1010
from json import JSONDecodeError
11-
12-
import requests
13-
from requests.adapters import HTTPAdapter
14-
from requests.exceptions import HTTPError, Timeout
15-
1611
import contentstack
1712

1813
log = logging.getLogger(__name__)
@@ -52,6 +47,11 @@ def __init__(self, endpoint, headers, timeout, retry_strategy):
5247
self.retry_strategy = retry_strategy
5348

5449
def get(self, url):
50+
51+
import requests
52+
from requests.adapters import HTTPAdapter
53+
from requests.exceptions import HTTPError, Timeout
54+
5555
"""
5656
Here we create a response object, `response` which will store the request-response.
5757
We use requests.get method since we are sending a GET request.

contentstack/image_transform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def get_url(self):
5050
>>> result = image_url.fetch()
5151
------------------------------
5252
"""
53-
args = ['{0}={1}'.format(k, v) for k, v in self.image_params.items()]
53+
# args = ['{0}={1}'.format(k, v) for k, v in self.image_params.items()]
54+
args = ['{0}={1}'.format(k, v) for k, v in list(self.image_params.items())]
5455
if args:
5556
self.image_url += '?{0}'.format('&'.join(args))
5657
return self.image_url

coverage.svg

Lines changed: 0 additions & 21 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"name": "contentstack.python",
3-
"version": "1.3.0"
3+
"version": "1.3.0",
4+
"developer": "shaileshmishra",
5+
"license": "MIT",
6+
"author": {"name": "shaileshmishra", "email": "[email protected]"},
7+
"homepage": "www.contentstack.com",
8+
"readme": "./readme"
49
}

requirements.txt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
docutils==0.16
2-
keyring==21.5.0
3-
pkginfo==1.6.1
4-
requests==2.25.0
5-
pip~=20.3.1
6-
py~=1.9.0
7-
setuptools~=51.0.0
8-
wheel==0.35.1
9-
urllib3==1.26.3
10-
utils==1.0.1
11-
twython==3.8.2
12-
Sphinx==3.5.1
1+
twython~=3.8.2
2+
setuptools~=51.1.0
3+
urllib3~=1.26.2
4+
python-dateutil==2.8.1
5+
requests>=2.20.0,<3.0
6+
coverage==4.3.4
7+
tox==2.5.0
8+
virtualenv==15.1.0
9+
Sphinx==1.6.3
10+
sphinxcontrib-websupport==1.0.1

runtests.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
import os
77

8-
import contentstack
9-
108
try:
119
from setuptools import setup
1210
except ImportError:
@@ -15,14 +13,19 @@
1513
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
1614
long_description = readme.read()
1715

16+
requirements = [
17+
'requests>=2.20.0,<3.0',
18+
'python-dateutil'
19+
]
20+
1821
setup(
1922
title="contentstack-python",
2023
name="Contentstack",
2124
status="Active",
2225
type="process",
2326
created="09 Jun 2020",
24-
keywords=contentstack.__title__,
25-
version=contentstack.__version__,
27+
keywords="contentstack-python",
28+
version="1.3.0",
2629
author="Contentstack",
2730
author_email="[email protected]",
2831
description="Contentstack is a headless CMS with an API-first approach.",
@@ -32,15 +35,18 @@
3235
packages=['contentstack'],
3336
license='MIT',
3437
test_suite='tests',
35-
install_requires=['requests>=1.1.0'],
38+
install_requires=requirements,
3639
include_package_data=True,
40+
universal=1,
3741
classifiers=[
3842
"License :: OSI Approved :: MIT License",
3943
"Operating System :: OS Independent",
4044
'Intended Audience :: Developers',
4145
'Natural Language :: English',
4246
'Programming Language :: Python :: 3.6',
4347
'Programming Language :: Python :: 3.7',
48+
'Programming Language :: Python :: 3.8',
49+
'Programming Language :: Python :: 3.9',
4450
],
4551
python_requires='>=3.6',
4652
zip_safe=False,

0 commit comments

Comments
 (0)