Skip to content

Commit 4a75c94

Browse files
committed
Migrate build system to Meson
1 parent c818639 commit 4a75c94

File tree

5 files changed

+50
-41
lines changed

5 files changed

+50
-41
lines changed

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,21 @@ It provides a single extension class `MemoryAllocator` with `cdef` methods
1717
Memory is freed when the instance of `MemoryAllocator` is deallocated.
1818
On failure to allocate the memory, a proper error is raised.
1919

20+
## Building from source
21+
22+
This project uses [meson-python](https://mesonbuild.com/meson-python/) for
23+
its build backend. A typical editable install looks like:
24+
25+
```shell
26+
python -m pip install -e .
27+
```
28+
2029
# Changelog
2130

31+
## 0.1.5
32+
- Migrate build system to Meson.
33+
34+
2235
## 0.1.4
2336

2437
- Modernize Python metadata, require Python >= 3.8.

meson.build

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
project(
2+
'memory_allocator',
3+
'c', 'cython',
4+
meson_version: '>=1.2.0',
5+
)
6+
# Python
7+
py_module = import('python')
8+
py = py_module.find_installation(pure: false)
9+
py_dep = py.dependency()
10+
11+
py.install_sources(
12+
'memory_allocator/__init__.py',
13+
'memory_allocator/__init__.pxd',
14+
'memory_allocator/memory_allocator.pxd',
15+
'memory_allocator/memory.pxd',
16+
'memory_allocator/signals.pxd',
17+
subdir: 'memory_allocator',
18+
)
19+
20+
extensions = {
21+
'memory_allocator': files('memory_allocator/memory_allocator.pyx'),
22+
'test': files('memory_allocator/test.pyx'),
23+
}
24+
25+
src = include_directories('memory_allocator')
26+
foreach name, pyx : extensions
27+
py.extension_module(name,
28+
pyx,
29+
include_directories: [src],
30+
dependencies: [py_dep],
31+
install: true,
32+
subdir: 'memory_allocator'
33+
)
34+
endforeach

pyproject.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=61.2",
4-
"Cython",
5-
"Cython>=0.29.30; python_version > '3.10'"
6-
]
7-
build-backend = "setuptools.build_meta"
2+
requires = ["meson-python>=0.15.0", "Cython>=3.0"]
3+
build-backend = "mesonpy"
84

95
[project]
106
name = "memory_allocator"
117
version = "0.1.4"
128
description = "An extension class to allocate memory easily with cython"
139
authors = [
14-
{name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "[email protected]"},
15-
]
16-
dependencies = [
17-
"Cython",
10+
{ name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "[email protected]" },
1811
]
1912
requires-python = ">=3.11"
2013
readme = "README.md"

setup.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)