-
Notifications
You must be signed in to change notification settings - Fork 42
BLD/DEV: use meson-python, add a basic Pixi workspace #373
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
8ac6291
3a83dfa
cc09bff
2470147
bac608a
793c4a9
9120e06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,3 +130,5 @@ dmypy.json | |
|
|
||
| # macOS specific iles | ||
| .DS_Store | ||
|
|
||
| pixi.lock | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| project( | ||
| 'array_api_compat', | ||
| version: '1.15.0.dev0', | ||
| license: 'MIT', | ||
| license_files: ['LICENSE'] | ||
| ) | ||
|
|
||
| py = import('python').find_installation() | ||
|
|
||
| sources = { | ||
| 'array_api_compat': files( | ||
| 'src/array_api_compat/__init__.py', | ||
| 'src/array_api_compat/_internal.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/common': files( | ||
| 'src/array_api_compat/common/__init__.py', | ||
| 'src/array_api_compat/common/_aliases.py', | ||
| 'src/array_api_compat/common/_fft.py', | ||
| 'src/array_api_compat/common/_helpers.py', | ||
| 'src/array_api_compat/common/_linalg.py', | ||
| 'src/array_api_compat/common/_typing.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/cupy': files( | ||
| 'src/array_api_compat/cupy/__init__.py', | ||
| 'src/array_api_compat/cupy/_aliases.py', | ||
| 'src/array_api_compat/cupy/_info.py', | ||
| 'src/array_api_compat/cupy/_typing.py', | ||
| 'src/array_api_compat/cupy/fft.py', | ||
| 'src/array_api_compat/cupy/linalg.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/dask': files( | ||
| 'src/array_api_compat/dask/__init__.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/dask/array': files( | ||
| 'src/array_api_compat/dask/array/__init__.py', | ||
| 'src/array_api_compat/dask/array/_aliases.py', | ||
| 'src/array_api_compat/dask/array/_info.py', | ||
| 'src/array_api_compat/dask/array/fft.py', | ||
| 'src/array_api_compat/dask/array/linalg.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/numpy': files( | ||
| 'src/array_api_compat/numpy/__init__.py', | ||
| 'src/array_api_compat/numpy/_aliases.py', | ||
| 'src/array_api_compat/numpy/_info.py', | ||
| 'src/array_api_compat/numpy/_typing.py', | ||
| 'src/array_api_compat/numpy/fft.py', | ||
| 'src/array_api_compat/numpy/linalg.py', | ||
| ), | ||
|
|
||
| 'array_api_compat/torch': files( | ||
| 'src/array_api_compat/torch/__init__.py', | ||
| 'src/array_api_compat/torch/_aliases.py', | ||
| 'src/array_api_compat/torch/_info.py', | ||
| 'src/array_api_compat/torch/_typing.py', | ||
| 'src/array_api_compat/torch/fft.py', | ||
| 'src/array_api_compat/torch/linalg.py', | ||
| ), | ||
| } | ||
|
|
||
| foreach subdir, files : sources | ||
| py.install_sources(files, subdir: subdir) | ||
| endforeach | ||
|
|
||
| subdir('tests') | ||
| subdir('vendor_test') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| py.install_sources([ | ||
| '__init__.py', | ||
| '_helpers.py', | ||
| 'test_all.py', | ||
| 'test_array_namespace.py', | ||
| 'test_common.py', | ||
| 'test_copies_or_views.py', | ||
| 'test_cupy.py', | ||
| 'test_dask.py', | ||
| 'test_isdtype.py', | ||
| 'test_jax.py', | ||
| 'test_no_dependencies.py', | ||
| 'test_torch.py', | ||
| 'test_vendoring.py', | ||
| ], | ||
| subdir: 'array_api_compat/tests' | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| py.install_sources([ | ||
| '__init__.py', | ||
| 'uses_cupy.py', | ||
| 'uses_dask.py', | ||
| 'uses_numpy.py', | ||
| 'uses_torch.py', | ||
| ], | ||
| subdir: 'array_api_compat/vendor_test' | ||
| ) | ||
|
|
||
| subdir('vendored') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| py.install_sources([ | ||
| '__init__.py', | ||
| ], | ||
| subdir: 'array_api_compat/vendor_test/vendored' | ||
| ) | ||
|
|
||
| install_symlink( | ||
| '_compat', | ||
| install_dir: 'array_api_compat/vendor_test/vendored', | ||
| pointing_to: '../../', | ||
| ) | ||
|
Member
Author
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. The problem was that I had a dodgy workaround for the symlink. Hopefully now this works.
Member
Author
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. @rgommers can you see what I'm doing wrong with the symlink here? Logs like https://github.com/data-apis/array-api-compat/actions/runs/23195083314/job/67401163424?pr=373 seem to show that it is broken. I've tried poking around with
Member
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. Symlinks aren't supported in wheels, so this looks unfamiliar and is probably not what you want. It is possible to have a symlink in the source tree, but it gets replaced by a copy in an sdist/wheel.
Member
Author
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.
For context, it seems like pointing to the same
Member
Author
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. despite my sunk-cost into making this work for wheels only, we should probably just give up on the symlink and use a Pixi task to populate the directory at test-time, like https://github.com/data-apis/array-api-extra/blob/1c5bb9d65f75132196650de2ca966e2fc36ac15c/pyproject.toml#L146. I think we are pushing meson-python slightly past its limits by trying to mimic the symlink. I had hoped that we could merge this without me having to convert CI over to using Pixi yet, but maybe not...
Member
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. I'm a little confused here about what triggered all this, because there's a lot going on in this PR:
Member
Author
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.
the vendor test is not new, you can see the symlink at https://github.com/data-apis/array-api-compat/tree/main/vendor_test/vendored. The challenge I was trying to get through was dealing with the symlink in meson-python. It would be nicer to just get rid of the symlink and copy things over at test-time, like https://github.com/data-apis/array-api-extra/blob/231b8a50d9baa22ccebdfee571472f0ce46a8a29/pyproject.toml#L145-L146.
Member
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. Ah never noticed (or, no longer remembering) - it's missing from the sdist, which is unsurprising but not ideal.
agreed |
||
Uh oh!
There was an error while loading. Please reload this page.