-
Notifications
You must be signed in to change notification settings - Fork 60
feat: Standalone Python installer using Meson #505
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e5059a
feat: Standalone Python installer using Meson
WillAyd b48db86
Remove setup.py
WillAyd 7e40c9d
Merge remote-tracking branch 'upstream/main' into meson-python
WillAyd c4faea5
Add device dep
WillAyd 9cd35cf
Updates
WillAyd 87a8de8
Merge branch 'main' into meson-python
WillAyd e5cca77
typo fix
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 hidden or 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 hidden or 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,24 @@ | ||
| # 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-python', | ||
| 'cython', | ||
| version: '0.15.0', # TODO: don't hard code this | ||
| ) | ||
|
|
||
| subdir('src/nanoarrow') |
This file contains hidden or 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 hidden or 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,66 @@ | ||
| # 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. | ||
|
|
||
| py = import('python').find_installation(pure: false) | ||
|
|
||
| cython_args = [ | ||
| '--include-dir', | ||
| meson.current_build_dir(), | ||
| '--include-dir', | ||
| meson.current_source_dir(), # TODO: should meson handle this natively? | ||
| ] | ||
| if get_option('buildtype') == 'debug' | ||
| cython_args += ['--gdb'] | ||
| endif | ||
|
|
||
| nanoarrow_dep = dependency('nanoarrow') | ||
|
|
||
| generated_pyx = custom_target( | ||
| 'generate-pyx', | ||
| input: meson.current_build_dir(), | ||
| output: 'nanoarrow_c.pxd', | ||
| command: [py, '../../bootstrap.py', '@INPUT@'], | ||
| install: true, | ||
| install_dir: '.', | ||
| #depends: nanoarrow_dep, | ||
| # ERROR: custom_target keyword argument 'depends' was of type | ||
| # array[InternalDependency] but should have been array[BuildTarget | | ||
| # CustomTarget] - seems fragile without this? | ||
|
|
||
| ) | ||
| nanoarrow_c_dep = declare_dependency(sources: generated_pyx) | ||
|
|
||
| # TODO: we need dependencies on nanoarrow_ipc and nanoarrow_device, | ||
| # which should happen as part of https://github.com/apache/arrow-nanoarrow/pull/483 | ||
|
|
||
| py.extension_module( | ||
| '_lib', | ||
| sources: ['_lib.pyx'], | ||
| cython_args: cython_args, | ||
| dependencies: [nanoarrow_dep, nanoarrow_c_dep], | ||
| subdir: 'nanoarrow/', | ||
| install: true, | ||
| ) | ||
|
|
||
| py.extension_module( | ||
| '_ipc_lib', | ||
| sources: ['_ipc_lib.pyx'], | ||
| cython_args: cython_args, | ||
| dependencies: [nanoarrow_dep, nanoarrow_c_dep], | ||
| subdir: 'nanoarrow', | ||
| install: true, | ||
| ) |
This file contains hidden or 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,37 @@ | ||
| # 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. | ||
|
|
||
| [wrap-file] | ||
| directory = arrow-nanoarrow-apache-arrow-nanoarrow-0.5.0 | ||
| source_url = https://github.com/apache/arrow-nanoarrow/archive/refs/tags/apache-arrow-nanoarrow-0.5.0.tar.gz | ||
| source_filename = apache-arrow-nanoarrow-0.5.0.tar.gz | ||
| source_hash = 0ceeaa1fb005dbc89c8c7d1b39f2dba07344e40aa9d885ee25fb55b4d57e331a | ||
| source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/nanoarrow_0.5.0-1/apache-arrow-nanoarrow-0.5.0.tar.gz | ||
| wrapdb_version = 0.5.0-1 | ||
|
|
||
| [provide] | ||
| nanoarrow = nanoarrow_dep | ||
|
|
||
| # For development in the arrow-nanoarrow source tree, you may want to provide | ||
| # an alternate wrap specification. The following example will pull whatever | ||
| # local project is committed to HEAD | ||
| # [wrap-git] | ||
| # url = ../.. | ||
| # revision = HEAD | ||
|
|
||
| # [provide] | ||
| # nanoarrow = nanoarrow_dep | ||
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 have this file set up for demonstration purposes, but what we may want to do is use a wrap file that references the local repository for development purposes, but is replaced with a
meson wrap install nanoarrowcall when we create the sdist