From 23b63f96b1fa300c66477545a6dabf51bee873cb Mon Sep 17 00:00:00 2001 From: eladyaniv01 Date: Thu, 27 Aug 2020 14:35:26 +0300 Subject: [PATCH] setup bump --- setup.py | 5 +---- vb.py | 44 +++++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/setup.py b/setup.py index 9ec5ea4f..62b4ba86 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,6 @@ logger = logging.getLogger(__name__) -__version__ = "0.0.58" - - requirements = [ # pragma: no cover "Cython", "pyastar@git+git://github.com/hjweide/pyastar.git@master#egg=pyastar", @@ -21,7 +18,7 @@ setup( # pragma: no cover name="sc2mapanalyzer", # version=f"{__version__}", - version="0.0.58", + version="0.0.59", install_requires=requirements, setup_requires=["wheel", "numpy"], extras_require={ diff --git a/vb.py b/vb.py index 49282b60..5d79f561 100644 --- a/vb.py +++ b/vb.py @@ -4,10 +4,7 @@ from pathlib import Path __author__ = "Elad Yaniv" import click -from pkg_resources import get_distribution -VERSION = get_distribution('sc2mapanalyzer') -current_version = VERSION.version @click.group(help='Commands marked with (LIVE) require SC launch and windows environment.') @@ -32,23 +29,6 @@ def parse_setup(): setup_parsed = f.read() return setup_parsed - -def b_minor(new_version): - setup_parsed = parse_setup() - old_version_regex = r"(\d*[.]\d*[.]\d*)" - old_version = re.findall(old_version_regex, setup_parsed)[0] - setup_updated = setup_parsed.replace(old_version, new_version) - with open('setup.py', 'w') as f: - f.write(setup_updated) - - curdir = os.getcwd() - click.echo(click.style(curdir + '\\standard-version', fg='blue')) - subprocess.check_call('git fetch', shell=True) - subprocess.check_call('git pull', shell=True) - subprocess.check_call(f'standard-version --release-as {new_version}', shell=True) - # subprocess.check_call('git push --follow-tags origin', shell=True) - - @vb.command(help='sphinx make for gh pages') def makedocs(): p = Path() @@ -81,15 +61,15 @@ def mt(apply): @vb.command(help='Get current version') def gv(): - old_version = current_version - click.echo(click.style(old_version, fg='green')) click.echo("Running git describe") subprocess.check_call('git describe') @vb.command(help='Bump Minor') def bumpminor(): - old_version = current_version + setup_parsed = parse_setup() + old_version_regex = r"(\d*[.]\d*[.]\d*)" + old_version = re.findall(old_version_regex, setup_parsed)[0] minor = re.findall(r"([.]\d*)", old_version)[-1] minor = minor.replace('.', '') click.echo(f"Current Version: " + click.style(old_version, fg='green')) @@ -101,6 +81,24 @@ def bumpminor(): b_minor(new_version) +def b_minor(new_version): + setup_parsed = parse_setup() + old_version_regex = r"(\d*[.]\d*[.]\d*)" + old_version = re.findall(old_version_regex, setup_parsed)[0] + setup_updated = setup_parsed.replace(old_version, new_version) + with open('setup.py', 'w') as f: + f.write(setup_updated) + + curdir = os.getcwd() + click.echo(click.style(curdir + '\\standard-version', fg='blue')) + subprocess.check_call('git fetch', shell=True) + subprocess.check_call('git pull', shell=True) + subprocess.check_call('git add setup.py', shell=True) + subprocess.check_call('git commit -m \"setup bump\" ', shell=True) + subprocess.check_call(f'standard-version --release-as {new_version}', shell=True) + # subprocess.check_call('git push --follow-tags origin', shell=True) + + @vb.command(help='Custom git log command for last N days') @click.argument('days') def gh(days):