Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT Use find_program in meson.build for tempita step #31058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
22aa88f
Test Pyodide 0.27.0a2
agriyakhetarpal Sep 4, 2024
37884ac
Try to fix `js.process` `ModuleNotFoundError`
agriyakhetarpal Sep 4, 2024
d9d43fa
Install Pyodide JS library for testing
agriyakhetarpal Sep 4, 2024
776e2c9
Skip tests that require a network (with `pooch`)
agriyakhetarpal Sep 4, 2024
85d644d
Fix Pyodide NPM installation
agriyakhetarpal Sep 4, 2024
527c151
Don't explicitly set xbuildenv version
agriyakhetarpal Sep 4, 2024
5ba18f0
Install `pyodide-cli`
agriyakhetarpal Sep 4, 2024
d04b38e
Import `sklearn`, try testing without `--pyargs`
agriyakhetarpal Sep 4, 2024
d6708a6
Reinstall xbuildenv manually, install npm-pyodide in doc/
agriyakhetarpal Sep 4, 2024
2760c38
Add TODO note about Azure
agriyakhetarpal Sep 4, 2024
16267d7
Set `PYTHONVERBOSE` and `PYTHONDEBUG` for debugging
agriyakhetarpal Sep 5, 2024
961a9d4
Switch to `maint_tools/` instead of `doc/`
agriyakhetarpal Sep 5, 2024
ee3228e
Clean up changes, use `--pyargs`
agriyakhetarpal Sep 6, 2024
383bf7e
Fix a typo: paralell ➡️ parallel
agriyakhetarpal Sep 6, 2024
7efd95d
Try to run Cython from its pure Python wheel
agriyakhetarpal Sep 6, 2024
cfae5ff
Trigger [pyodide] wheel build, add Cython comment
agriyakhetarpal Sep 6, 2024
3ae370f
Move `tempita.py` to root dir (for now)
agriyakhetarpal Sep 6, 2024
f16a501
Bump verbosity for [pyodide] test suite
agriyakhetarpal Sep 6, 2024
382c8ba
Remove spurious missing `cache` fixture
agriyakhetarpal Sep 6, 2024
049ccca
Trigger [pyodide] tests too
agriyakhetarpal Sep 6, 2024
b398144
Revert "Move `tempita.py` to root dir (for now)"
agriyakhetarpal Sep 9, 2024
3af4ea2
Use `find_program` function for Tempita
agriyakhetarpal Sep 9, 2024
4a45a97
Clean up test dependencies [pyodide]
agriyakhetarpal Sep 9, 2024
745f6f9
Move `tempita` to an inner `meson.build`
agriyakhetarpal Sep 9, 2024
0675412
Revert "Move `tempita` to an inner `meson.build`"
agriyakhetarpal Sep 9, 2024
a9d7e6c
Make tempita usable with `find_program()`
agriyakhetarpal Sep 9, 2024
86247ad
Add Python shebang to `tempita` [pyodide]
agriyakhetarpal Sep 9, 2024
5b4d043
Exclude `_build_utils/` from installation
agriyakhetarpal Sep 9, 2024
8acf67e
Upload [pyodide] wheel artifact for debugging
agriyakhetarpal Sep 9, 2024
ecd3104
Fix `_build_utils/` folder exclusion
agriyakhetarpal Sep 9, 2024
17f1c64
Merge branch 'main' of https://github.com/scikit-learn/scikit-learn i…
lesteve Mar 24, 2025
6759395
on push
lesteve Mar 24, 2025
8bb1c34
Remove non tempita related
lesteve Mar 24, 2025
27dc2bd
Remove unneeded change
lesteve Mar 24, 2025
d213a66
[azure parallel] [pyodide]
lesteve Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if m_dep.found()
add_project_link_arguments('-lm', language : 'c')
endif

tempita = files('sklearn/_build_utils/tempita.py')
tempita = find_program('sklearn/_build_utils/tempita.py')

py = import('python').find_installation(pure: false)

Expand Down
2 changes: 2 additions & 0 deletions sklearn/_build_utils/tempita.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause

