Skip to content

Commit

Permalink
Merge pull request #374 from mj-will/support-python-3.12
Browse files Browse the repository at this point in the history
Explicity support Python 3.12
  • Loading branch information
mj-will authored Mar 11, 2024
2 parents b160e31 + 093d3eb commit f969ebb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS, Ubuntu, Windows]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS, Ubuntu, Windows]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ gw = [
]
dev = [
"pre-commit",
"ray[default]",
"ray[default]; sys_platform != 'win32' and python_version < '3.12'",
"corner",
"black>=24.0",
]
Expand Down Expand Up @@ -99,6 +99,7 @@ target-version = [
"py39",
"py310",
"py311",
"py312",
]

[tool.flake8]
Expand Down
4 changes: 1 addition & 3 deletions tests/test_flows/test_base_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def test_base_flow_abstract_methods():
"""Assert an error is raised if the methods are not implemented."""
with pytest.raises(TypeError) as excinfo:
BaseFlow()
assert "instantiate abstract class BaseFlow with abstract method" in str(
excinfo.value
)
assert "instantiate abstract class BaseFlow" in str(excinfo.value)


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flowsampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def test_run_ins_redraw(flow_sampler):
compute_initial_posterior=True,
)

assert ns.draw_posterior_samples.has_calls(
ns.draw_posterior_samples.assert_has_calls(
[
call(
sampling_method="importance_sampling", use_final_samples=False
Expand Down
5 changes: 1 addition & 4 deletions tests/test_gw/test_distance_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ def test_converter_error():
"""Assert an error is raised if the methods are not implemented"""
with pytest.raises(TypeError) as excinfo:
DistanceConverter()
assert (
"abstract methods from_uniform_parameter, to_uniform_parameter"
in str(excinfo.value)
)
assert "abstract methods" in str(excinfo.value)


def test_converter_to_uniform_parameter_error(base_converter):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_proposal/test_base_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_init_with_draw():
model = Mock()
with pytest.raises(TypeError) as excinfo:
Proposal(model)
assert "class Proposal with abstract method" in str(excinfo.value)
assert "class Proposal with" in str(excinfo.value)


def test_initialised(proposal):
Expand Down

0 comments on commit f969ebb

Please sign in to comment.