Browse Source

change: remove backwards comatibility for old `shore bump` syntax, a relative version bump can now only be controlled via the respective options and no longer via a positional argument

master
Niklas Rosenstein 1 year ago
parent
commit
6365430245
No known key found for this signature in database GPG Key ID: 6D269B33D25F6C6
2 changed files with 10 additions and 14 deletions
  1. + 6
    - 0
      .changelog/_unreleased.yml
  2. + 4
    - 14
      src/shore/__main__.py

+ 6
- 0
.changelog/_unreleased.yml

@ -19,3 +19,9 @@
component: cli
description: add help to options in `shore bump` command
fixes: []
- type: change
component: cli
description: remove backwards comatibility for old `shore bump` syntax, a relative
version bump can now only be controlled via the respective options and no longer
via a positional argument
fixes: []

+ 4
- 14
src/shore/__main__.py

@ -427,13 +427,11 @@ def _get_version_refs(subject) -> List[VersionRef]:
@click.option('--update', is_flag=True, help='run "shore update" after the bump')
@click.option('--publish', metavar='target', help='run "shore publish" for the specified target after the bump')
def bump(**args):
""" Bump version numbers. Either supply a target "version" (may require --force
if the specified version is lower than the current) or specify one of the --major,
--minor, --patch, --post or --snapshot flags.
"""
Bump the version of the package, and any known files that reference the same version.
The "version" argument can also be one of the strings "major", "minor", "patch",
"post" or "git" which is only for backwards compatibility and will be removed in a
future version of shore.
An explicit version number can be specified as a positional argument. Alternatively, one
of the relative bump options can be used (like --major, or --snapshot).
"""
subject = _load_subject()
@ -451,14 +449,6 @@ def bump(**args):
logger.error('missing arguments: specify a <version> or one of ' + flags)
exit(1)
# Warn for deprecated behavior.
if args['version'] in ('post', 'patch', 'minor', 'major', 'git'):
use_flag = '--' + args['version']
if use_flag == '--git':
use_flag = '--snapshot'
logger.warning('Support for the %r argument is deprecated and will be removed in a '
'future version of Shore. Please use the %s flag instead.', args['version'], use_flag)
if not args['skip_checks']:
_run_checks(subject, True)

Loading…
Cancel
Save