Skip to content

Commit 808342e

Browse files
committed
Merge PR #12 from tobiasdiez/meson, version to 0.2.0
Migrate build system to Meson
2 parents c818639 + fa4111e commit 808342e

File tree

13 files changed

+56
-59
lines changed

13 files changed

+56
-59
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,20 @@ jobs:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
2020
python-version: ['3.12', '3.13', '3.14']
21-
architecture: [x64, x86]
22-
exclude:
23-
- os: ubuntu-latest
24-
architecture: x86
25-
- os: macos-latest
26-
architecture: x86
2721
steps:
2822
- name: Set up the repository
2923
uses: actions/checkout@v4
3024
with:
3125
submodules: recursive
3226
fetch-depth: 0
33-
- name: Set up Python ${{ matrix.python-version }}
27+
- name: Set up Python
3428
uses: actions/setup-python@v5
3529
with:
3630
python-version: ${{ matrix.python-version }}
37-
architecture: ${{ matrix.architecture }}
38-
- name: Install dependencies
31+
- name: Build
3932
run: |
4033
python -m pip install --upgrade pip
41-
pip install setuptools Cython Sphinx flake8
42-
- name: Freeze pip
34+
python -m pip install .
35+
- name: Test
4336
run: |
44-
pip freeze
45-
- name: Local build
46-
run: |
47-
python setup.py build_ext -i
48-
python test.py || exit 1
49-
git clean -xfd
37+
python test.py

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+
'src/memory_allocator/__init__.py',
13+
'src/memory_allocator/__init__.pxd',
14+
'src/memory_allocator/memory_allocator.pxd',
15+
'src/memory_allocator/memory.pxd',
16+
'src/memory_allocator/signals.pxd',
17+
subdir: 'memory_allocator',
18+
)
19+
20+
extensions = {
21+
'memory_allocator': files('src/memory_allocator/memory_allocator.pyx'),
22+
'test': files('src/memory_allocator/test.pyx'),
23+
}
24+
25+
src = include_directories('src/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: 4 additions & 11 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"
11-
version = "0.1.4"
7+
version = "0.2.0"
128
description = "An extension class to allocate memory easily with cython"
139
authors = [
14-
{name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "sage-devel@googlegroups.com"},
15-
]
16-
dependencies = [
17-
"Cython",
10+
{ name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "sage-devel@googlegroups.com" },
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)