Repository: scikit-hep/cabinetry (language: python)

Issue:
Support for Python 3.12
I do not expect any changes needed in `cabinetry` to support Python 3.12. Currently not all backends of `pyhf` support that version, so official support in `cabinetry` should follow `pyhf`: https://github.com/scikit-hep/pyhf/issues/2372.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index d6020cc1..0f8e8b2d 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -8,6 +8,7 @@ on:
     branches: [ master ]
   pull_request:
     branches: [ master ]
+  workflow_dispatch:
 
 jobs:
   pre-commit:
@@ -16,7 +17,7 @@ jobs:
     - uses: actions/checkout@v4
     - uses: actions/setup-python@v5
       with:
-        python-version: '3.11'
+        python-version: '3.12'
     - uses: pre-commit/action@v3.0.0
 
   test:
@@ -24,7 +25,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.11']
+        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
 
     steps:
     - uses: actions/checkout@v4
@@ -36,6 +37,8 @@ jobs:
       run: |
         python -m pip install --upgrade pip setuptools wheel
         python -m pip install .[test]
+    - name: List installed Python packages
+      run: python -m pip list
     - name: Static code analysis with flake8
       run: |
         # stop the build if there are Python syntax errors or undefined names
@@ -52,6 +55,8 @@ jobs:
     - name: Install pyhf backends
       run: |
         python -m pip install .[pyhf_backends]  # install pyhf backends
+    - name: List installed Python packages
+      run: python -m pip list
     - name: Test with pytest, generate coverage report (skipping typeguard)
       if: matrix.python-version == '3.8'
       run: |
diff --git a/.github/workflows/dependencies-head.yml b/.github/workflows/dependencies-head.yml
index 526d5813..d8e55914 100644
--- a/.github/workflows/dependencies-head.yml
+++ b/.github/workflows/dependencies-head.yml
@@ -13,7 +13,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
-        python-version: ['3.11']
+        python-version: ['3.12']
 
     steps:
     - uses: actions/checkout@v4
@@ -38,7 +38,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
-        python-version: ['3.11']
+        python-version: ['3.12']
 
     steps:
     - uses: actions/checkout@v4
@@ -63,7 +63,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
-        python-version: ['3.11']
+        python-version: ['3.12']
 
     steps:
     - uses: actions/checkout@v4
@@ -89,7 +89,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
-        python-version: ['3.11']
+        python-version: ['3.12']
 
     steps:
     - uses: actions/checkout@v4
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3687a84f..f1e0d568 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,10 +13,10 @@ repos:
         # numpy 1.25 is no longer compatible with Python 3.8, so use Python >=3.9 for type checking
         args: ["--python-version=3.9"]
     -   id: mypy
-        name: mypy with Python 3.11
+        name: mypy with Python 3.12
         files: src/cabinetry
         additional_dependencies: ["numpy>=1.22", "boost-histogram>=1.0.1", "click>=8", "types-tabulate", "types-PyYAML", "hist>=2.3.0"]
-        args: ["--python-version=3.11"]
+        args: ["--python-version=3.12"]
 -   repo: https://github.com/pycqa/flake8
     rev: 7.0.0
     hooks:
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index 29c1c991..c6653fb7 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -9,7 +9,7 @@ version: 2
 build:
   os: ubuntu-22.04
   tools:
-    python: "3.11"
+    python: "3.12"
 
 # Build documentation in the docs/ directory with Sphinx
 sphinx:
diff --git a/setup.cfg b/setup.cfg
index 84fc7f3b..6abee1ab 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,6 +14,7 @@ classifiers =
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
     Programming Language :: Python :: 3.11
+    Programming Language :: Python :: 3.12
     License :: OSI Approved :: BSD License
     Topic :: Scientific/Engineering
     Topic :: Scientific/Engineering :: Physics


Test patch:
diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml
index 809a21e5..0ee3af78 100644
--- a/.github/workflows/test-package.yml
+++ b/.github/workflows/test-package.yml
@@ -19,10 +19,10 @@ jobs:
       with:
         fetch-depth: 0
 
-    - name: Set up Python 3.11
+    - name: Set up Python
       uses: actions/setup-python@v5
       with:
-        python-version: '3.11'
+        python-version: '3.x'
 
     - name: Install python-build, check-manifest, and twine
       run: |