Skip to content

Commit 857a8bd

Browse files
authored
Unpin scipy (#1074)
1 parent 992933d commit 857a8bd

File tree

2 files changed

+46
-22
lines changed

2 files changed

+46
-22
lines changed

pyproject.toml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ dependencies = [
3030
"llvmlite>=0.41.0,<0.43.0 ; sys_platform == 'win32' and python_version >= '3.10' and python_version < '3.12'",
3131
"numpy>=1.21.6",
3232
"pandas>=1.3.5",
33-
"scipy>=1.7.3,<1.16.0",
34-
"statsmodels>=0.13.2",
33+
"scipy>=1.7.3,<1.14 ; python_version < '3.10'",
34+
"scipy>=1.7.3 ; python_version >= '3.10'",
35+
"statsmodels>=0.14.5",
3536
"tqdm",
3637
"fugue>=0.8.1",
3738
"utilsforecast>=0.1.4",
@@ -67,14 +68,8 @@ dev = [
6768
"pip-licenses",
6869
]
6970
dask = ["dask<=2024.12.1", "fugue[dask]>=0.8.1"]
70-
ray = [
71-
"fugue[ray]>=0.8.1 ; python_version < '3.12'",
72-
"protobuf>=3.15.3,<4.0.0 ; python_version < '3.12'",
73-
"numpy<2 ; python_version < '3.12'",
74-
"pandas<2.2 ; python_version < '3.12'",
75-
"ray<=2.10 ; python_version < '3.12'",
76-
]
77-
spark = ["fugue[spark]>=0.8.1"]
71+
ray = ["fugue[ray]>=0.9.4", "protobuf>=3.15.3,<4.0.0 ; python_version < '3.12'"]
72+
spark = ["fugue[spark]>=0.8.1", "pyspark<4.1.0; sys_platform == 'win32'"]
7873
plotly = ["plotly", "plotly-resampler"]
7974
polars = ["polars[numpy]"]
8075
docs = [
@@ -84,8 +79,10 @@ docs = [
8479
]
8580
all = [
8681
"dask<=2024.12.1",
87-
"fugue[dask]>=0.8.1",
88-
"fugue[spark]>=0.8.1",
82+
"fugue[dask]>=0.9.4",
83+
"fugue[spark]>=0.9.4",
84+
"fugue[ray]>=0.9.4; sys_platform != 'win32'",
85+
"pyspark<4.1.0; sys_platform == 'win32'",
8986
"plotly",
9087
"plotly-resampler",
9188
"polars[numpy]",
@@ -107,11 +104,8 @@ all = [
107104
"setuptools<70",
108105
"supersmoother",
109106
"yfinance",
110-
"fugue[ray]>=0.8.1 ; python_version < '3.12'",
111107
"protobuf>=3.15.3,<4.0.0 ; python_version < '3.12'",
112-
"numpy<2 ; python_version < '3.12'",
113-
"pandas<2.2 ; python_version < '3.12'",
114-
"ray<=2.10 ; python_version < '3.12'",
108+
"numpy",
115109
]
116110

117111
[tool.setuptools]

tests/test_distributed_fugue.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pandas as pd
66
import pytest
77

8-
if not sys.version_info >= (3, 12):
8+
if sys.platform != "win32":
99
import ray
1010
from dask.distributed import Client
1111
from fugue_dask import DaskExecutionEngine
@@ -185,17 +185,47 @@ def test_distribute_cv_predictions(df):
185185

186186

187187
# # | eval: false
188+
@pytest.fixture(scope="module")
189+
def ray_session():
190+
"""Initialize Ray once for all tests in this module and shutdown afterwards."""
191+
if sys.platform == "win32":
192+
yield None
193+
return
194+
195+
# Initialize Ray with runtime environment to exclude large files
196+
if not ray.is_initialized():
197+
ray.init(
198+
num_cpus=2,
199+
ignore_reinit_error=True,
200+
include_dashboard=False,
201+
_metrics_export_port=None,
202+
runtime_env={
203+
"working_dir": None, # Don't upload working directory for local testing
204+
},
205+
)
206+
207+
yield ray
208+
209+
# Cleanup: shutdown Ray after all tests in this module complete
210+
if ray.is_initialized():
211+
ray.shutdown()
212+
213+
188214
@pytest.fixture
189-
def ray_df():
215+
def ray_df(ray_session):
216+
"""Generate test data as Ray Dataset."""
217+
if sys.platform == "win32":
218+
pytest.skip("Ray is in beta for Windows.")
219+
190220
# Generate Synthetic Panel Data.
191-
df = generate_series(10).reset_index()
221+
df = generate_series(5).reset_index()
192222
df["unique_id"] = df["unique_id"].astype(str)
193223
df = ray.data.from_pandas(df).repartition(2)
194224
return df
195225

196226

197227
@pytest.mark.skipif(
198-
sys.version_info >= (3, 12), reason="This test is not compatible with Python 3.12+"
228+
sys.platform == "win32", reason="Ray is in beta for Windows."
199229
)
200230
def test_ray_cv_predictions(ray_df):
201231
df = ray_df
@@ -231,7 +261,7 @@ def test_ray_cv_predictions(ray_df):
231261

232262

233263
@pytest.mark.skipif(
234-
sys.version_info >= (3, 12), reason="This test is not compatible with Python 3.12+"
264+
sys.platform == "win32", reason="Ray is in beta for Windows."
235265
)
236266
def test_ray_cv_fallback_model(ray_df):
237267
df = ray_df
@@ -249,7 +279,7 @@ def test_ray_cv_fallback_model(ray_df):
249279
pd.testing.assert_frame_equal(fcst_fugue.astype(fcst_stats.dtypes), fcst_stats)
250280

251281
@pytest.mark.skipif(
252-
sys.version_info >= (3, 12), reason="This test is not compatible with Python 3.12+"
282+
sys.platform == "win32", reason="Ray is in beta for Windows."
253283
)
254284
def test_ray_distributed_exogenous_regressors(df_w_ex):
255285
df_w_ex, train_df, test_df, xreg = df_w_ex

0 commit comments

Comments
 (0)