File tree Expand file tree Collapse file tree 6 files changed +19
-2
lines changed Expand file tree Collapse file tree 6 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ jobs:
387
387
- name : Build Environment
388
388
run : |
389
389
python --version
390
- python -m pip install --upgrade pip setuptools wheel numpy==2.1 meson[ninja]==1.2.1 meson-python==0.13.1
390
+ python -m pip install --upgrade pip setuptools wheel numpy meson[ninja]==1.2.1 meson-python==0.13.1
391
391
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
392
392
python -m pip install versioneer[toml]
393
393
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
Original file line number Diff line number Diff line change 17
17
18
18
from pandas .compat ._constants import (
19
19
IS64 ,
20
+ IS_FREE_THREADING ,
20
21
ISMUSL ,
21
22
PY311 ,
22
23
PY312 ,
24
+ PY313 ,
23
25
PYPY ,
24
26
WASM ,
25
27
)
@@ -153,8 +155,10 @@ def is_ci_environment() -> bool:
153
155
"HAS_PYARROW" ,
154
156
"IS64" ,
155
157
"ISMUSL" ,
158
+ "IS_FREE_THREADING" ,
156
159
"PY311" ,
157
160
"PY312" ,
161
+ "PY313" ,
158
162
"PYPY" ,
159
163
"WASM" ,
160
164
"is_numpy_dev" ,
Original file line number Diff line number Diff line change 15
15
16
16
PY311 = sys .version_info >= (3 , 11 )
17
17
PY312 = sys .version_info >= (3 , 12 )
18
+ PY313 = sys .version_info >= (3 , 13 )
18
19
PYPY = platform .python_implementation () == "PyPy"
19
20
WASM = (sys .platform == "emscripten" ) or (platform .machine () in ["wasm32" , "wasm64" ])
21
+ IS_FREE_THREADING = False if not PY313 else sys ._is_gil_enabled ()
20
22
ISMUSL = "musl" in (sysconfig .get_config_var ("HOST_GNU_TYPE" ) or "" )
21
23
REF_COUNT = 2 if PY311 else 3
22
24
23
25
__all__ = [
24
26
"IS64" ,
25
27
"ISMUSL" ,
28
+ "IS_FREE_THREADING" ,
26
29
"PY311" ,
27
30
"PY312" ,
31
+ "PY313" ,
28
32
"PYPY" ,
29
33
"WASM" ,
30
34
]
Original file line number Diff line number Diff line change 13
13
np_version_gte1p24p3 = _nlv >= Version ("1.24.3" )
14
14
np_version_gte1p25 = _nlv >= Version ("1.25" )
15
15
np_version_gt2 = _nlv >= Version ("2.0.0" )
16
+ np_version_gt2p2 = _nlv >= Version ("2.2.0" )
16
17
is_numpy_dev = _nlv .dev is not None
17
18
_min_numpy_ver = "1.23.5"
18
19
Original file line number Diff line number Diff line change 1
1
import numpy as np
2
2
import pytest
3
3
4
+ from pandas .compat import IS_FREE_THREADING
5
+ from pandas .compat .numpy import np_version_gt2p2
6
+
4
7
from pandas import (
5
8
Categorical ,
6
9
DataFrame ,
@@ -45,6 +48,10 @@ def test_replace(replace_kwargs):
45
48
tm .assert_frame_equal (df , df_orig )
46
49
47
50
51
+ @pytest .mark .skipif (
52
+ IS_FREE_THREADING and np_version_gt2p2 ,
53
+ reason = "Segfaults in array_algos.replace.replace_regex" ,
54
+ )
48
55
def test_replace_regex_inplace_refs ():
49
56
df = DataFrame ({"a" : ["aaa" , "bbb" ]})
50
57
df_orig = df .copy ()
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ def _get_literal_string_prefix_len(token_string: str) -> int:
89
89
return 0
90
90
91
91
92
- PRIVATE_FUNCTIONS_ALLOWED = {"sys._getframe" } # no known alternative
92
+ # no known alternative
93
+ PRIVATE_FUNCTIONS_ALLOWED = {"sys._getframe" , "sys._is_gil_enabled" }
93
94
94
95
95
96
def private_function_across_module (file_obj : IO [str ]) -> Iterable [tuple [int , str ]]:
You can’t perform that action at this time.
0 commit comments