Skip to content

Commit 25f7b4a

Browse files
committed
fix typehints in 3.13
put a lower-bound on tensorflow because of tfp issues cast all masks first fix up python/macos versions drop tensorflow drop pytorch fix up tests undo some changes more changes to undo Apply suggestion from @kratsg Apply suggestion from @kratsg revert
1 parent a2fbcf1 commit 25f7b4a

File tree

9 files changed

+14
-7
lines changed

9 files changed

+14
-7
lines changed

.github/workflows/bump-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
echo "steps.script.outputs.old_tag=v${current_tag}"
196196
echo "old_tag=v${current_tag}" >> $GITHUB_OUTPUT
197197
198-
- name: Set up Python 3.13
198+
- name: Set up Python
199199
if: success()
200200
uses: actions/setup-python@v6
201201
with:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- os: macos-latest
3636
python-version: '3.13'
3737
# Intel runner
38-
- os: macos-13
38+
- os: macos-15-intel
3939
python-version: '3.13'
4040

4141
steps:
@@ -49,7 +49,7 @@ jobs:
4949
- name: Install dependencies
5050
run: |
5151
python -m pip install uv
52-
uv pip install --system --upgrade ".[all,test]"
52+
uv pip install --system --upgrade ".[all]" --group test
5353
5454
- name: List installed Python packages
5555
run: python -m pip list

.github/workflows/dependencies-head.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121
strategy:
2222
matrix:
23-
os: [ubuntu-latest, macos-latest, macos-13]
23+
os: [ubuntu-latest, macos-latest, macos-15-intel]
2424
python-version: ['3.13']
2525

2626
steps:

.github/workflows/publish-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
fetch-depth: 0
4343

44-
- name: Set up Python 3.13
44+
- name: Set up Python
4545
uses: actions/setup-python@v6
4646
with:
4747
python-version: '3.13'

.github/workflows/release_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- os: macos-latest
2828
python-version: '3.13'
2929
# Intel runner
30-
- os: macos-13
30+
- os: macos-15-intel
3131
python-version: '3.13'
3232
fail-fast: false
3333

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ warn_unused_configs = true
222222
strict = true
223223
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
224224
warn_unreachable = true
225+
plugins = "numpy.typing.mypy_plugin"
225226

226227
[[tool.mypy.overrides]]
227228
module = [

src/pyhf/tensor/manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def set_backend(
6565
6666
Example:
6767
>>> import pyhf
68+
>>> pyhf.set_backend(b"jax", precision="32b")
69+
>>> pyhf.tensorlib.name
70+
'jax'
71+
>>> pyhf.tensorlib.precision
72+
'32b'
6873
>>> pyhf.set_backend(pyhf.tensor.numpy_backend())
6974
>>> pyhf.tensorlib.name
7075
'numpy'

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def reset_backend():
8989
def backend(request):
9090
# a better way to get the id? all the backends we have so far for testing
9191
param_ids = request._fixturedef.ids
92-
# the backend we're using: numpy, etc...
92+
# the backend we're using: numpy, jax, etc...
9393
param_id = param_ids[request.param_index]
9494
# name of function being called (with params), the original name is .originalname
9595
func_name = request._pyfuncitem.name

tests/test_public_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def test_custom_backend_name_supported():
9999
class custom_backend:
100100
def __init__(self, **kwargs):
101101
self.name = "jax"
102+
self.name = "numpy"
102103
self.precision = '64b'
103104

104105
def _setup(self):

0 commit comments

Comments
 (0)