Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,20 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.12', '3.13', '3.14']
architecture: [x64, x86]
exclude:
- os: ubuntu-latest
architecture: x86
- os: macos-latest
architecture: x86
steps:
- name: Set up the repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install dependencies
- name: Build
run: |
python -m pip install --upgrade pip
pip install setuptools Cython Sphinx flake8
- name: Freeze pip
python -m pip install .
- name: Test
run: |
pip freeze
- name: Local build
run: |
python setup.py build_ext -i
python test.py || exit 1
git clean -xfd
python test.py
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,21 @@ It provides a single extension class `MemoryAllocator` with `cdef` methods
Memory is freed when the instance of `MemoryAllocator` is deallocated.
On failure to allocate the memory, a proper error is raised.

## Building from source

This project uses [meson-python](https://mesonbuild.com/meson-python/) for
its build backend. A typical editable install looks like:

```shell
python -m pip install -e .
```

# Changelog

## 0.1.5
- Migrate build system to Meson.


## 0.1.4

- Modernize Python metadata, require Python >= 3.8.
Expand Down
34 changes: 34 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
project(
'memory_allocator',
'c', 'cython',
meson_version: '>=1.2.0',
)
# Python
py_module = import('python')
py = py_module.find_installation(pure: false)
py_dep = py.dependency()

py.install_sources(
'src/memory_allocator/__init__.py',
'src/memory_allocator/__init__.pxd',
'src/memory_allocator/memory_allocator.pxd',
'src/memory_allocator/memory.pxd',
'src/memory_allocator/signals.pxd',
subdir: 'memory_allocator',
)

extensions = {
'memory_allocator': files('src/memory_allocator/memory_allocator.pyx'),
'test': files('src/memory_allocator/test.pyx'),
}

src = include_directories('src/memory_allocator')
foreach name, pyx : extensions
py.extension_module(name,
pyx,
include_directories: [src],
dependencies: [py_dep],
install: true,
subdir: 'memory_allocator'
)
endforeach
13 changes: 3 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
[build-system]
requires = [
"setuptools>=61.2",
"Cython",
"Cython>=0.29.30; python_version > '3.10'"
]
build-backend = "setuptools.build_meta"
requires = ["meson-python>=0.15.0", "Cython>=3.0"]
build-backend = "mesonpy"

[project]
name = "memory_allocator"
version = "0.1.4"
description = "An extension class to allocate memory easily with cython"
authors = [
{name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "[email protected]"},
]
dependencies = [
"Cython",
{ name = "Jeroen Demeyer, Nathann Cohen, Jonathan Kliem", email = "[email protected]" },
]
requires-python = ">=3.11"
readme = "README.md"
Expand Down
28 changes: 0 additions & 28 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading