Skip to content

Commit

Permalink
Merge pull request #94 from callowayproject/next
Browse files Browse the repository at this point in the history
The next release of bump-my-version
  • Loading branch information
coordt authored Dec 6, 2023
2 parents ff79dc7 + a980670 commit 1888e54
Show file tree
Hide file tree
Showing 28 changed files with 1,112 additions and 651 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/bumpversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@ jobs:
if: ${{ github.event_name != 'workflow_dispatch' }}
shell: bash
run: |
if [[ $RELEASE_KIND != "no-release" ]]; then
bump-my-version bump -v "$RELEASE_KIND"
git push
git push --tags
echo "PACKAGE=true" >> $GITHUB_ENV
fi
PR_NUMBER=$(gh pr view --json number -q .number || echo "")
REVISION=$(git describe --tags --long | awk -F- '{print $2}')
export PR_NUMBER REVISION
case "$RELEASE_KIND" in
major|minor|patch)
bump-my-version bump "$RELEASE_KIND"
if [[ BUMPVERSION_DRY_RUN == "false" ]]; then
git push
git push --tags
echo "PACKAGE=true" >> $GITHUB_ENV
fi
;;
dev)
echo "Intentionally not bumping version for dev release"
;;
esac
- name: Bump Version manual
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.3'
rev: 'v0.1.6'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
exclude: test.*
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -39,11 +39,11 @@ repos:
args: ['--baseline', '.secrets.baseline']
additional_dependencies: ["gibberish-detector"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.7.1
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports]
additional_dependencies: ["pydantic<2.0", "toml", "types-all"]
additional_dependencies: ["pydantic>2.0", "toml", "types-all"]
- repo: https://github.com/jsh9/pydoclint
rev: 0.3.8
hooks:
Expand All @@ -56,6 +56,8 @@ repos:
- id: interrogate
exclude: test.*
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.0
rev: 0.27.2
hooks:
- id: check-azure-pipelines
ci:
autofix_prs: false
8 changes: 6 additions & 2 deletions bumpversion/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from bumpversion.files import ConfiguredFile
from bumpversion.version_part import Version

from bumpversion.config import Config, update_config_file
from bumpversion.config import Config
from bumpversion.config.files import update_config_file, update_ini_config_file
from bumpversion.exceptions import ConfigurationError
from bumpversion.utils import get_context, key_val_string

Expand Down Expand Up @@ -81,7 +82,10 @@ def do_bump(

configured_files = resolve_file_config(config.files_to_modify, config.version_config)
modify_files(configured_files, version, next_version, ctx, dry_run)
update_config_file(config_file, config.current_version, next_version_str, dry_run)
if config_file and config_file.suffix in {".cfg", ".ini"}:
update_ini_config_file(config_file, config.current_version, next_version_str, dry_run)
else:
update_config_file(config_file, config, version, next_version, ctx, dry_run)

ctx = get_context(config, version, next_version)
ctx["new_version"] = next_version_str
Expand Down
6 changes: 3 additions & 3 deletions bumpversion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from bumpversion import __version__
from bumpversion.aliases import AliasedGroup
from bumpversion.bump import do_bump
from bumpversion.config import find_config_file, get_configuration
from bumpversion.config import get_configuration
from bumpversion.config.files import find_config_file
from bumpversion.files import ConfiguredFile, modify_files
from bumpversion.logging import setup_logging
from bumpversion.show import do_show, log_list
from bumpversion.ui import print_warning
from bumpversion.ui import print_warning, setup_logging
from bumpversion.utils import get_context, get_overrides

logger = logging.getLogger(__name__)
Expand Down
Loading

0 comments on commit 1888e54

Please sign in to comment.