8000 BLD: unvendor meson-python on 1.26.x and upgrade to meson-python 0.15 by rgommers · Pull Request #25748 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BLD: unvendor meson-python on 1.26.x and upgrade to meson-python 0.15 #25748

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 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
python-version: "3.x"

- name: Build wheels
uses: pypa/cibuildwheel@0b04ab1040366101259658b355777e4ff2d16f83 # v2.16.4
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@
[submodule "vendored-meson/meson"]
path = vendored-meson/meson
url = https://github.com/numpy/meson.git
[submodule "vendored-meson/meson-python"]
path = vendored-meson/meson-python
url = https://github.com/numpy/meson-python.git
5 changes: 0 additions & 5 deletions LICENSES_bundled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ Files: vendored-meson/meson/*
License: Apache 2.0
For license text, see vendored-meson/meson/COPYING

Name: meson-python
Files: vendored-meson/meson-python/*
License: MIT
For license text, see vendored-meson/meson-python/LICENSE

Name: spin
Files: .spin/cmds.py
License: BSD-3
Expand Down
10000
9 changes: 0 additions & 9 deletions numpy/core/code_generators/genapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,6 @@ def find_functions(filename, tag='API'):
fo.close()
return functions

def should_rebuild(targets, source_files):
from distutils.dep_util import newer_group
for t in targets:
if not os.path.exists(t):
return True
sources = API_FILES + list(source_files) + [__file__]
if newer_group(sources, targets[0], missing='newer'):
return True
return False

def write_file(filename, data):
"""
Expand Down
7 changes: 1 addition & 6 deletions numpy/core/code_generators/generate_numpy_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,7 @@ def generate_api(output_dir, force=False):
targets = (h_file, c_file)

sources = numpy_api.multiarray_api

if (not force and not genapi.should_rebuild(targets, [numpy_api.__file__, __file__])):
return targets
else:
do_generate_api(targets, sources)

do_generate_api(targets, sources)
return targets

def do_generate_api(targets, sources):
Expand Down
7 changes: 1 addition & 6 deletions numpy/core/code_generators/generate_ufunc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,7 @@ def generate_api(output_dir, force=False):
targets = (h_file, c_file)

sources = ['ufunc_api_order.txt']

if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
return targets
else:
do_generate_api(targets, sources)

do_generate_api(targets, sources)
return targets

def do_generate_api(targets, sources):
Expand Down
15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[build-system]
build-backend = "mesonpy"
backend-path = ['./vendored-meson/meson-python']
requires = [
"Cython>=0.29.34,<3.1",
# All dependencies of the vendored meson-python (except for meson, because
# we've got that vendored too - that's the point of this exercise).
'pyproject-metadata >= 0.7.1',
'tomli >= 1.0.0; python_version < "3.11"',
'setuptools >= 60.0; python_version >= "3.12"',
'colorama; os_name == "nt"',
# Note that `ninja` and (on Linux) `patchelf` are added dynamically by
# meson-python if those tools are not already present on the system. No
# need to worry about those unless one does a non-isolated build - in that
# case they must already be installed on the system.
"meson-python>=0.15.0,<0.16.0",
]

[project]
Expand Down Expand Up @@ -191,6 +181,9 @@ environment = {PKG_CONFIG_PATH="/opt/32/lib/pkgconfig"}
config-settings = "setup-args=--vsenv setup-args=-Dallow-noblas=true"
repair-wheel-command = ""

[tool.meson-python]
meson = 'vendored-meson/meson/meson.py'

[tool.spin]
package = 'numpy'

Expand Down
27 changes: 0 additions & 27 deletions vendored-meson/build-backend-wrapper/npbuild/__init__.py

This file was deleted.

23 changes: 0 additions & 23 deletions vendored-meson/entrypoint/meson

This file was deleted.

1 change: 0 additions & 1 deletion vendored-meson/meson-python
Submodule meson-python deleted from 206a31
0