Skip to content

Commit

Permalink
Further improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Oct 31, 2024
1 parent 7ab3c33 commit cb687cf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
30 changes: 29 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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() : []

Expand All @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
build-backend = 'mesonpy'
requires = ["meson-python",
"meson>=1.1",
"packaging",
"numpy>=1.24.0",
"versioneer[toml]==0.29"]
Expand Down Expand Up @@ -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"]

Expand Down
4 changes: 4 additions & 0 deletions vers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import versioneer

Check notice on line 1 in vers.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

vers.py#L1

Missing module docstring

version=versioneer.get_version()
print(version)

0 comments on commit cb687cf

Please sign in to comment.