Skip to content

Commit

Permalink
Merge pull request #558 from akaihola/remove-bump-version
Browse files Browse the repository at this point in the history
Move `bump_version.py` to `darkgray-dev-tools`
  • Loading branch information
akaihola authored Mar 15, 2024
2 parents ef3eb5e + 5f7315a commit 7e7aec7
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/test-bump-version.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: bump_version.py check
name: darkgray_bump_version check

on: push # yamllint disable-line rule:truthy

Expand All @@ -11,16 +11,18 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Make sure that `bump_version.py` still finds all version strings
- name: Make sure that `darkgray_bump_version` still finds all version strings
and that there's a future milestone on GitHub Issues.
# If this fails, make sure the regular expressions in `bump_version.py`
# If this fails, make sure the regular expressions in
# release_tools/bump-version-patterns.yaml
# match changes in the files to modify. Also ensure there's a milestone
# in https://github.com/akaihola/darker/milestones with a future
# version number as its name. This is used to update the call for
# reviewing pull requests in `README.rst`.
# in the GitHub repository with a future version number as its name.
# This is used to update the call for reviewing pull requests
# in `README.rst`.
run: |
pip install click packaging requests
python release_tools/bump_version.py \
pip install \
https://github.com/akaihola/darkgray-dev-tools/archive/refs/heads/main.zip
darkgray_bump_version \
--minor \
--dry-run \
--token=${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

extends: default

rules:
line-length:
max: 88
level: warning
ignore: |
release_tools/bump-version-patterns.yaml
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Added
- Mark the Darker package as annotated with type hints.
- Update to ``ioggstream/[email protected]`` in CI.

Removed
-------
- ``bump_version.py`` is now in the separate ``darkgray-dev-tools`` repository.

Fixed
-----

Expand Down
70 changes: 70 additions & 0 deletions release_tools/bump-version-patterns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---

# Below are the regular expression patterns for finding and replacing version and
# milestone numbers in files. Keys are file paths relative to the repository root.
# Values are sets of regular expression pattern strings which contain a magic
# `{OLD->NEW}` expression. For matching text, that expression will be turned into a
# regular expression string which matches the expected version or milestone string in
# the current content of a file. For replacing those matches with updated information,
# `NEW` specifies which kind of a version or milestone number should be used as the
# replacement.
#
# For example, if the current version ("old_version") was `1.0.1` and bumping the minor
# version was requested, the entry
#
# "README.rst":
# - |-
# next version: {old_version->new_version}
#
# would use this regular expression:
#
# `r"next version: (1\.0\.1)"`
#
# in `README.rst` and replace the text matched by the capture group with "1.1".


".github/ISSUE_TEMPLATE/bug_report.md":
- |-
^ - Darker version \[e\.g\. {old_version->new_version}\]
"README.rst":
- |-
^ conda install -c conda-forge darker~={old_version->new_version} isort
- |-
^\.\. _next-milestone: https://github\.com/akaihola/darker/milestone/{any_milestone->next_milestone}
- |-
^ (?: )?rev: {old_version->new_version}
- |-
^\.\. \|next-milestone\| image:: https://img\.shields\.io/github/milestones/progress/akaihola/darker/{any_milestone->next_milestone}
- |-
^ version: "~={old_version->new_version}"
- |-
^ - uses: akaihola/darker@{old_version->new_version}
- |-
^ pip install --upgrade darker~={old_version->new_version}
- |-
label=release%20{any_version->next_version}
"action.yml":
- |-
^ description: \'Version of Darker to use, e\.g\. "~={old_version->new_version}"
- |-
^ description: \'Version of Darker to use, e\.g\. "~=.*?", "{old_version->new_version}"
- |-
^ default: "~={old_version->new_version}"
- |-
^ uses: akaihola/darker/.github/actions/commit-range@{old_version->new_version}
"src/darker/version.py":
- |-
^__version__ *= *\"{old_version->new_version}\"
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ test =
release =
airium>=0.2.3
click>=8.0.0
darkgray-dev-tools @ https://github.com/akaihola/darkgray-dev-tools/archive/refs/heads/main.zip
defusedxml>=0.7.1
requests_cache>=0.7

Expand Down

0 comments on commit 7e7aec7

Please sign in to comment.