From f2b1303715b4e7f0329cc065c7f389ef6fd2130f Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 3 Nov 2017 03:09:14 +0100 Subject: [PATCH 1/6] bump to 0.0.11.dev0 --- devtools/conda-recipe/meta.yaml | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 0aacd1a..ae5de06 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: autorelease # add ".dev0" for unreleased versions - version: "0.0.10" + version: "0.0.11.dev0" source: path: ../../ diff --git a/setup.py b/setup.py index 881e100..211bbeb 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,8 @@ ####################### 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" -IS_RELEASE = True +VERSION = "0.0.11" +IS_RELEASE = False DEV_NUM = 0 # always 0: we don't do public (pypi) .dev releases PRE_TYPE = "" # a, b, or rc (although we rarely release such versions) From 580dd330efcaf7035885b201d15310fa1ef5cd93 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 15 Jan 2019 15:35:25 +0100 Subject: [PATCH 2/6] Option to all skipping patch versions --- autorelease/check_runners.py | 12 ++++++++--- autorelease/git_repo_checks.py | 38 ++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/autorelease/check_runners.py b/autorelease/check_runners.py index 2c49b12..1b59af4 100644 --- a/autorelease/check_runners.py +++ b/autorelease/check_runners.py @@ -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} ) ] @@ -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") diff --git a/autorelease/git_repo_checks.py b/autorelease/git_repo_checks.py index 9ec92cb..b37a81f 100644 --- a/autorelease/git_repo_checks.py +++ b/autorelease/git_repo_checks.py @@ -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 @@ -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. @@ -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: From 37e7368d95eec8867830649e29f914bc359f7707 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 15 Jan 2019 16:13:40 +0100 Subject: [PATCH 3/6] test to see if old versions fix appveyor problems --- appveyor.yml | 12 ++++++------ devtools/conda-recipe/meta.yaml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 728c79b..d0854b2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,12 +20,12 @@ environment: - PYTHON: "C:\\Miniconda-x64" CONDA_PY: "27" ARCH: '64' - - PYTHON: "C:\\Miniconda36" - CONDA_PY: "36" - ARCH: '32' - - PYTHON: "C:\\Miniconda36-x64" - CONDA_PY: "36" - ARCH: '64' + #- PYTHON: "C:\\Miniconda36" + #CONDA_PY: "36" + #ARCH: '32' + #- PYTHON: "C:\\Miniconda36-x64" + #CONDA_PY: "36" + #ARCH: '64' build: false diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index ae5de06..9a8439f 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -20,9 +20,9 @@ requirements: - python - packaging - pyyaml - - gitpython - - requests - - future + - gitpython==2.1.7 + - requests==2.18 + - future==0.16 test: requires: From 3f42d6db20b32442f32dc8116362a8cf96d8ee49 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 15 Jan 2019 16:16:43 +0100 Subject: [PATCH 4/6] Revert "test to see if old versions fix appveyor problems" This reverts commit 37e7368d95eec8867830649e29f914bc359f7707. --- appveyor.yml | 12 ++++++------ devtools/conda-recipe/meta.yaml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d0854b2..728c79b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,12 +20,12 @@ environment: - PYTHON: "C:\\Miniconda-x64" CONDA_PY: "27" ARCH: '64' - #- PYTHON: "C:\\Miniconda36" - #CONDA_PY: "36" - #ARCH: '32' - #- PYTHON: "C:\\Miniconda36-x64" - #CONDA_PY: "36" - #ARCH: '64' + - PYTHON: "C:\\Miniconda36" + CONDA_PY: "36" + ARCH: '32' + - PYTHON: "C:\\Miniconda36-x64" + CONDA_PY: "36" + ARCH: '64' build: false diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index 9a8439f..ae5de06 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -20,9 +20,9 @@ requirements: - python - packaging - pyyaml - - gitpython==2.1.7 - - requests==2.18 - - future==0.16 + - gitpython + - requests + - future test: requires: From 5a68939ad73d9a3f9c3b70807cbf53ba0d2234a6 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 15 Jan 2019 16:22:20 +0100 Subject: [PATCH 5/6] disable appveyor for py 27 --- appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 728c79b..120a42a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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' From 7cdcb6ecfb3d2aa34277bb927dcdeafdcf26bf2b Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 15 Jan 2019 17:04:43 +0100 Subject: [PATCH 6/6] release 0.0.11 --- devtools/conda-recipe/meta.yaml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/conda-recipe/meta.yaml b/devtools/conda-recipe/meta.yaml index ae5de06..3328f98 100644 --- a/devtools/conda-recipe/meta.yaml +++ b/devtools/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: autorelease # add ".dev0" for unreleased versions - version: "0.0.11.dev0" + version: "0.0.11" source: path: ../../ diff --git a/setup.py b/setup.py index 211bbeb..95ef73e 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ # * VERSION: base version (do not include .dev0, etc -- that's automatic) # * IS_RELEASE: whether this is a release VERSION = "0.0.11" -IS_RELEASE = False +IS_RELEASE = True DEV_NUM = 0 # always 0: we don't do public (pypi) .dev releases PRE_TYPE = "" # a, b, or rc (although we rarely release such versions)