#!/usr/bin/env python
from distutils.core import setup
import sys
import os

version = '1.1.5'

try:
    import pypandoc
    long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
    long_description = open('README.md').read()

if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist upload')
    sys.exit()

setup(
    name='africastalking',
    version=version,
    packages=['africastalking'],
    description='Official Africa\'s Talking Python SDK',
    long_description=long_description,
    data_files=[('', ['README.md'])],
    license='MIT',
    author='Africa\'s Talking',
    install_requires=[
        'requests>=v2.18.4',
        'schema>=0.6.7'
    ],
    python_requires=">=2.7.10",
    author_email='info@africastalking.com',
    url='https://github.com/AfricasTalkingLtd/africastalking-python',
    download_url='https://codeload.github.com/AfricasTalkingLtd/africastalking-python/tar.gz/' + version,
    keywords='ussd voice sms mpesa card bank b2b b2c sender_id payments airtime africastalking',
    classifiers=[],
)

@@ -24,22 +24,18 @@
 rom 
-distutils.core
+setuptools
  imp
@@ -85,125 +85,57 @@
 1.1.
-5'%0A%0Atry:%0A    import pypandoc%0A    long_description = pypandoc.convert('README.md', 'rst')%0Aexcept(IOError, ImportError)
+6'%0A%0Awith open('README.md', encoding='utf-8') as f
 :%0A  
@@ -159,25 +159,9 @@
 n = 
-open('README.md')
+f
 .rea
@@ -406,47 +406,8 @@
 K',%0A
-    long_description=long_description,%0A
     
@@ -943,10 +943,99 @@
 ers=%5B%5D,%0A
+    long_description=long_description,%0A    long_description_content_type='text/markdown'%0A
 )%0A

Write long description as git flavoured markdown