forked from python-acoustics/python-acoustics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
74 lines (63 loc) · 1.31 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Nix function for building this package
{ lib
, buildPythonPackage
, flit
, flit-core
, wheel
, pytest
, numpy
, scipy
, matplotlib
, pandas
, six
, tabulate
, glibcLocales
, pylint
, yapf
, sphinx
, bootstrapped-pip
, stdenv
, python
, ensureNewerSourcesForZipFilesHook
, development ? false
}:
let
sdist = stdenv.mkDerivation {
name = "acoustics-sdist";
src = ./.;
nativeBuildInputs = [
python
flit # Use flit front-end here because we don't have a sdist hook
wheel
# Ensure files are after 1980 so users not using
# Nix and buildPythonPackage can built a wheel as well.
ensureNewerSourcesForZipFilesHook
];
buildPhase = ":";
installPhase = ''
flit build --format sdist
mkdir -p $out
cp dist/* $out/
'';
strictDeps = true;
};
in buildPythonPackage rec {
pname = "acoustics";
version = "0.2.6";
format = "pyproject";
src = "${sdist}/${pname}*";
checkInputs = [ pytest glibcLocales ];
nativeBuildInputs = [
flit-core
] ++ lib.optionals development [ sphinx pylint yapf ];
propagatedBuildInputs = [ numpy scipy matplotlib pandas six tabulate ];
meta = {
description = "Acoustics module for Python";
};
checkPhase = ''
pushd tests
LC_ALL="en_US.UTF-8" py.test .
popd
'';
passthru.sdist = sdist;
}