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

Skip to content

Commit e150c31

Browse files
committed
BUG: fix issue with git-version script, needs a shebang to run
Closes gh-24514
1 parent 07a2e85 commit e150c31

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(
33
'c', 'cpp', 'cython',
44
version: run_command(
55
# This should become `numpy/_version.py` in NumPy 2.0
6-
['python', 'numpy/_build_utils/gitversion.py'],
6+
['numpy/_build_utils/gitversion.py'],
77
check: true).stdout().strip(),
88
license: 'BSD-3',
99
meson_version: '>=1.2.99', # version in vendored-meson is 1.2.99

numpy/_build_utils/gitversion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import os
23
import textwrap
34

numpy/meson.build

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,6 @@ if not have_lapack and not allow_noblas
188188
'for some linear algebra operations).')
189189
endif
190190

191-
# Generate version.py for sdist
192-
gitversion = files('_build_utils/gitversion.py')[0]
193-
python_bin = py.full_path()
194-
meson.add_dist_script(
195-
py,
196-
[gitversion, '--meson-dist', '--write', 'numpy/version.py']
197-
)
198-
199191
# Copy the main __init__.py|pxd files to the build dir (needed for Cython)
200192
__init__py = fs.copyfile('__init__.py')
201193
__init__pxd = fs.copyfile('__init__.pxd')
@@ -257,6 +249,11 @@ endif
257249

258250
np_dir = py.get_install_dir() / 'numpy'
259251

252+
# Generate version.py for sdist
253+
meson.add_dist_script(
254+
['_build_utils/gitversion.py', '--meson-dist', '--write',
255+
'numpy/version.py']
256+
)
260257
if not fs.exists('version.py')
261258
generate_version = custom_target(
262259
'generate-version',

0 commit comments

Comments
 (0)