Skip to content

Commit dbeaac4

Browse files
authored
Merge pull request #236 from ilastik/upd-npy
Upd numpy to v2
2 parents 61d70a8 + 38fc4b0 commit dbeaac4

File tree

6 files changed

+15
-24
lines changed

6 files changed

+15
-24
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ jobs:
155155
shell: bash -l {0}
156156
run: |
157157
conda build --test --override-channels \
158-
-c ./pkgs -c pytorch -c conda-forge \
158+
-c ./pkgs -c conda-forge \
159159
./pkgs/noarch/${TIKTORCH_PACKAGE_NAME}
160160
- name: macOS Test
161161
if: matrix.os == 'macos-latest'
162162
shell: bash -l {0}
163163
run: |
164164
conda build --test --override-channels \
165-
-c ./pkgs -c pytorch -c conda-forge \
165+
-c ./pkgs -c conda-forge \
166166
./pkgs/noarch/${TIKTORCH_PACKAGE_NAME}
167167
- name: Windows Test
168168
if: matrix.os == 'windows-latest'
@@ -174,5 +174,5 @@ jobs:
174174
shell: cmd /C CALL {0}
175175
run: |
176176
conda build --test --override-channels ^
177-
-c %CD%\pkgs -c pytorch -c conda-forge ^
177+
-c %CD%\pkgs -c conda-forge ^
178178
.\pkgs\noarch\%TIKTORCH_PACKAGE_NAME%

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ repos:
33
rev: 23.3.0
44
hooks:
55
- id: black
6-
language_version: python3.9
6+
language_version: python3.11
77
exclude: (.*_pb2.py|.*_pb2_grpc.py)
88
- repo: https://github.com/timothycrosley/isort
99
rev: 5.12.0

conda-recipe/meta.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ requirements:
3737
{% endif %}
3838
{% endfor %}
3939
run_constrained:
40-
- mkl <2024.1.0 # [linux] until pytorch is compatible with the current version
4140
- cudatoolkit >=10.2
4241
{% for dep in setup_py_data['extras_require']['server-pytorch'] %}
4342
- {{ dep.lower() }}
@@ -57,11 +56,10 @@ test:
5756
{% for dep in setup_py_data['extras_require']['server-pytorch'] %}
5857
- {{ dep.lower() }}
5958
{% endfor %}
60-
- python 3.9.*
59+
- python 3.11.*
6160
- pytest
6261
- pytest-grpc
6362
- pytest-timeout
64-
- cpuonly
6563
imports:
6664
# client
6765
- tiktorch

environment.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: tiktorch-server-env
22
channels:
3-
- pytorch
43
- conda-forge
54
dependencies:
65
# - bioimage.spec via submodule
76
# - bioimage.core via submodule
8-
- python 3.9.*
9-
- numpy >=1.21,<2
10-
- grpcio=1.49.1 # protobuf 5 requires protoc version > 3.19.0 that requires grpcio >= 1.44
7+
- python 3.11.*
8+
- numpy >=2,<3
9+
- grpcio=1.69.0 # protobuf 5 requires protoc version > 3.19.0 that requires grpcio >= 1.44
1110
- marshmallow-union
1211
- marshmallow=3.12.*
1312
- marshmallow-jsonschema
1413
- protobuf
15-
- pyyaml=5.3.*
14+
- pyyaml>5
1615
- requests
1716
- scikit-learn
1817
- scipy
@@ -24,11 +23,10 @@ dependencies:
2423

2524
# pytorch
2625
# remove cpuonly, add cudatoolkit and cudnn for gpu support
27-
- pytorch=2.3.*
26+
- pytorch=2.7.*
2827
# currently it's necessary to force the cpu version, remove
2928
# torchvision pin when going for gpu
3029
# - torchvision
31-
- cpuonly
3230
# - cudatoolkit >=10.2
3331
# - cudnn
3432
- torchvision
@@ -66,8 +64,3 @@ dependencies:
6664
- bump2version
6765
- mypy
6866
- pre_commit
69-
70-
- mkl <2024.1.0 # [linux] until pytorch is compatible with the current version
71-
72-
73-

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"bioimageio.spec",
3131
"bioimageio.core==0.8.0",
3232
"grpcio>=1.31",
33-
"numpy<2", # pytorch 2.2.2-py3.9_0 for macos is compiled with numpy 1.*
33+
"numpy>=2,<3",
3434
"protobuf",
3535
"pydantic>=2.7.0,<2.10",
3636
"pytorch3dunet",

tiktorch/rpc/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import inspect
22
import threading
33
from concurrent.futures import Future
4-
from typing import Callable, Generic, Type, TypeVar, _GenericAlias
4+
from types import GenericAlias
5+
from typing import Callable, Generic, Type, TypeVar
56

67
T = TypeVar("T")
78
S = TypeVar("S")
@@ -107,7 +108,7 @@ def map(self, func: Callable[[T], S]) -> "RPCFuture[S]":
107108

108109

109110
def _checkgenericfut(type_: Type) -> bool:
110-
if isinstance(type_, _GenericAlias):
111+
if isinstance(type_, GenericAlias):
111112
origin = getattr(type_, "__origin__", None)
112113
return origin and issubclass(origin, Future)
113114
return False
@@ -116,5 +117,4 @@ def _checkgenericfut(type_: Type) -> bool:
116117
def isfutureret(func: Callable):
117118
sig = inspect.signature(func)
118119
ret = sig.return_annotation
119-
120-
return (inspect.isclass(ret) and issubclass(sig.return_annotation, Future)) or _checkgenericfut(ret)
120+
return (inspect.isclass(ret) and issubclass(ret, Future)) or _checkgenericfut(ret)

0 commit comments

Comments
 (0)