diff --git a/release.py b/release.py new file mode 100755 index 00000000..b39501a5 --- /dev/null +++ b/release.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +from subprocess import call +import re + + +version = None + + +def get_new_setup_py_lines(): + global version + with open('setup.py', 'r') as sf: + current_setup = sf.readlines() + for line in current_setup: + if line.startswith('VERSION = '): + major, minor = re.findall(r"VERSION = '(\d+)\.(\d+)'", line)[0] + version = "{}.{}".format(major, int(minor) + 1) + yield "VERSION = '{}'\n".format(version) + else: + yield line + + +lines = list(get_new_setup_py_lines()) +with open('setup.py', 'w') as sf: + sf.writelines(lines) + +call('git commit -am "Bump to {}"'.format(version), shell=True) +call('git tag {}'.format(version), shell=True) +call('git push', shell=True) +call('git push --tags', shell=True) +call('python setup.py sdist upload', shell=True) diff --git a/setup.py b/setup.py index 334f996d..c822bb5c 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,18 @@ from setuptools import setup, find_packages +VERSION = '1.24' + + setup(name='thefuck', - version="1.23", + version=VERSION, description="Magnificent app which corrects your previous console command", author='Vladimir Iakovlev', author_email='nvbn.rm@gmail.com', url='https://github.com/nvbn/thefuck', license='MIT', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), + packages=find_packages(exclude=['ez_setup', 'examples', + 'tests', 'release']), include_package_data=True, zip_safe=False, install_requires=['pathlib', 'psutil'],