Skip to content

Commit aeb4d05

Browse files
authored
Merge pull request #3956 from neutrinoceros/py311_CI
TST: start testing on Python 3.11
2 parents 0d45a83 + b6c2c9f commit aeb4d05

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

.github/workflows/bleeding-edge.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ jobs:
4040
# the '-dev' suffix allows to use alphas and betas if no final release is available yet
4141
# this version should be upgraded as often as possible, typically once a year when numpy
4242
# and Cython are known to be compatible
43-
# for next update (to '3.11-dev', 2022), see https://github.com/numpy/numpy/pull/21308
44-
python-version: '3.10-dev'
43+
python-version: '3.11-dev'
4544

4645
- name: Install dependencies
4746
run: |

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ install_requires =
4343
numpy>=1.14.5
4444
packaging>=20.9
4545
pyparsing>0.0 # hard dependency to MPL. We require it (unconstrained) in case MPL drops it in the future
46-
tomli>=1.2.3
4746
tomli-w>=0.4.0
4847
tqdm>=3.4.0
4948
unyt>=2.8.0
49+
tomli>=1.2.3;python_version < '3.11'
5050
python_requires = >=3.7,<3.12
5151
include_package_data = True
5252
scripts = scripts/iyt
@@ -102,9 +102,9 @@ minimal =
102102
matplotlib==2.2.3
103103
more-itertools==8.4
104104
numpy==1.14.5
105-
tomli==1.2.3
106105
tomli-w==0.4.0
107106
unyt==2.8.0
107+
tomli==1.2.3;python_version < '3.11'
108108
test =
109109
codecov~=2.0.15
110110
coverage~=4.5.1

yt/utilities/configure.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import os
2+
import sys
23
import warnings
34
from typing import Callable, List
45

5-
# TODO: import tomllib from the standard library instead in Python >= 3.11
6-
import tomli as tomllib
76
import tomli_w
87
from more_itertools import always_iterable
98

109
from yt.utilities.configuration_tree import ConfigLeaf, ConfigNode
1110

11+
if sys.version_info >= (3, 11):
12+
import tomllib
13+
else:
14+
import tomli as tomllib
15+
1216
configuration_callbacks: List[Callable[["YTConfig"], None]] = []
1317

1418

yt/visualization/volume_rendering/tests/test_composite.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@ def test_composite_vr(self):
8181
im = sc.render()
8282
im = ImageArray(im.d)
8383
im.write_png("composite.png")
84-
return im

yt/visualization/volume_rendering/tests/test_points.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ def test_points_vr(self):
6666
sc.add_source(points_source)
6767
im = sc.render()
6868
im.write_png("points.png")
69-
return im

yt/visualization/volume_rendering/tests/test_save_render.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@ def test_save_render(self):
4343
# save a different format with/without sigma clips
4444
sc.save(os.path.join(self.tmpdir, "no_clip.jpg"), render=False)
4545
sc.save(os.path.join(self.tmpdir, "clip_2.jpg"), sigma_clip=2, render=False)
46-
47-
return sc

yt/visualization/volume_rendering/tests/test_simple_vr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ def tearDown(self):
3434

3535
def test_simple_vr(self):
3636
ds = fake_random_ds(32)
37-
im, sc = yt.volume_render(ds, fname="test.png", sigma_clip=4.0)
38-
return im, sc
37+
_im, _sc = yt.volume_render(ds, fname="test.png", sigma_clip=4.0)

0 commit comments

Comments
 (0)