Expand Down
2 changes: 1 addition & 1 deletion sklearn/_loss/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _loss_pyx = custom_target(
'_loss_pyx',
output: '_loss.pyx',
input: '_loss.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down
2 changes: 1 addition & 1 deletion sklearn/linear_model/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ foreach name: name_list
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down
24 changes: 12 additions & 12 deletions sklearn/metrics/_pairwise_distances_reduction/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ _datasets_pair_pxd = custom_target(
'_datasets_pair_pxd',
output: '_datasets_pair.pxd',
input: '_datasets_pair.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [tempita, '@INPUT@', '-o', '@OUTDIR@']
)
_datasets_pair_pyx = custom_target(
'_datasets_pair_pyx',
output: '_datasets_pair.pyx',
input: '_datasets_pair.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -50,13 +50,13 @@ _base_pxd = custom_target(
'_base_pxd',
output: '_base.pxd',
input: '_base.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [tempita, '@INPUT@', '-o', '@OUTDIR@']
)
_base_pyx = custom_target(
'_base_pyx',
output: '_base.pyx',
input: '_base.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -77,13 +77,13 @@ _middle_term_computer_pxd = custom_target(
'_middle_term_computer_pxd',
output: '_middle_term_computer.pxd',
input: '_middle_term_computer.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [tempita, '@INPUT@', '-o', '@OUTDIR@']
)
_middle_term_computer_pyx = custom_target(
'_middle_term_computer_pyx',
output: '_middle_term_computer.pyx',
input: '_middle_term_computer.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -105,13 +105,13 @@ _argkmin_pxd = custom_target(
'_argkmin_pxd',
output: '_argkmin.pxd',
input: '_argkmin.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [tempita, '@INPUT@', '-o', '@OUTDIR@']
)
_argkmin_pyx = custom_target(
'_argkmin_pyx',
output: '_argkmin.pyx',
input: '_argkmin.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -133,13 +133,13 @@ _radius_neighbors_pxd = custom_target(
'_radius_neighbors_pxd',
output: '_radius_neighbors.pxd',
input: '_radius_neighbors.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [tempita, '@INPUT@', '-o', '@OUTDIR@']
)
_radius_neighbors_pyx = custom_target(
'_radius_neighbors_pyx',
output: '_radius_neighbors.pyx',
input: '_radius_neighbors.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -161,7 +161,7 @@ _argkmin_classmode_pyx = custom_target(
'_argkmin_classmode_pyx',
output: '_argkmin_classmode.pyx',
input: '_argkmin_classmode.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand All @@ -187,7 +187,7 @@ _radius_neighbors_classmode_pyx = custom_target(
'_radius_neighbors_classmode_pyx',
output: '_radius_neighbors_classmode.pyx',
input: '_radius_neighbors_classmode.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down
4 changes: 2 additions & 2 deletions sklearn/metrics/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _dist_metrics_pxd = custom_target(
'_dist_metrics_pxd',
output: '_dist_metrics.pxd',
input: '_dist_metrics.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# Need to install the generated pxd because it is needed in other subpackages
# Cython code, e.g. sklearn.cluster
install_dir: sklearn_dir / 'metrics',
Expand All @@ -22,7 +22,7 @@ _dist_metrics_pyx = custom_target(
'_dist_metrics_pyx',
output: '_dist_metrics.pyx',
input: '_dist_metrics.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down
4 changes: 2 additions & 2 deletions sklearn/neighbors/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _binary_tree_pxi = custom_target(
'_binary_tree_pxi',
output: '_binary_tree.pxi',
input: '_binary_tree.pxi.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
)

# .pyx is generated so this is needed to make Cython compilation work. The pxi
Expand All @@ -20,7 +20,7 @@ foreach name: name_list
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down
4 changes: 2 additions & 2 deletions sklearn/utils/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ foreach name: util_extension_names
name + '_pxd',
output: name + '.pxd',
input: name + '.pxd.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
)
utils_cython_tree += [pxd]

pyx = custom_target(
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
Expand Down