Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: start testing on Python 3.11 #3956

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:
# the '-dev' suffix allows to use alphas and betas if no final release is available yet
# this version should be upgraded as often as possible, typically once a year when numpy
# and Cython are known to be compatible
# for next update (to '3.11-dev', 2022), see https://github.com/numpy/numpy/pull/21308
python-version: '3.10-dev'
python-version: '3.11-dev'

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ install_requires =
numpy>=1.14.5
packaging>=20.9
pyparsing>0.0 # hard dependency to MPL. We require it (unconstrained) in case MPL drops it in the future
tomli>=1.2.3
tomli-w>=0.4.0
tqdm>=3.4.0
unyt>=2.8.0
tomli>=1.2.3;python_version < '3.11'
python_requires = >=3.7,<3.12
include_package_data = True
scripts = scripts/iyt
Expand Down Expand Up @@ -102,9 +102,9 @@ minimal =
matplotlib==2.2.3
more-itertools==8.4
numpy==1.14.5
tomli==1.2.3
tomli-w==0.4.0
unyt==2.8.0
tomli==1.2.3;python_version < '3.11'
test =
codecov~=2.0.15
coverage~=4.5.1
Expand Down
8 changes: 6 additions & 2 deletions yt/utilities/configure.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import os
import sys
import warnings
from typing import Callable, List

# TODO: import tomllib from the standard library instead in Python >= 3.11
import tomli as tomllib
import tomli_w
from more_itertools import always_iterable

from yt.utilities.configuration_tree import ConfigLeaf, ConfigNode

if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib

configuration_callbacks: List[Callable[["YTConfig"], None]] = []


Expand Down
1 change: 0 additions & 1 deletion yt/visualization/volume_rendering/tests/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ def test_composite_vr(self):
im = sc.render()
im = ImageArray(im.d)
im.write_png("composite.png")
return im
1 change: 0 additions & 1 deletion yt/visualization/volume_rendering/tests/test_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ def test_points_vr(self):
sc.add_source(points_source)
im = sc.render()
im.write_png("points.png")
return im
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I thought for a minute that removing the return would make this harder to debug, but now I'm not sure that it matters. So I'm OK with this.

2 changes: 0 additions & 2 deletions yt/visualization/volume_rendering/tests/test_save_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ def test_save_render(self):
# save a different format with/without sigma clips
sc.save(os.path.join(self.tmpdir, "no_clip.jpg"), render=False)
sc.save(os.path.join(self.tmpdir, "clip_2.jpg"), sigma_clip=2, render=False)

return sc
3 changes: 1 addition & 2 deletions yt/visualization/volume_rendering/tests/test_simple_vr.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ def tearDown(self):

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