Skip to content

Commit 1b61882

Browse files
chore(backport): Update pre-commit hooks (#2492)
* Backport: - PR #2442 - PR #2464 - PR #2474 - PR #2480
1 parent 0b5b9e5 commit 1b61882

39 files changed

+92
-56
lines changed

.github/workflows/bump-version.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ on:
1212
- minor
1313
- major
1414
release_candidate:
15-
type: choice
16-
description: 'Release candidate?'
17-
options:
18-
- false
19-
- true
15+
type: boolean
16+
description: 'Release candidate'
17+
default: false
2018
new_version:
2119
description: 'New version to bump to'
2220
required: true
@@ -27,17 +25,13 @@ on:
2725
required: true
2826
type: string
2927
force:
30-
type: choice
31-
description: 'Force override check?'
32-
options:
33-
- false
34-
- true
28+
type: boolean
29+
description: 'Force override check'
30+
default: false
3531
dry_run:
36-
type: choice
37-
description: 'Perform a dry run to check?'
38-
options:
39-
- true
40-
- false
32+
type: boolean
33+
description: 'Perform a dry run to check'
34+
default: true
4135

4236
jobs:
4337
bump-version:

.github/workflows/publish-package.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ on:
1717
workflow_dispatch:
1818
inputs:
1919
publish:
20-
type: choice
21-
description: 'Publish to TestPyPI?'
22-
options:
23-
- false
24-
- true
20+
type: boolean
21+
description: 'Publish to TestPyPI'
22+
default: false
2523

2624
concurrency:
2725
group: ${{ github.workflow }}-${{ github.ref }}

.pre-commit-config.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v4.6.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-case-conflict
@@ -35,13 +35,13 @@ repos:
3535
- id: rst-inline-touching-normal
3636

3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: "v0.1.9"
38+
rev: "v0.4.3"
3939
hooks:
4040
- id: ruff
4141
args: ["--fix", "--show-fixes"]
4242

4343
- repo: https://github.com/psf/black-pre-commit-mirror
44-
rev: 23.12.1
44+
rev: 24.4.2
4545
hooks:
4646
- id: black-jupyter
4747
types_or: [python, pyi, jupyter]
@@ -50,10 +50,10 @@ repos:
5050
rev: 1.16.0
5151
hooks:
5252
- id: blacken-docs
53-
additional_dependencies: [black==23.12.1]
53+
additional_dependencies: [black==24.4.2]
5454

5555
- repo: https://github.com/pre-commit/mirrors-mypy
56-
rev: v1.8.0
56+
rev: v1.10.0
5757
# check the oldest and newest supported Pythons
5858
hooks:
5959
- &mypy
@@ -64,12 +64,20 @@ repos:
6464
['numpy', 'types-tqdm', 'click', 'types-jsonpatch', 'types-pyyaml', 'types-jsonschema', 'importlib_metadata', 'packaging']
6565
args: ["--python-version=3.8"]
6666
- <<: *mypy
67-
name: mypy with Python 3.11
68-
args: ["--python-version=3.11"]
67+
name: mypy with Python 3.12
68+
args: ["--python-version=3.12"]
6969

7070
- repo: https://github.com/codespell-project/codespell
7171
rev: v2.2.6
7272
hooks:
7373
- id: codespell
7474
files: ^.*\.(py|md|rst)$
7575
args: ["-w", "-L", "hist,gaus"]
76+
77+
- repo: https://github.com/python-jsonschema/check-jsonschema
78+
rev: 0.28.4
79+
hooks:
80+
- id: check-readthedocs
81+
args: ["--verbose"]
82+
- id: check-github-workflows
83+
args: ["--verbose"]

docs/examples/notebooks/ImpactPlot.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@
172172
" model, _, b, e = fitresults()\n",
173173
" widths = pyhf.tensorlib.concatenate(\n",
174174
" [\n",
175-
" model.config.param_set(k).width()\n",
176-
" if model.config.param_set(k).constrained\n",
177-
" else [None] * model.config.param_set(k).n_parameters\n",
175+
" (\n",
176+
" model.config.param_set(k).width()\n",
177+
" if model.config.param_set(k).constrained\n",
178+
" else [None] * model.config.param_set(k).n_parameters\n",
179+
" )\n",
178180
" for k, v in model.config.par_map.items()\n",
179181
" ]\n",
180182
" )\n",

src/pyhf/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The pyhf command line interface."""
2+
23
from pyhf.cli.cli import pyhf as cli
34
from pyhf.cli.rootio import cli as rootio
45
from pyhf.cli.spec import cli as spec

src/pyhf/cli/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The pyhf Command Line Interface."""
2+
23
import logging
34

45
import click

src/pyhf/cli/complete.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'''Shell completions for pyhf.'''
2+
23
import click
34

45
try:

src/pyhf/cli/infer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The inference CLI group."""
2+
23
import logging
34

45
import click

src/pyhf/cli/patchset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The pyhf spec CLI subcommand."""
2+
23
import logging
34

45
import click

src/pyhf/cli/rootio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""CLI subapps to handle conversion from ROOT."""
2+
23
import logging
34

45
import click

0 commit comments

Comments
 (0)