Skip to content

Commit

Permalink
setup bump
Browse files Browse the repository at this point in the history
  • Loading branch information
eladyaniv01 committed Sep 21, 2020
1 parent 840b802 commit 23b63f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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={
Expand Down
44 changes: 21 additions & 23 deletions vb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand All @@ -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()
Expand Down Expand Up @@ -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'))
Expand All @@ -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):
Expand Down

0 comments on commit 23b63f9

Please sign in to comment.