Skip to content

Commit

Permalink
Migrate to meson
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Oct 31, 2024
1 parent 4cfb6f2 commit 07439ed
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 98 deletions.
24 changes: 24 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
project('euphonic', 'c', meson_version: '>=1.1')

build = get_option('python_only') ? disabler() : []

src = ['c/_euphonic.c', 'c/dyn_mat.c', 'c/util.c', 'c/py_util.c', 'c/load_libs.c']

openmp = dependency('openmp', required: false, language: 'c')

py = import('python').find_installation(pure: false)
py_dep = py.dependency()

np = dependency('numpy', required: false)

if not np.found() # Try default
np_inc = include_directories(py.get_path('platlib') / 'numpy/core/include')
np = declare_dependency(include_directories: np_inc)
endif

py.extension_module(
'_euphonic',
src,
dependencies: [build, py_dep, np, openmp],
install: true,
)
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('python_only', type : 'boolean', value : false)
17 changes: 7 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
build-backend = 'mesonpy'
requires = ["meson-python",
"packaging",
"numpy>=1.24.0",
"versioneer[toml]==0.29"]

[project]
name = "Euphonic"
description = "Euphonic calculates phonon bandstructures and inelastic neutron scattering intensities from modelling code output (e.g. CASTEP)"
Expand Down Expand Up @@ -33,13 +40,6 @@ dependencies = [
]
dynamic = ["version"]

[build-system]
requires = ["packaging",
"numpy>=1.24.0",
"versioneer[toml]==0.29",
"setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project.urls]
Homepage = "https://github.com/pace-neutrons/Euphonic"
Repository = "https://github.com/pace-neutrons/Euphonic.git"
Expand Down Expand Up @@ -67,6 +67,3 @@ versionfile_source = "euphonic/_version.py"
versionfile_build = "euphonic/_version.py"
tag_prefix = "v"
parentdir_prefix = "Euphonic-"

[tool.setuptools.packages.find]
include = ["euphonic*"]
88 changes: 0 additions & 88 deletions setup.py

This file was deleted.

0 comments on commit 07439ed

Please sign in to comment.