Skip to content

Commit

Permalink
Merge pull request #32 from dwhswenson/release-0.0.11
Browse files Browse the repository at this point in the history
Release 0.0.11
  • Loading branch information
dwhswenson authored Jan 15, 2019
2 parents 4c0cb60 + 7cdcb6e commit 78b8bf0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 24 deletions.
12 changes: 6 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ environment:
PYTHONUNBUFFERED: 1

matrix:
- PYTHON: "C:\\Miniconda"
CONDA_PY: "27"
ARCH: '32'
- PYTHON: "C:\\Miniconda-x64"
CONDA_PY: "27"
ARCH: '64'
#- PYTHON: "C:\\Miniconda"
#CONDA_PY: "27"
#ARCH: '32'
#- PYTHON: "C:\\Miniconda-x64"
#CONDA_PY: "27"
#ARCH: '64'
- PYTHON: "C:\\Miniconda36"
CONDA_PY: "36"
ARCH: '32'
Expand Down
12 changes: 9 additions & 3 deletions autorelease/check_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ def _is_release_tests(self, expected):
'expected': expected})
]

def _reasonable_desired_version_test(self, allow_equal):
def _reasonable_desired_version_test(self, allow_equal,
allow_patch_skip=False):
return [
(
self.git_repo_checks.reasonable_desired_version, [],
{'desired_version': self.desired_version,
'allow_equal': allow_equal}
'allow_equal': allow_equal,
'allow_patch_skip': allow_patch_skip}
)
]

Expand All @@ -86,13 +88,17 @@ def select_tests_from_sysargs(self):
parser = argparse.ArgumentParser()
parser.add_argument('--branch', type=str)
parser.add_argument('--event', type=str)
parser.add_argument('--allow-patch-skip', action='store_true',
default=False)
opts = parser.parse_args()
if opts.branch in self.release_branches:
print("TESTING AS RELEASE")
allow_equal = (opts.event == 'cron'
or opts.branch == self.tag_branch)
tests = (self.tests
+ self._reasonable_desired_version_test(allow_equal)
+ self._reasonable_desired_version_test(
allow_equal=allow_equal,
allow_patch_skip=opts.allow_patch_skip)
+ self._is_release_tests(expected=True))
else:
print("TESTING AS NONRELEASE")
Expand Down
38 changes: 25 additions & 13 deletions autorelease/git_repo_checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import git # GitPython
import packaging.version as vers

def skipped_version(old_version, new_version, allow_patch_skip=False):
old_major, old_minor, old_patch = old_version
new_major, new_minor, new_patch = new_version

bad_update = False

if new_major == old_major:
if new_minor == old_minor:
if not allow_patch_skip and new_patch != old_patch + 1:
bad_update = True

elif new_patch != 0 and new_minor != old_minor + 1:
bad_update = True

elif new_minor != 0 != new_patch and new_major != old_major + 1:
bad_update = True

return bad_update


class GitReleaseChecks(object):
def __init__(self, repo_path='.'):
self.repo_path = repo_path
Expand All @@ -27,7 +47,8 @@ def _versions_from_tags(self):
# TODO: may be better to replace with regex for reusability
return [vers.Version(v) for v in tag_versions]

def reasonable_desired_version(self, desired_version, allow_equal=False):
def reasonable_desired_version(self, desired_version, allow_equal=False,
allow_patch_skip=False):
"""
Determine whether the desired version is a reasonable next version.
Expand Down Expand Up @@ -63,18 +84,9 @@ def reasonable_desired_version(self, desired_version, allow_equal=False):
return ("Bad update: New version doesn't increase on last tag: "
+ update_str + "\n")

bad_update = False

if new_major == old_major:
if new_minor == old_minor:
if new_patch != old_patch + 1:
bad_update = True

elif new_patch != 0 and new_minor != old_minor + 1:
bad_update = True

elif new_minor != 0 != new_patch and new_major != old_major + 1:
bad_update = True
bad_update = skipped_version((old_major, old_minor, old_patch),
(new_major, new_minor, new_patch),
allow_patch_skip)

msg = ""
if bad_update:
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: autorelease
# add ".dev0" for unreleased versions
version: "0.0.10"
version: "0.0.11"

source:
path: ../../
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
####################### USER SETUP AREA #################################
# * VERSION: base version (do not include .dev0, etc -- that's automatic)
# * IS_RELEASE: whether this is a release
VERSION = "0.0.10"
VERSION = "0.0.11"
IS_RELEASE = True

DEV_NUM = 0 # always 0: we don't do public (pypi) .dev releases
Expand Down

0 comments on commit 78b8bf0

Please sign in to comment.