Skip to content

Commit

Permalink
Merge pull request #332 from akaihola/release-1.4.2
Browse files Browse the repository at this point in the history
Release 1.4.2
  • Loading branch information
akaihola authored Mar 13, 2022
2 parents fb7243e + 3cc9ac0 commit a1fe70f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If applicable, add copy/paste the output or attach a screenshots to help explain
- OS: [e.g. Windows / macos / Linux distribution & version]
- Python version [e.g. 3.10.0]
- Git version [e.g. 2.33.1]
- Darker version [e.g. 1.4.1]
- Darker version [e.g. 1.4.2]
- Black version [e.g. 22.1.0]
- other reformatter and linter versions [e.g. `isort==5.10.0`, `mypy==0.931`

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
# reviewing pull requests in `README.rst`.
run: |
pip install click packaging requests
python release_tools/bump_version.py --dry-run
python release_tools/bump_version.py --minor --dry-run
13 changes: 12 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ Unreleased_

These features will be included in the next release:

Added
-----

Fixed
-----


1.4.2_ - 2022-03-12
===================

Added
-----
- Document ``isort``'s requirement to be run in the same environment as
Expand Down Expand Up @@ -292,7 +302,8 @@ Added
-----
- Initial implementation

.. _Unreleased: https://github.com/akaihola/darker/compare/1.4.1...HEAD
.. _Unreleased: https://github.com/akaihola/darker/compare/1.4.2...HEAD
.. _1.4.2: https://github.com/akaihola/darker/compare/1.4.1...1.4.2
.. _1.4.1: https://github.com/akaihola/darker/compare/1.4.0...1.4.1
.. _1.4.0: https://github.com/akaihola/darker/compare/1.3.2...1.4.0
.. _1.3.2: https://github.com/akaihola/darker/compare/1.3.1...1.3.2
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
.. |changelog-badge| image:: https://img.shields.io/badge/-change%20log-purple
:alt: Change log
.. _changelog-badge: https://github.com/akaihola/darker/blob/master/CHANGES.rst
.. |next-milestone| image:: https://img.shields.io/github/milestones/progress/akaihola/darker/14?color=red&label=release%201.4.2
.. |next-milestone| image:: https://img.shields.io/github/milestones/progress/akaihola/darker/13?color=red&label=release%201.5.0
:alt: Next milestone
.. _next-milestone: https://github.com/akaihola/darker/milestone/14
.. _next-milestone: https://github.com/akaihola/darker/milestone/13


What?
Expand Down Expand Up @@ -505,7 +505,7 @@ do the following:
1. Append to the created ``.pre-commit-config.yaml`` the following lines::

- repo: https://github.com/akaihola/darker
rev: 1.4.1
rev: 1.4.2
hooks:
- id: darker

Expand All @@ -524,7 +524,7 @@ You can provide arguments, such as enabling isort, by specifying ``args``.
Note the inclusion of the isort Python package under ``additional_dependencies``::

- repo: https://github.com/akaihola/darker
rev: 1.4.1
rev: 1.4.2
hooks:
- id: darker
args: [--isort]
Expand Down Expand Up @@ -564,12 +564,12 @@ Create a file named ``.github/workflows/darker.yml`` inside your repository with
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: akaihola/[email protected].1
- uses: akaihola/[email protected].2
with:
options: "--check --diff"
revision: "master..."
src: "./src"
version: "1.4.1"
version: "1.4.2"
``"uses:"`` specifies which Darker release to get the GitHub Action definition from.
We recommend to pin this to a specific release.
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ inputs:
required: false
default: "."
version:
description: 'Python Version specifier (PEP440) - e.g. "1.4.1"'
description: 'Python Version specifier (PEP440) - e.g. "1.4.2"'
required: false
default: "1.4.1"
default: "1.4.2"
revision:
description: >-
Git revision range to compare when determining modified lines.
Expand All @@ -30,7 +30,7 @@ runs:
steps:
- name: Commit Range
id: commit-range
uses: akaihola/darker/.github/actions/[email protected].1
uses: akaihola/darker/.github/actions/[email protected].2
- name: Run Darker
run: |
# Exists since using github.action_path + path to main script doesn't
Expand Down
19 changes: 11 additions & 8 deletions release_tools/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@
r"^ rev: {old_version->new_version}",
r"^ - uses: akaihola/darker@{old_version->new_version}",
r'^ version: "{old_version->new_version}"',
r"label=release%20{new_version->next_version}",
r"label=release%20{any_version->next_version}",
(
r"^\.\. \|next-milestone\| image::"
r" https://img\.shields\.io/github/milestones/progress/akaihola/darker/"
r"{new_milestone->next_milestone}"
r"{any_milestone->next_milestone}"
),
(
r"^\.\. _next-milestone:"
r" https://github\.com/akaihola/darker/milestone/"
r"{new_milestone->next_milestone}"
r"{any_milestone->next_milestone}"
),
},
".github/ISSUE_TEMPLATE/bug_report.md": {
Expand All @@ -106,7 +106,7 @@ def bump_version(dry_run: bool, increment_major: bool, increment_minor: bool) ->
path = Path(path_str)
content = path.read_text(encoding="utf-8")
for pattern_template in pattern_templates:
# example: pattern_template == r"darker/{new_milestone->next_milestone}"
# example: pattern_template == r"darker/{any_milestone->next_milestone}"
template_match = CAPTURE_RE.search(pattern_template)
if not template_match:
raise NoMatch("Can't find `{CAPTURE_RE}` in `{pattern_template}`")
Expand All @@ -133,16 +133,18 @@ class PatternDict(TypedDict):
Example:
>>> patterns: PatternDict = {
... "any_version": r"\d+(?:\.\d+)*",
... "old_version": r"1\.0",
... "new_version": r"1\.1",
... "new_milestone": r"22",
... "any_milestone": r"\d+",
... }
"""

any_version: str
old_version: str
new_version: str
new_milestone: str
any_milestone: str


class ReplacementDict(TypedDict):
Expand Down Expand Up @@ -191,9 +193,10 @@ def get_replacements(
milestone_numbers = get_milestone_numbers()
next_version = get_next_milestone_version(new_version, milestone_numbers)
patterns: PatternDict = {
"any_version": r"\d+(?:\.\d+)*",
"old_version": re.escape(str(old_version)),
"new_version": re.escape(str(new_version)),
"new_milestone": milestone_numbers[new_version],
"any_milestone": r"\d+",
}
replacements: ReplacementDict = {
"new_version": str(new_version),
Expand Down Expand Up @@ -303,7 +306,7 @@ def lookup_patterns(
"""
current_pattern_name, replacement_name = template_match.groups()
# example: template_match.groups() == ("new_milestone", "next_milestone")
# example: template_match.groups() == ("any_milestone", "next_milestone")
if current_pattern_name not in PATTERN_NAMES:
raise RuntimeError(
f"Pattern name {current_pattern_name!r} for a current value is"
Expand Down
2 changes: 1 addition & 1 deletion src/darker/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The version number for Darker is governed by this file"""

__version__ = "1.4.1"
__version__ = "1.4.2"

0 comments on commit a1fe70f

Please sign in to comment.