-
Notifications
You must be signed in to change notification settings - Fork 44
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 all commits
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 |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| pixi.lock | ||
| vendor_tests/array_api_compat | ||
|
|
||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| project( | ||
| 'array_api_compat', | ||
| version: '1.15.0.dev0', | ||
| license: 'MIT', | ||
| license_files: ['LICENSE'] | ||
| ) | ||
|
|
||
| py = import('python').find_installation() | ||
|
|
||
| sources_raw = { | ||
| 'array_api_compat': [ | ||
| 'src/array_api_compat/__init__.py', | ||
| 'src/array_api_compat/_internal.py', | ||
| ], | ||
|
|
||
| 'array_api_compat/common': [ | ||
| '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': [ | ||
| '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': [ | ||
| 'src/array_api_compat/dask/__init__.py', | ||
| ], | ||
|
|
||
| 'array_api_compat/dask/array': [ | ||
| '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': [ | ||
| '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': [ | ||
| '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', | ||
| ], | ||
| } | ||
|
|
||
| sources = {} | ||
| foreach subdir, paths : sources_raw | ||
| sources += { subdir : files(paths) } | ||
| endforeach | ||
|
|
||
| foreach subdir, files : sources | ||
| py.install_sources(files, subdir: subdir) | ||
| endforeach | ||
|
|
||
| subdir('tests') | ||
| subdir('vendor_tests') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| [workspace] | ||
| channels = ["https://prefix.dev/conda-forge"] | ||
| platforms = ["linux-64", "osx-arm64", "win-64"] | ||
| preview = ["pixi-build"] | ||
| requires-pixi = ">=0.68.1" | ||
|
|
||
| ### array-api-compat package definition ### | ||
|
|
||
| [package.build.backend] | ||
| name = "pixi-build-python" | ||
| version = ">=0.5.1" | ||
|
|
||
| [package.host-dependencies] | ||
| meson-python = "*" | ||
|
|
||
| ### workspace environments ### | ||
|
|
||
| [environments] | ||
| docs = ["docs"] | ||
| tests = ["tests"] | ||
|
|
||
| ### default feature definition ### | ||
|
|
||
| [dev] | ||
| # this pulls in array-api-compat's host dependencies | ||
| array-api-compat.path = "." | ||
|
|
||
| [dependencies] | ||
| array-api-compat.path = "." | ||
|
|
||
| ### non-default feature definitions ### | ||
|
|
||
| [feature.tests.dependencies] | ||
| pytest = "*" | ||
| array-api-strict = "*" | ||
| numpy = "*" | ||
|
|
||
| [feature.tests.tasks.tests] | ||
| cmd = "pytest -v" | ||
| description = "Run tests" | ||
|
|
||
| [feature.tests.tasks.clean-vendor-compat] | ||
| cmd = "rm -rf vendor_tests/array_api_compat" | ||
| description = "Delete the existing vendored version of array-api-compat" | ||
|
|
||
| [feature.tests.tasks.copy-vendor-compat] | ||
| cmd = "cp -r src/array_api_compat vendor_tests/" | ||
| depends-on = ["clean-vendor-compat"] | ||
| description = "Vendor a clean copy of array-api-extra" | ||
|
|
||
| [feature.tests.tasks.tests-vendor] | ||
| cmd = "pytest -v vendor_tests" | ||
| depends-on = ["copy-vendor-compat"] | ||
| description = "Run vendoring tests" | ||
|
|
||
| [feature.docs.dependencies] | ||
| furo = "*" | ||
| linkify-it-py = "*" | ||
| myst-parser = "*" | ||
| sphinx = "*" | ||
| sphinx-copybutton = "*" | ||
| sphinx-autobuild = "*" | ||
|
|
||
| [feature.docs.tasks] | ||
| docs = { cmd = "make html", cwd = "docs", description = "Build docs" } |
| 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', | ||
| ], | ||
| subdir: 'array_api_compat/tests', | ||
| install_tag: 'tests' | ||
| ) |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| py.install_sources([ | ||
| '__init__.py', | ||
| 'test_vendoring.py', | ||
| 'uses_cupy.py', | ||
| 'uses_dask.py', | ||
| 'uses_numpy.py', | ||
| 'uses_torch.py', | ||
| ], | ||
| subdir: 'array_api_compat/vendor_tests', | ||
| install_tag: 'tests' | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,27 +2,28 @@ | |
|
|
||
|
|
||
| def test_vendoring_numpy(): | ||
| from vendor_test import uses_numpy | ||
| from . import uses_numpy | ||
|
|
||
| uses_numpy._test_numpy() | ||
|
|
||
|
|
||
| def test_vendoring_cupy(): | ||
| pytest.importorskip("cupy") | ||
|
|
||
| from vendor_test import uses_cupy | ||
| from . import uses_cupy | ||
|
|
||
| uses_cupy._test_cupy() | ||
|
|
||
|
|
||
| def test_vendoring_torch(): | ||
| pytest.importorskip("torch") | ||
| from vendor_test import uses_torch | ||
| from . import uses_torch | ||
|
|
||
| uses_torch._test_torch() | ||
|
|
||
|
|
||
| def test_vendoring_dask(): | ||
| pytest.importorskip("dask") | ||
| from vendor_test import uses_dask | ||
| from . import uses_dask | ||
|
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. Could you explain this and related changes please?
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.
|
||
|
|
||
| uses_dask._test_dask() | ||
Uh oh!
There was an error while loading. Please reload this page.