-
Notifications
You must be signed in to change notification settings - Fork 38
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
python: Use meson-python instead of setuptools #644
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
24b697a
Replace setuptools with meson-python
WillAyd 69cc0a9
Use bootstrap approach instead of subproject
WillAyd abc9f1a
Add version test
WillAyd 75298de
Bootstrap into subprojects directory
WillAyd 84dd8c1
Remove win matrix config
WillAyd 1c50f70
Setup MSVC for cibuildwheel
WillAyd 0fcf0c3
Use miniver again
WillAyd b13064e
assorted cleanups
WillAyd d3a7490
Include flatcc as a subproject
WillAyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
import os | ||
import pathlib | ||
import shutil | ||
|
||
|
||
def main(): | ||
src_dir = pathlib.Path(os.environ["MESON_SOURCE_ROOT"]).parent.resolve() | ||
dist_dir = pathlib.Path(os.environ["MESON_DIST_ROOT"]).resolve() | ||
subproj_dir = dist_dir / "subprojects" / "arrow-nanoarrow" | ||
|
||
if subproj_dir.is_symlink(): | ||
subproj_dir.unlink() | ||
|
||
subproj_dir.mkdir(parents=True) | ||
shutil.copy(src_dir / "meson.build", subproj_dir / "meson.build") | ||
shutil.copy(src_dir / "meson.options", subproj_dir / "meson.options") | ||
|
||
# Copy over any subproject dependency / wrap files | ||
subproj_subproj_dir = subproj_dir / "subprojects" | ||
subproj_subproj_dir.mkdir() | ||
for f in (src_dir / "subprojects").glob("*.wrap"): | ||
shutil.copy(f, subproj_subproj_dir / f.name) | ||
shutil.copytree( | ||
src_dir / "subprojects" / "packagefiles", subproj_subproj_dir / "packagefiles" | ||
) | ||
|
||
target_src_dir = subproj_dir / "src" | ||
shutil.copytree(src_dir / "src", target_src_dir) | ||
|
||
# CMake isn't actually required for building, but the bundle.py script reads from | ||
# its configuration | ||
shutil.copy(src_dir / "CMakeLists.txt", subproj_dir / "CMakeLists.txt") | ||
|
||
subproj_ci_scripts_dir = subproj_dir / "ci" / "scripts" | ||
subproj_ci_scripts_dir.mkdir(parents=True) | ||
shutil.copy( | ||
src_dir / "ci" / "scripts" / "bundle.py", subproj_ci_scripts_dir / "bundle.py" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
project( | ||
'nanoarrow', | ||
'c', 'cython', | ||
version: run_command(['src/nanoarrow/_version.py', '--print'], check: true).stdout().strip(), | ||
license: 'Apache-2.0', | ||
meson_version: '>=1.2.0', | ||
default_options: [ | ||
'warning_level=2', | ||
'c_std=c99', | ||
'default_library=static', | ||
# We need to set these options at the project default_option level | ||
# due to https://github.com/mesonbuild/meson/issues/6728 | ||
'arrow-nanoarrow:ipc=true', | ||
'arrow-nanoarrow:device=true', | ||
'arrow-nanoarrow:namespace=PythonPkg', | ||
], | ||
) | ||
|
||
subdir('src/nanoarrow') | ||
|
||
meson.add_dist_script('python', meson.current_source_dir() / 'generate_dist.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,15 @@ Changelog = "https://github.com/apache/arrow-nanoarrow/blob/main/CHANGELOG.md" | |
|
||
[build-system] | ||
requires = [ | ||
"setuptools >= 61.0.0", | ||
"meson>=1.3.0", | ||
"meson-python", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably need a version constraint here? |
||
"Cython" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = "mesonpy" | ||
|
||
[tool.meson-python.args] | ||
install = ['--skip-subprojects'] | ||
dist = ['--include-subprojects'] | ||
|
||
[tool.pytest.ini_options] | ||
norecursedirs = "subprojects/arrow-nanoarrow" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was a mistake to include the
flatcc_dep
transitively here; I think its only required to build thenanoarrow_ipc
lib itself, but shouldn't be required by libraries that want to usenanoarrow_ipc
(?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear on the difference but yes, the flatcc headers are deliberately not included in nanoarrow's public headers such that a library using nanoarrow does not need
flatcc/*
files in the include path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea this removal here essentially removes the flatcc headers from being included by downstream targets that use the nanoarrow_ipc_dep; this is akin to changing the flatcc target inclusion from PUBLIC to PRIVATE in CMake