Skip to content

Commit a28bd6f

Browse files
committed
BLD: switch to meson-python
1 parent 0e124bf commit a28bd6f

File tree

7 files changed

+404
-12
lines changed

7 files changed

+404
-12
lines changed

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
# Excluding files from an sdist generated by meson-python
2+
#########################################################
3+
4+
# Note: when adding to this list, be aware that you need to commit your changes
5+
# before they take effect (can be confusing during testing)
6+
7+
.github/* export-ignore
8+
.git* export-ignore
9+
codecov.yml export-ignore
10+
pixi.lock export-ignore
11+
RELEASING.md export-ignore
12+
renovate.json export-ignore
13+
114
# GitHub syntax highlighting
215
pixi.lock linguist-language=YAML linguist-generated=true

RELEASING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
1. Update the version in `src/array_api_extra/__init__.py`
1+
1. Update the version in `meson.build` and `src/array_api_extra/__init__.py`
22
2. Update the lockfile with `pixi update; pixi install`
33
3. Push your changes
44
4. Cut a release via the GitHub GUI
5-
5. Update the version to `{next micro version}.dev0`
5+
5. Update the version to `{next micro version}.dev0` in `meson.build` and `src/array_api_extra/__init__.py`
66
6. `pixi clean cache --pypi; pixi update; pixi install`
77
7. Push your changes
88
8. Merge the automated PR to conda-forge/array-api-extra-feedstock

meson.build

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
project(
2+
'array-api-extra',
3+
version: '0.10.0.dev0'
4+
)
5+
6+
py = import('python').find_installation(pure: false)
7+
8+
sources = {
9+
'array_api_extra': files(
10+
'src/array_api_extra/__init__.py',
11+
'src/array_api_extra/_delegation.py',
12+
'src/array_api_extra/testing.py',
13+
),
14+
'array_api_extra/_lib': files(
15+
'src/array_api_extra/_lib/__init__.py',
16+
'src/array_api_extra/_lib/_at.py',
17+
'src/array_api_extra/_lib/_backends.py',
18+
'src/array_api_extra/_lib/_funcs.py',
19+
'src/array_api_extra/_lib/_lazy.py',
20+
'src/array_api_extra/_lib/_testing.py',
21+
),
22+
'array_api_extra/_lib/_utils': files(
23+
'src/array_api_extra/_lib/_utils/__init__.py',
24+
'src/array_api_extra/_lib/_utils/_compat.py',
25+
'src/array_api_extra/_lib/_utils/_compat.pyi',
26+
'src/array_api_extra/_lib/_utils/_helpers.py',
27+
'src/array_api_extra/_lib/_utils/_typing.py',
28+
'src/array_api_extra/_lib/_utils/_typing.pyi',
29+
),
30+
}
31+
32+
foreach subdir, files : sources
33+
py.install_sources(files, subdir: subdir)
34+
endforeach
35+
36+
subdir('tests')
37+
subdir('vendor_tests')

pixi.lock

Lines changed: 326 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["hatchling"]
3-
build-backend = "hatchling.build"
2+
requires = ["meson-python"]
3+
build-backend = "mesonpy"
44

55
[project]
66
name = "array-api-extra"
@@ -32,22 +32,20 @@ Homepage = "https://github.com/data-apis/array-api-extra"
3232
"Bug Tracker" = "https://github.com/data-apis/array-api-extra/issues"
3333
Changelog = "https://github.com/data-apis/array-api-extra/releases"
3434

35-
# Hatch
35+
# meson-python
3636

37-
[tool.hatch]
38-
version.path = "src/array_api_extra/__init__.py"
37+
[tool.meson-python.wheel]
38+
exclude = ["tests", "vendor_tests"]
3939

40-
[tool.hatch.build.targets.sdist]
41-
exclude = ["codecov.yml", "pixi.lock", "RELEASING.md", "renovate.json"]
42-
43-
#  Pixi
40+
# Pixi
4441

4542
[tool.pixi.workspace]
4643
channels = ["https://prefix.dev/conda-forge"]
4744
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
4845

4946
[tool.pixi.dependencies]
5047
array-api-compat = ">=1.12.0,<2"
48+
meson-python = ">=0.18.0,<0.19"
5149

5250
[tool.pixi.pypi-dependencies]
5351
array-api-extra = { path = ".", editable = true }

tests/meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
py.install_sources([
2+
'__init__.py',
3+
'conftest.py',
4+
'test_at.py',
5+
'test_funcs.py',
6+
'test_helpers.py',
7+
'test_lazy.py',
8+
'test_testing.py',
9+
'test_version.py',
10+
],
11+
subdir: 'tests'
12+
)

vendor_tests/meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
py.install_sources([
2+
'__init__.py',
3+
'_array_api_compat_vendor.py',
4+
'test_vendor.py',
5+
],
6+
subdir: 'vendor_tests'
7+
)

0 commit comments

Comments
 (0)