From 1778e15773aa0a0490857b72282c1ebc7a067dc7 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Mon, 16 Sep 2024 11:55:11 +0100 Subject: [PATCH] Initial files for using meson to build --- meson.build | 14 ++++++++++++++ pyproject.toml | 28 ++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..5086031 --- /dev/null +++ b/meson.build @@ -0,0 +1,14 @@ +project('purelib-and-platlib', 'c') + +py = import('python').find_installation(pure: false) + +npy_include_path = run_command(py, ['-c', 'import os; import numpy; print(os.path.abspath(numpy.get_include()))'], + ).stdout().strip() + +py.extension_module( + 'fast_histogram._histogram_core', + 'fast_histogram/_histogram_core.c', + limited_api: '3.9', + include_directories: [npy_include_path], + install: true, +) diff --git a/pyproject.toml b/pyproject.toml index 707caf4..0804b1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,6 @@ [build-system] -requires = ["setuptools", - "setuptools_scm", - "numpy>=2.0.0rc1"] -build-backend = 'setuptools.build_meta' +build-backend = 'mesonpy' +requires = ['meson-python'] [tool.cibuildwheel.linux] skip = "pp310* pp311* pp312*" @@ -26,3 +24,25 @@ environment = { CC="clang" } [tool.isort] profile = "black" line_length = 100 + + +[project] +name = "fast-histogram" +description = "Fast simple 1D and 2D histograms" +readme = "README.rst" +requires-python = ">=3.9" +dependencies = [ "numpy",] +version = "1.0.0" + +[[project.authors]] +name = "Thomas Robitaille" +email = "thomas.robitaille@gmail.com" + +[project.license] +text = "BSD" + +[project.urls] +Homepage = "https://github.com/astrofrog/fast-histogram" + +[project.optional-dependencies] +test = [ "pytest", "hypothesis[numpy]",]