Skip to content

Commit

Permalink
Support for Python 3.12 (dask#10544)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored Oct 27, 2023
1 parent aaa04b7 commit 6984914
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/additional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout source
uses: actions/[email protected]
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ jobs:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
environment: ["3.9", "3.10", "3.11"]
environment: ["3.9", "3.10", "3.11", "3.12"]
extra: [null]
exclude:
- os: "macos-latest"
environment: "3.9"
- os: "macos-latest"
environment: "3.10"
- os: "macos-latest"
environment: "3.11"
include:
# Minimum dependencies
- os: "ubuntu-latest"
Expand All @@ -45,7 +47,7 @@ jobs:
environment: "mindeps-optional"
# Pyarrow strings turned on
- os: "ubuntu-latest"
environment: "3.11"
environment: "3.12"
extra: "pyarrow"

env:
Expand Down
79 changes: 79 additions & 0 deletions continuous_integration/environment-3.12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This job includes coverage
name: test-environment
channels:
- conda-forge
- nodefaults
dependencies:
# required dependencies
- python=3.12
- packaging
- pyyaml
- click
- cloudpickle
- partd
- fsspec
- importlib_metadata
- toolz
# test dependencies
- pre-commit
- pytest
- pytest-cov
- pytest-rerunfailures
- pytest-timeout
- pytest-xdist
- moto
# Optional dependencies
- mimesis
- numpy
- pandas
- flask
- fastparquet>=0.8.0
- h5py
- pytables
- zarr
# `tiledb-py=0.17.5` lead to strange seg faults in CI, However 0.18 is needed for 3.11
# https://github.com/dask/dask/pull/9569
# - tiledb-py # crashes on Python 3.11
# - pyspark
# - tiledb>=2.5.0 # crashes on Python 3.11
- xarray
- sqlalchemy>=1.4.16
- pyarrow>=13
- coverage
- jsonschema
# # other -- IO
- boto3
- botocore
- bokeh
- httpretty
- aiohttp
- s3fs
# Need a new `crick` release with support for `numpy=1.24+`
# https://github.com/dask/crick/issues/25
# - crick
- cytoolz
- distributed
- ipython
- ipycytoscape
# until https://github.com/jupyter-widgets/ipywidgets/issues/3731 is fixed
- ipywidgets<8.0.5
- ipykernel<6.22.0
- lz4
# - numba no support for 3.12
- psutil
- requests
- scikit-image
- scikit-learn
- scipy
- python-snappy
- sparse
- cachey
- python-graphviz
# Not available on macOS for Python 3.12 yet
# - python-cityhash
- python-xxhash
- mmh3
- jinja2
- pip
- pip:
- git+https://github.com/dask/distributed
7 changes: 7 additions & 0 deletions dask/array/tests/test_array_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@
import math
import operator
import os
import sys
import time
import warnings
from functools import reduce
from io import StringIO
from operator import add, sub
from threading import Lock

from packaging.version import Version
from tlz import concat, merge
from tlz.curried import identity

import dask
import dask.array as da
from dask._compatibility import PY_VERSION
from dask.array.chunk import getitem
from dask.array.core import (
Array,
Expand Down Expand Up @@ -3910,6 +3913,10 @@ def test_setitem_1d():
dx[index] = 1


@pytest.mark.xfail(
sys.platform == "win32" and PY_VERSION >= Version("3.12.0"),
reason="https://github.com/dask/dask/issues/10604",
)
def test_setitem_hardmask():
x = np.ma.array([1, 2, 3, 4], dtype=int)
x.harden_mask()
Expand Down
6 changes: 4 additions & 2 deletions dask/dataframe/tests/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import numpy as np
import pandas as pd
import pytest
from packaging.version import Version
from pandas.api.types import is_object_dtype

import dask.dataframe as dd
from dask._compatibility import PY_VERSION
from dask.base import compute_as_if_collection
from dask.dataframe._compat import (
PANDAS_GE_140,
Expand Down Expand Up @@ -2135,7 +2137,7 @@ def test_concat5():
False,
True,
marks=pytest.mark.xfail(
PANDAS_GE_220,
PANDAS_GE_220 or PY_VERSION >= Version("3.12.0"),
reason="fails on pandas dev: https://github.com/dask/dask/issues/10558",
raises=AssertionError,
strict=False,
Expand All @@ -2148,7 +2150,7 @@ def test_concat5():
False,
True,
marks=pytest.mark.xfail(
PANDAS_GE_220,
PANDAS_GE_220 or PY_VERSION >= Version("3.12.0"),
reason="fails on pandas dev: https://github.com/dask/dask/issues/10558",
raises=AssertionError,
strict=False,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: System :: Distributed Computing",
]
Expand Down

0 comments on commit 6984914

Please sign in to comment.