File tree Expand file tree Collapse file tree 5 files changed +43
-3
lines changed Expand file tree Collapse file tree 5 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 4747cy = meson .get_compiler(' cython' )
4848if cy.version().version_compare(' >=3.1.0' )
4949 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+ )
5071endif
5172
5273# 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'
148148 cython_args += [' --gdb' ]
149149endif
150150
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+
151157foreach ext_name, ext_dict : libs_sources
152158 py.extension_module(
153159 ext_name,
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ if get_option('buildtype') == 'debug'
2828 cython_args += [' --gdb' ]
2929endif
3030
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+
3137foreach ext_name, ext_dict : tslibs_sources
3238 py.extension_module(
3339 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+
18py.extension_module(
29 ' aggregations' ,
310 [' aggregations.pyx' ],
4- cython_args : [ ' -X always_allow_keywords=true ' ] ,
11+ cython_args : cy_args ,
512 include_directories : [inc_np, inc_pd],
613 subdir : ' pandas/_libs/window' ,
714 override_options : [' cython_language=cpp' ],
@@ -11,7 +18,7 @@ py.extension_module(
1118py.extension_module(
1219 ' indexers' ,
1320 [' indexers.pyx' ],
14- cython_args : [ ' -X always_allow_keywords=true ' ] ,
21+ cython_args : cy_args ,
1522 include_directories : [inc_np, inc_pd],
1623 subdir : ' pandas/_libs/window' ,
1724 install : true ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ requires = [
55 " meson-python>=0.13.1" ,
66 " meson>=1.2.1,<2" ,
77 " 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
99 # Force numpy higher than 2.0rc1, so that built wheels are compatible
1010 # with both numpy 1 and 2
1111 " numpy>=2.0.0rc1" ,
You can’t perform that action at this time.
0 commit comments