from setuptools import setup
import re
import os
import requests
def get_pip_version(pkginfo_url):
    pkginfo = requests.get(pkginfo_url).text
    for record in pkginfo.split('\n'):
        if  record.startswith('Version'):
            current_version = str(record).split(':',1)
            return (current_version[1]).strip()


if os.path.isfile('branch_master'):
   current_version = get_pip_version('https://pypi.python.org/pypi?name=taskcat&:action=display_pkginfo')
else:
   current_version = get_pip_version('https://testpypi.python.org/pypi?name=taskcat&:action=display_pkginfo')

new_version =re.sub('\d$', lambda x: str(int(x.group(0)) + 1), current_version)

setup(
    name='taskcat',
    packages=['taskcat'],
    description='An OpenSource Cloudformation Deployment Framework',
    author='Tony Vattathil, Santiago Cardenas, Shivansh Singh',
    author_email='tonynv@amazon.com, sancard@amazon.com, sshvans@amazon.com',
    url='https://aws-quickstart.github.io/taskcat/',
    version=new_version,
    license='Apache License 2.0',
    download_url='https://github.com/aws-quickstart/taskcat/tarball/master',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Topic :: Software Development :: Libraries',

    ],

    keywords=['aws', 'cloudformation', 'cloud', 'cloudformation testing', 'cloudformation deploy', 'taskcat'],

    install_requires=['boto3', 'pyfiglet', 'pyyaml', 'tabulate', 'yattag']

)

@@ -26,649 +26,8 @@
 tup%0A
-import re%0Aimport os%0Aimport requests%0Adef get_pip_version(pkginfo_url):%0A    pkginfo = requests.get(pkginfo_url).text%0A    for record in pkginfo.split('%5Cn'):%0A        if  record.startswith('Version'):%0A            current_version = str(record).split(':',1)%0A            return (current_version%5B1%5D).strip()%0A%0A%0Aif os.path.isfile('branch_master'):%0A   current_version = get_pip_version('https://pypi.python.org/pypi?name=taskcat&:action=display_pkginfo')%0Aelse:%0A   current_version = get_pip_version('https://testpypi.python.org/pypi?name=taskcat&:action=display_pkginfo')%0A%0Anew_version =re.sub('%5Cd$', lambda x: str(int(x.group(0)) + 1), current_version)%0A%0A
 setu
@@ -355,19 +355,21 @@
 ion=
-new_version
+'0.0.0.dev11'
 ,%0A  
@@ -798,17 +798,15 @@
 s',%0A
-%0A
     %5D,%0A
-%0A
     
@@ -912,17 +912,16 @@
 kcat'%5D,%0A
-%0A
     inst
@@ -987,11 +987,10 @@
 attag'%5D%0A
-%0A
 )%0A

Revert Auto Version (Versioning is now managed by CI)