Add support to python 3.13 (#1486)

This commit is contained in:
Li Jiang
2026-01-19 18:31:43 +08:00
committed by GitHub
parent f6a5163e6a
commit f1817ea7b1
7 changed files with 29 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
@@ -74,6 +74,11 @@ jobs:
run: |
pip install pyspark==4.0.1
pip list | grep "pyspark"
- name: On Ubuntu python 3.13, install pyspark 4.1.0
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
run: |
pip install pyspark==4.1.0
pip list | grep "pyspark"
# # TODO: support ray
# - name: If linux and python<3.11, install ray 2
# if: matrix.os == 'ubuntu-latest' && matrix.python-version < '3.11'

View File

@@ -34,7 +34,7 @@ FLAML has a .NET implementation in [ML.NET](http://dot.net/ml), an open-source,
## Installation
The latest version of FLAML requires **Python >= 3.10 and < 3.13**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
The latest version of FLAML requires **Python >= 3.10 and < 3.14**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
```bash
pip install flaml

View File

@@ -1 +1 @@
__version__ = "2.4.1"
__version__ = "2.4.2"

View File

@@ -52,8 +52,8 @@ setuptools.setup(
],
"test": [
"numpy>=1.17,<2.0.0; python_version<'3.13'",
"numpy>2.0.0; python_version>='3.13'",
"jupyter; python_version<'3.13'",
"numpy>=1.17; python_version>='3.13'",
"jupyter",
"lightgbm>=2.3.1",
"xgboost>=0.90,<2.0.0; python_version<'3.11'",
"xgboost>=2.0.0; python_version>='3.11'",
@@ -68,10 +68,10 @@ setuptools.setup(
"pre-commit",
"torch",
"torchvision",
"catboost>=0.26; python_version<'3.13'",
"catboost>=0.26",
"rgf-python",
"optuna>=2.8.0,<=3.6.1",
"openml; python_version<'3.13'",
"openml",
"statsmodels>=0.12.2",
"psutil",
"dataclasses",
@@ -82,7 +82,7 @@ setuptools.setup(
"rouge_score",
"hcrystalball",
"seqeval",
"pytorch-forecasting; python_version<'3.13'",
"pytorch-forecasting",
"mlflow-skinny<=2.22.1", # Refer to https://mvnrepository.com/artifact/org.mlflow/mlflow-spark
"joblibspark>=0.5.0",
"joblib<=1.3.2",
@@ -140,7 +140,7 @@ setuptools.setup(
"prophet>=1.1.5",
"statsmodels>=0.12.2",
"hcrystalball>=0.1.10",
"pytorch-forecasting>=0.10.4; python_version<'3.13'",
"pytorch-forecasting>=0.10.4",
"pytorch-lightning>=1.9.0",
"tensorboardX>=2.6",
],

View File

@@ -188,7 +188,11 @@ def _test_sparse_matrix_classification(estimator):
"n_jobs": 1,
"model_history": True,
}
X_train = scipy.sparse.random(1554, 21, dtype=int)
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
# integer sampling paths which raise "low is out of bounds for int32".
# A float sparse matrix is sufficient to validate sparse-input support.
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
y_train = np.random.randint(3, size=1554)
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)

View File

@@ -368,7 +368,11 @@ class TestMultiClass(unittest.TestCase):
"n_jobs": 1,
"model_history": True,
}
X_train = scipy.sparse.random(1554, 21, dtype=int)
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
# integer sampling paths which raise "low is out of bounds for int32".
# A float sparse matrix is sufficient to validate sparse-input support.
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
y_train = np.random.randint(3, size=1554)
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
print(automl_experiment.classes_)

View File

@@ -262,7 +262,11 @@ class TestMultiClass(unittest.TestCase):
"n_concurrent_trials": 2,
"use_spark": True,
}
X_train = scipy.sparse.random(1554, 21, dtype=int)
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
# integer sampling paths which raise "low is out of bounds for int32".
# A float sparse matrix is sufficient to validate sparse-input support.
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
y_train = np.random.randint(3, size=1554)
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
print(automl_experiment.classes_)