diff --git a/meson.build b/meson.build index 9c55d2bc807f7..f843a1ff8f45c 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/sklearn/_build_utils/tempita.py b/sklearn/_build_utils/tempita.py index c92ea17d2a9b9..c8a7a35a62fee 100644 --- a/sklearn/_build_utils/tempita.py +++ b/sklearn/_build_utils/tempita.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause diff --git a/sklearn/_loss/meson.build b/sklearn/_loss/meson.build index bb187fd03f71b..ead867dcfa746 100644 --- a/sklearn/_loss/meson.build +++ b/sklearn/_loss/meson.build @@ -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 diff --git a/sklearn/linear_model/meson.build b/sklearn/linear_model/meson.build index 00ab496fb60aa..53d44d45b0a2d 100644 --- a/sklearn/linear_model/meson.build +++ b/sklearn/linear_model/meson.build @@ -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 diff --git a/sklearn/metrics/_pairwise_distances_reduction/meson.build b/sklearn/metrics/_pairwise_distances_reduction/meson.build index 76760ac271cef..4803305e85ec4 100644 --- a/sklearn/metrics/_pairwise_distances_reduction/meson.build +++ b/sklearn/metrics/_pairwise_distances_reduction/meson.build @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/sklearn/metrics/meson.build b/sklearn/metrics/meson.build index 2e01572144707..d788cf08f3add 100644 --- a/sklearn/metrics/meson.build +++ b/sklearn/metrics/meson.build @@ -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', @@ -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 diff --git a/sklearn/neighbors/meson.build b/sklearn/neighbors/meson.build index 22f81d597948b..e7ce9a2972cd3 100644 --- a/sklearn/neighbors/meson.build +++ b/sklearn/neighbors/meson.build @@ -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 @@ -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 diff --git a/sklearn/utils/meson.build b/sklearn/utils/meson.build index 9bbfc01b7b6bf..76b5f0141393d 100644 --- a/sklearn/utils/meson.build +++ b/sklearn/utils/meson.build @@ -54,7 +54,7 @@ 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] @@ -62,7 +62,7 @@ foreach name: util_extension_names 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