Skip to content

Commit 42f829e

Browse files
authored
Merge branch 'main' into revert-129
2 parents 624d06d + 962ba5c commit 42f829e

File tree

13 files changed

+333
-146
lines changed

13 files changed

+333
-146
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
extend-ignore = C408,E203,F841,W503
3-
max-complexity = 10
3+
max-complexity = 12
44
max-line-length = 88

.github/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot
5+
- pre-commit-ci

.github/workflows/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
permissions:
1212
contents: read
1313

14+
env:
15+
FORCE_COLOR: 1
16+
1417
jobs:
1518
# Always build & lint package.
1619
build-package:
@@ -21,6 +24,7 @@ jobs:
2124
- uses: actions/checkout@v4
2225
with:
2326
fetch-depth: 0
27+
persist-credentials: false
2428

2529
- uses: hynek/build-and-inspect-python-package@v2
2630

.github/workflows/lint.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
1719
- uses: actions/setup-python@v5
1820
with:
1921
python-version: "3.x"
20-
cache: pip
21-
cache-dependency-path: .github/workflows/lint.yml
22-
- uses: pre-commit/action@v3.0.1
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip wheel
26-
python -m pip install --upgrade safety
27-
python -m pip install --editable .
28-
- run: safety check
22+
- uses: tox-dev/action-pre-commit-uv@v1
23+
- run: uvx safety check

.github/workflows/main.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: tests
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions:
6+
contents: read
7+
58
env:
69
FORCE_COLOR: 1
710

@@ -11,28 +14,31 @@ jobs:
1114
strategy:
1215
fail-fast: false
1316
matrix:
14-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1518
os: [windows-latest, macos-latest, ubuntu-latest]
19+
1620
steps:
1721
- uses: actions/checkout@v4
1822
with:
1923
# fetch all branches and tags
2024
# ref actions/checkout#448
2125
fetch-depth: 0
26+
persist-credentials: false
27+
2228
- name: Set up Python ${{ matrix.python-version }}
2329
uses: actions/setup-python@v5
2430
with:
2531
python-version: ${{ matrix.python-version }}
2632
allow-prereleases: true
27-
cache: pip
28-
cache-dependency-path: pyproject.toml
29-
- name: Install tox
30-
run: |
31-
python -m pip install tox
33+
34+
- name: Install uv
35+
uses: hynek/setup-cached-uv@v2
36+
3237
- name: Run tests
33-
run: tox -e py
38+
run: uvx --with tox-uv tox -e py
39+
3440
- name: Upload coverage
35-
uses: codecov/codecov-action@v4
41+
uses: codecov/codecov-action@v5
3642
with:
3743
flags: ${{ matrix.os }}
3844
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,9 @@ $RECYCLE.BIN/
399399
*.lnk
400400

401401
# End of https://www.gitignore.io/api/git,linux,pydev,python,windows,pycharm+all,jupyternotebook,vim,webstorm,emacs
402+
403+
# hatch-vcs
404+
cherry_picker/_version.py
405+
406+
# Ignore uv.lock
407+
uv.lock

.pre-commit-config.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.6.7
3+
rev: v0.8.6
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
77

88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 24.8.0
9+
rev: 24.10.0
1010
hooks:
1111
- id: black
1212

1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v4.6.0
14+
rev: v5.0.0
1515
hooks:
1616
- id: check-added-large-files
1717
- id: check-case-conflict
@@ -25,38 +25,37 @@ repos:
2525
- id: trailing-whitespace
2626

2727
- repo: https://github.com/python-jsonschema/check-jsonschema
28-
rev: 0.29.2
28+
rev: 0.30.0
2929
hooks:
3030
- id: check-dependabot
3131
- id: check-github-workflows
3232

3333
- repo: https://github.com/rhysd/actionlint
34-
rev: v1.7.1
34+
rev: v1.7.6
3535
hooks:
3636
- id: actionlint
3737

3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v1.10.1
39+
rev: v1.14.1
4040
hooks:
4141
- id: mypy
4242
args:
4343
[
4444
--ignore-missing-imports,
45-
--install-types,
46-
--non-interactive,
4745
--pretty,
4846
--show-error-codes,
4947
.,
5048
]
5149
pass_filenames: false
50+
additional_dependencies: ["types-requests"]
5251

5352
- repo: https://github.com/tox-dev/pyproject-fmt
54-
rev: 2.2.4
53+
rev: v2.5.0
5554
hooks:
5655
- id: pyproject-fmt
5756

