Commit 096da69
test(conftest): make GPG-signing fixture work on Windows
Two changes to the `tmp_commitizen_project_with_gpg` fixture and its
helper so that the GPG-related bump tests run reliably on Windows
hosts where `Gpg4win` and `Git for Windows` ship separate gpg
binaries and keyrings:
* `_get_gpg_keyid` now parses `gpg --with-colons` output instead
of relying on a regex over the human-friendly layout. The regex
required LF line endings, which gpg does not produce on Windows
(CRLF), so it always returned `None` and the fixture asserted out.
* The fixture pins `git config gpg.program` to the same gpg binary
it used to create the test key (resolved via `shutil.which`).
Otherwise `git commit -S` invokes the gpg shipped with Git for
Windows, which has a different keyring and reports
`gpg: skipped <fingerprint>: No secret key`.
Behaviour on Linux / macOS is unchanged because `shutil.which` and
`--with-colons` work identically there.
The codespell ignore list is extended with `fpr` so the gpg colon
output prefix used in the parser does not trip the spelling check.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4d99415 commit 096da69
2 files changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
140 | 150 | | |
141 | 151 | | |
142 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | 160 | | |
145 | 161 | | |
| |||
161 | 177 | | |
162 | 178 | | |
163 | 179 | | |
| 180 | + | |
| 181 | + | |
164 | 182 | | |
165 | 183 | | |
166 | 184 | | |
| |||
0 commit comments