Skip to content

Commit 6683bfa

Browse files
entry functions added
1 parent 5b035bb commit 6683bfa

File tree

3 files changed

+66
-7
lines changed

3 files changed

+66
-7
lines changed

contentstack/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# __init__.py
4+
# Contentstack
5+
# Created by Shailesh on 22/06/19.
6+
# Copyright (c) 2012 - 2019 Contentstack. All rights reserved.
7+
8+
# [MIT License] :: Permission is hereby granted, free of charge, to any person
9+
# obtaining a copy of this software and associated documentation files (the "Software"),
10+
# to deal in the Software without restriction, including without limitation the rights
11+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
# copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
15+
# The above copyright notice and this permission notice shall be included in all
16+
# copies or substantial portions of the Software.
17+
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
# SOFTWARE.
25+
26+
"""Export module packages."""
27+
128
from .entry import Entry
229
from .asset import Asset
330
from .asset_library import AssetLibrary

contentstack/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def __init__(self, host_url: str = 'cdn.contentstack.io'):
3535

3636
def set_host(self, host_url=None):
3737
logging.info("set host", host_url)
38-
if host_url is not None:
39-
self.host_url = host_url
38+
self.host_url = host_url
4039
return self
4140

4241
def get_host(self):

setup.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,51 @@
1-
from setuptools import setup
1+
"""contentstack - decorator heavy REST client library for Python."""
2+
3+
from setuptools import setup, find_packages
4+
import os
5+
import re
6+
27
package = 'contentstack'
8+
9+
10+
def read(fname):
11+
"""Read description from local file."""
12+
return open(os.path.join(os.path.dirname(__file__), fname)).read()
13+
14+
315
requirements = [
416
'requests>=2.20.0,<3.0',
517
'python-dateutil'
618
]
19+
20+
21+
def get_version():
22+
"""Return package version as listed in `__version__` in `init.py`."""
23+
init_py = open('decorest/__init__.py').read()
24+
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
25+
26+
27+
version = get_version()
28+
729
setup(
830
name='contentstack-python',
9-
version='1.0.0',
10-
packages=['contentstack', 'doc', 'tests'],
31+
version=version,
32+
packages=find_packages(exclude=['tests']),
1133
url='https://www.contentstack.com',
1234
license='MIT License',
1335
author='Shailesh Mishra',
1436
author_email='shailesh.mishra@contentstack.com',
1537
description='Create python-based applications and use the python SDK to fetch and deliver content from Contentstack. The SDK uses Content Delivery APIs. ',
16-
install_requires=['requests', 'config']
38+
install_requires=['requests'],
39+
tests_require=['pytest'],
40+
long_description=read('README.rst'),
41+
include_package_data=True,
42+
classifiers=[
43+
'Development Status :: 1 - Alpha',
44+
'Intended Audience :: Developers',
45+
'Natural Language :: English',
46+
'License :: OSI Approved :: MIT License',
47+
'Operating System :: OS Independent',
48+
'Programming Language :: Python',
49+
'Programming Language :: Python :: 3.6'
50+
]
1751
)
18-

0 commit comments

Comments
 (0)