File tree 5 files changed +43
-3
lines changed
5 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 47
47
cy = meson .get_compiler(' cython' )
48
48
if cy.version().version_compare(' >=3.1.0' )
49
49
add_project_arguments (' -Xfreethreading_compatible=true' , language : ' cython' )
50
+
51
+ # Use shared utility code to reduce wheel sizes
52
+ # copied from https://github.com/scikit-learn/scikit-learn/pull/31151/files
53
+ cy = find_program (cy.cmd_array()[0 ])
54
+ cython_shared_src = custom_target (
55
+ install : false ,
56
+ output : ' _cyutility.c' ,
57
+ command : [
58
+ cy,
59
+ ' -3' ,
60
+ ' --fast-fail' ,
61
+ ' --generate-shared=' + meson .current_build_dir() / ' _cyutility.c' ,
62
+ ],
63
+ )
64
+
65
+ py.extension_module(
66
+ ' _cyutility' ,
67
+ cython_shared_src,
68
+ subdir : ' pandas/_libs' ,
69
+ install : true ,
70
+ )
50
71
endif
51
72
52
73
# Needed by pandas.test() when it looks for the pytest ini options
Original file line number Diff line number Diff line change @@ -148,6 +148,12 @@ if get_option('buildtype') == 'debug'
148
148
cython_args += [' --gdb' ]
149
149
endif
150
150
151
+ # Use shared utility code to reduce wheel sizes
152
+ # copied from https://github.com/scikit-learn/scikit-learn/pull/31151/files
153
+ if cy.version().version_compare(' >=3.1.0' )
154
+ cython_args += [' --shared=pandas._libs._cyutility' ]
155
+ endif
156
+
151
157
foreach ext_name, ext_dict : libs_sources
152
158
py.extension_module(
153
159
ext_name,
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ if get_option('buildtype') == 'debug'
28
28
cython_args += [' --gdb' ]
29
29
endif
30
30
31
+ # Use shared utility code to reduce wheel sizes
32
+ # copied from https://github.com/scikit-learn/scikit-learn/pull/31151/files
33
+ if cy.version().version_compare(' >=3.1.0' )
34
+ cython_args += [' --shared=pandas._libs._cyutility' ]
35
+ endif
36
+
31
37
foreach ext_name, ext_dict : tslibs_sources
32
38
py.extension_module(
33
39
ext_name,
Original file line number Diff line number Diff line change
1
+ cy_args = [' -X always_allow_keywords=true' ]
2
+ # Use shared utility code to reduce wheel sizes
3
+ # copied from https://github.com/scikit-learn/scikit-learn/pull/31151/files
4
+ if cy.version().version_compare(' >=3.1.0' )
5
+ cython_args += [' --shared=pandas._libs._cyutility' ]
6
+ endif
7
+
1
8
py.extension_module(
2
9
' aggregations' ,
3
10
[' aggregations.pyx' ],
4
- cython_args : [ ' -X always_allow_keywords=true ' ] ,
11
+ cython_args : cy_args ,
5
12
include_directories : [inc_np, inc_pd],
6
13
subdir : ' pandas/_libs/window' ,
7
14
override_options : [' cython_language=cpp' ],
@@ -11,7 +18,7 @@ py.extension_module(
11
18
py.extension_module(
12
19
' indexers' ,
13
20
[' indexers.pyx' ],
14
- cython_args : [ ' -X always_allow_keywords=true ' ] ,
21
+ cython_args : cy_args ,
15
22
include_directories : [inc_np, inc_pd],
16
23
subdir : ' pandas/_libs/window' ,
17
24
install : true ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ requires = [
5
5
" meson-python>=0.13.1" ,
6
6
" meson>=1.2.1,<2" ,
7
7
" wheel" ,
8
- " Cython~=3.0.5 " , # Note: sync with setup.py, environment.yml and asv.conf.json
8
+ " Cython==3.1.0rc1 " , # Note: sync with setup.py, environment.yml and asv.conf.json
9
9
# Force numpy higher than 2.0rc1, so that built wheels are compatible
10
10
# with both numpy 1 and 2
11
11
" numpy>=2.0.0rc1" ,
You can’t perform that action at this time.
0 commit comments