diff --git a/meson.build b/meson.build index 2a98039ef..7b8986d08 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,7 @@ -project('euphonic', 'c', meson_version: '>=1.1') +project('euphonic', + 'c', + version: run_command('python', 'vers.py').stdout().strip(), + meson_version: '>=1.1') build = get_option('python_only') ? disabler() : [] @@ -16,6 +19,31 @@ if not np.found() # Try default np = declare_dependency(include_directories: np_inc) endif +py_src = { + 'euphonic': ['__init__.py', 'brille.py', 'broadening.py', + 'crystal.py', 'debye_waller.py', 'force_constants.py', + 'io.py', 'plot.py', 'powder.py', 'qpoint_frequencies.py', + 'qpoint_phonon_modes.py', 'sampling.py', 'spectra.py', + 'structure_factor.py', 'util.py', 'validate.py'], + 'euphonic/cli': ['__init__.py', 'brille_convergence.py', + 'dispersion.py', 'dos.py', 'intensity_map.py', + 'optimise_dipole_parameter.py', 'powder_map.py', + 'show_sampling.py', 'utils.py'], + 'euphonic/data': ['__init__.py', 'bluebook.json', 'sears-1992.json', + 'reciprocal_spectroscopy_definitions.txt'], + 'euphonic/readers': ['__init__.py', 'castep.py', 'phonopy.py'], + 'euphonic/styles': ['__init__.py', 'base.mplstyle', 'intensity_widget.mplstyle'], + 'euphonic/writers': ['__init__.py', 'phonon_website.py'], +} + +foreach folder, sources : py_src + inc = [] + foreach source : sources + inc += folder / source + endforeach + py.install_sources(inc, subdir : folder, ) +endforeach + py.extension_module( '_euphonic', src, diff --git a/pyproject.toml b/pyproject.toml index d67c6c7e4..04017ac4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] build-backend = 'mesonpy' requires = ["meson-python", + "meson>=1.1", "packaging", "numpy>=1.24.0", "versioneer[toml]==0.29"] @@ -36,7 +37,8 @@ dependencies = [ "seekpath>=1.1.0", "spglib>=1.9.4", "pint>=0.22", - "threadpoolctl>=3.0.0" + "threadpoolctl>=3.0.0", + "toolz>=0.12.1", ] dynamic = ["version"] diff --git a/vers.py b/vers.py new file mode 100644 index 000000000..86f4fe6f2 --- /dev/null +++ b/vers.py @@ -0,0 +1,4 @@ +import versioneer + +version=versioneer.get_version() +print(version)