Show the PR link before asking for new version number
This commit is contained in:
+19
-18
@@ -20,6 +20,25 @@ config = [
|
|||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
def bump_version():
|
def bump_version():
|
||||||
|
current_version = cibuildwheel.__version__
|
||||||
|
|
||||||
|
try:
|
||||||
|
commit_date_str = subprocess.run([
|
||||||
|
'git',
|
||||||
|
'show', '-s', '--pretty=format:%ci',
|
||||||
|
f'v{current_version}^{{commit}}'
|
||||||
|
], check=True, capture_output=True, encoding='utf8').stdout
|
||||||
|
commit_date_parts = commit_date_str.split(' ')
|
||||||
|
|
||||||
|
url = 'https://github.com/joerick/cibuildwheel/pulls?' + urllib.parse.urlencode({
|
||||||
|
'q': f'is:pr merged:>{commit_date_parts[0]}T{commit_date_parts[1]}{commit_date_parts[2]}',
|
||||||
|
})
|
||||||
|
print(f'PRs merged since last release:\n {url}')
|
||||||
|
print()
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(e)
|
||||||
|
print('Failed to get previous version tag information.')
|
||||||
|
|
||||||
git_changes_result = subprocess.run(['git diff-index --quiet HEAD --'], shell=True)
|
git_changes_result = subprocess.run(['git diff-index --quiet HEAD --'], shell=True)
|
||||||
repo_has_uncommitted_changes = git_changes_result.returncode != 0
|
repo_has_uncommitted_changes = git_changes_result.returncode != 0
|
||||||
|
|
||||||
@@ -27,7 +46,6 @@ def bump_version():
|
|||||||
print('error: Uncommitted changes detected.')
|
print('error: Uncommitted changes detected.')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
current_version = cibuildwheel.__version__
|
|
||||||
print( 'Current version:', current_version) # noqa
|
print( 'Current version:', current_version) # noqa
|
||||||
new_version = input(' New version: ').strip()
|
new_version = input(' New version: ').strip()
|
||||||
|
|
||||||
@@ -90,23 +108,6 @@ def bump_version():
|
|||||||
print('commit, do that now.')
|
print('commit, do that now.')
|
||||||
print()
|
print()
|
||||||
|
|
||||||
try:
|
|
||||||
commit_date_str = subprocess.run([
|
|
||||||
'git',
|
|
||||||
'show', '-s', '--pretty=format:%ci',
|
|
||||||
f'v{current_version}^{{commit}}'
|
|
||||||
], check=True, capture_output=True, encoding='utf8').stdout
|
|
||||||
commit_date_parts = commit_date_str.split(' ')
|
|
||||||
|
|
||||||
url = 'https://github.com/joerick/cibuildwheel/pulls?' + urllib.parse.urlencode({
|
|
||||||
'q': f'is:pr merged:>{commit_date_parts[0]}T{commit_date_parts[1]}{commit_date_parts[2]}',
|
|
||||||
})
|
|
||||||
print(f'PRs merged since last release:\n {url}')
|
|
||||||
print()
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print(e)
|
|
||||||
print('Failed to get previous version tag information.')
|
|
||||||
|
|
||||||
while input('Type "done" to continue: ').strip().lower() != 'done':
|
while input('Type "done" to continue: ').strip().lower() != 'done':
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user