Skip to content

Commit 25f8710

Browse files
committed
chore: reorder dependencies
1 parent 42a7cd5 commit 25f8710

File tree

6 files changed

+45
-18
lines changed

6 files changed

+45
-18
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ concurrency:
4242
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4343

4444
env:
45+
OPTREE_CXX_WERROR: "OFF"
46+
_GLIBCXX_USE_CXX11_ABI: "1"
47+
PYTHONUNBUFFERED: "1"
4548
PYTHON_TAG: "py3" # to be updated
4649
PYTHON_VERSION: "3" # to be updated
47-
_GLIBCXX_USE_CXX11_ABI: "1"
4850
COLUMNS: "100"
4951
FORCE_COLOR: "1"
5052
CLICOLOR_FORCE: "1"

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
sphinx
44
sphinx-autoapi
55
sphinx-autobuild
6+
sphinx-autodoc-typehints
67
sphinx-copybutton
78
sphinx-rtd-theme
89
sphinxcontrib-bibtex
9-
sphinx-autodoc-typehints
1010
docutils
1111

1212
--extra-index-url https://download.pytorch.org/whl/cpu
1313

14-
jax[cpu] >= 0.4.6
14+
jax[cpu]
1515
numpy
1616
torch

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,20 @@ jax = ["jax"]
5858
numpy = ["numpy"]
5959
torch = ["torch"]
6060
lint = [
61-
"ruff",
62-
"pylint[spelling]",
63-
"mypy",
61+
"cpplint",
6462
"doc8",
63+
"mypy",
64+
"pre-commit",
6565
"pyenchant",
66+
"pylint[spelling]",
67+
"ruff",
6668
"xdoctest",
67-
"cpplint",
68-
"pre-commit",
6969
]
7070
test = [
7171
"pytest",
7272
"pytest-cov",
7373
"covdefaults",
74+
"xdoctest",
7475
"rich",
7576
# Pin to minimum for compatibility test
7677
"typing-extensions == 4.6.0; python_version < '3.13' and platform_system == 'Linux'",
@@ -84,10 +85,10 @@ docs = [
8485
"sphinx",
8586
"sphinx-autoapi",
8687
"sphinx-autobuild",
88+
"sphinx-autodoc-typehints",
8789
"sphinx-copybutton",
8890
"sphinx-rtd-theme",
8991
"sphinxcontrib-bibtex",
90-
"sphinx-autodoc-typehints",
9192
"docutils",
9293
"jax[cpu]",
9394
"numpy",

tests/concurrent/test_subinterpreters.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
pytest.skip('Test for CPython 3.14+ only', allow_module_level=True)
3131

3232

33-
from concurrent.futures import InterpreterPoolExecutor
33+
from concurrent.futures import InterpreterPoolExecutor, as_completed
3434

3535

3636
if Py_GIL_DISABLED and not Py_DEBUG:
@@ -51,3 +51,16 @@ def run(func, /, *args, **kwargs):
5151
if exception is not None:
5252
raise exception
5353
return future.result()
54+
55+
56+
def concurrent_run(func, /, *args, **kwargs):
57+
futures = [EXECUTOR.submit(func, *args, **kwargs) for _ in range(NUM_FUTURES)]
58+
future2index = {future: i for i, future in enumerate(futures)}
59+
completed_futures = sorted(as_completed(futures), key=future2index.get)
60+
first_exception = next(filter(None, (future.exception() for future in completed_futures)), None)
61+
if first_exception is not None:
62+
raise first_exception
63+
return [future.result() for future in completed_futures]
64+
65+
66+
run(object) # warm-up

tests/concurrent/test_threading.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
atexit.register(EXECUTOR.shutdown)
5656

5757

58+
def run(func, /, *args, **kwargs):
59+
future = EXECUTOR.submit(func, *args, **kwargs)
60+
exception = future.exception()
61+
if exception is not None:
62+
raise exception
63+
return future.result()
64+
65+
5866
def concurrent_run(func, /, *args, **kwargs):
5967
futures = [EXECUTOR.submit(func, *args, **kwargs) for _ in range(NUM_FUTURES)]
6068
future2index = {future: i for i, future in enumerate(futures)}
@@ -65,7 +73,7 @@ def concurrent_run(func, /, *args, **kwargs):
6573
return [future.result() for future in completed_futures]
6674

6775

68-
concurrent_run(object) # warm-up
76+
run(object) # warm-up
6977

7078

7179
@parametrize(

tests/requirements.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
pytest
44
pytest-cov
55
covdefaults
6-
rich
7-
ruff
8-
pylint[spelling]
9-
mypy
10-
doc8
11-
pyenchant
126
xdoctest
7+
rich
8+
139
cpplint
10+
doc8
11+
mypy
1412
pre-commit
13+
pyenchant
14+
pylint[spelling]
15+
ruff
16+
17+
--extra-index-url https://download.pytorch.org/whl/cpu
1518

16-
jax[cpu] >= 0.4.6
19+
jax[cpu]
1720
numpy
1821
torch

0 commit comments

Comments
 (0)