5857
- repo: https://github.com/abravalheri/validate-pyproject
59-
rev: v0.19
58+
rev: v0.23
6059
hooks:
6160
- id: validate-pyproject
6261

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 2.4.0
4+
5+
- Add support for Python 3.14 ([PR 145](https://github.com/python/cherry-picker/pull/145)
6+
- Allow passing a base branch that doesn't have version info
7+
([PR 70](https://github.com/python/cherry-picker/pull/70)
8+
- This makes cherry-picker useful for projects other than CPython that don't
9+
have versioned branch names.
10+
11+
## 2.3.0
12+
13+
- Add support for Python 3.13
14+
([PR 127](https://github.com/python/cherry-picker/pull/127),
15+
[PR 134](https://github.com/python/cherry-picker/pull/134))
16+
- Drop support for EOL Python 3.8
17+
([PR 133](https://github.com/python/cherry-picker/pull/133),
18+
[PR 137](https://github.com/python/cherry-picker/pull/137))
19+
- Resolve usernames when the remote ends with a trailing slash ([PR 110](https://github.com/python/cherry-picker/pull/110))
20+
- Optimize `validate_sha()` with `--max-count=1` ([PR 111](https://github.com/python/cherry-picker/pull/111))
21+
- Make # replacing more strict ([PR 115](https://github.com/python/cherry-picker/pull/115))
22+
- Remove multiple commit prefixes ([PR 118](https://github.com/python/cherry-picker/pull/118))
23+
- Handle whitespace when calculating usernames ([PR 132](https://github.com/python/cherry-picker/pull/132))
24+
- Publish to PyPI using Trusted Publishers ([PR 94](https://github.com/python/cherry-picker/pull/94))
25+
- Generate digital attestations for PyPI ([PEP 740](https://peps.python.org/pep-0740/))
26+
([PR 135](https://github.com/python/cherry-picker/pull/135))
27+
328
## 2.2.0
429

530
- Add log messages

README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ Write tests using [pytest](https://docs.pytest.org/).
5050

5151
## Setup info
5252

53-
Requires Python 3.8+.
54-
5553
```console
5654
$ python3 -m venv venv
5755
$ source venv/bin/activate
5856
(venv) $ python -m pip install cherry_picker
5957
```
6058

61-
The cherry picking script assumes that if an `upstream` remote is defined, then
59+
The cherry-picking script assumes that if an `upstream` remote is defined, then
6260
it should be used as the source of upstream changes and as the base for
6361
cherry-pick branches. Otherwise, `origin` is used for that purpose.
6462
You can override this behavior with the `--upstream-remote` option
@@ -139,33 +137,42 @@ repo = "aiohttp"
139137
check_sha = "f382b5ffc445e45a110734f5396728da7914aeb6"
140138
fix_commit_msg = false
141139
default_branch = "devel"
140+
require_version_in_branch_name = false
141+
draft_pr = false
142142
```
143143

144144
Available config options:
145145

146146
```
147-
team github organization or individual nick,
148-
e.g "aio-libs" for https://github.com/aio-libs/aiohttp
149-
("python" by default)
150-
151-
repo github project name,
152-
e.g "aiohttp" for https://github.com/aio-libs/aiohttp
153-
("cpython" by default)
154-
155-
check_sha A long hash for any commit from the repo,
156-
e.g. a sha1 hash from the very first initial commit
157-
("7f777ed95a19224294949e1b4ce56bbffcb1fe9f" by default)
158-
159-
fix_commit_msg Replace # with GH- in cherry-picked commit message.
160-
It is the default behavior for CPython because of external
161-
Roundup bug tracker (https://bugs.python.org) behavior:
162-
#xxxx should point on issue xxxx but GH-xxxx points
163-
on pull-request xxxx.
164-
For projects using GitHub Issues, this option can be disabled.
165-
166-
default_branch Project's default branch name,
167-
e.g "devel" for https://github.com/ansible/ansible
168-
("main" by default)
147+
team github organization or individual nick,
148+
e.g "aio-libs" for https://github.com/aio-libs/aiohttp
149+
("python" by default)
150+
151+
repo github project name,
152+
e.g "aiohttp" for https://github.com/aio-libs/aiohttp
153+
("cpython" by default)
154+
155+
check_sha A long hash for any commit from the repo,
156+
e.g. a sha1 hash from the very first initial commit
157+
("7f777ed95a19224294949e1b4ce56bbffcb1fe9f" by default)
158+
159+
fix_commit_msg Replace # with GH- in cherry-picked commit message.
160+
It is the default behavior for CPython because of external
161+
Roundup bug tracker (https://bugs.python.org) behavior:
162+
#xxxx should point on issue xxxx but GH-xxxx points
163+
on pull-request xxxx.
164+
For projects using GitHub Issues, this option can be disabled.
165+
166+
default_branch Project's default branch name,
167+
e.g "devel" for https://github.com/ansible/ansible
168+
("main" by default)
169+
170+
require_version_in_branch_name Allow backporting to branches whose names don't contain
171+
something that resembles a version number
172+
(i.e. at least two dot-separated numbers).
173+
174+
draft_pr Create PR as draft
175+
(false by default)
169176
```
170177

171178
To customize the tool for used by other project:

cherry_picker/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
from __future__ import annotations
44

5-
import importlib.metadata
5+
from ._version import __version__
66

7-
__version__ = importlib.metadata.version(__name__)
7+
__all__ = ["__version__"]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy