Skip to content

Commit

Permalink
Initial files for using meson to build
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 16, 2024
1 parent 3a98148 commit 1778e15
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -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,
)
28 changes: 24 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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*"
Expand All @@ -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 = "[email protected]"

[project.license]
text = "BSD"

[project.urls]
Homepage = "https://github.com/astrofrog/fast-histogram"

[project.optional-dependencies]
test = [ "pytest", "hypothesis[numpy]",]

0 comments on commit 1778e15

Please sign in to comment.