-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.nix
54 lines (43 loc) · 945 Bytes
/
build.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
{ pkgs ? import <nixpkgs> {}, pythonPackages ? "python3Packages" }:
rec {
package = pythonPackages.buildPythonPackage rec {
pname = "pysrim";
version = "master";
disabled = pythonPackages.isPy27;
src = ./.;
buildInputs = with pythonPackages; [
pytestrunner
];
checkInputs = with pythonPackages; [
pytest
pytestcov
pytest-mock
];
propagatedBuildInputs = with pythonPackages; [
numpy
pyyaml
];
checkPhase = ''
pytest
'';
};
docs = pkgs.stdenv.mkDerivation {
name = "docs";
version = "master";
src = ./.;
buildInputs = with pythonPackages; [
package
sphinx
sphinx_rtd_theme
];
buildPhase = ''
cd docs;
sphinx-apidoc -o source/ ../srim
sphinx-build -b html -d build/doctrees . build/html
'';
installPhase = ''
mkdir -p $out
cp -r build/html/* $out
'';
};
}