-
Notifications
You must be signed in to change notification settings - Fork 14
/
flake.nix
70 lines (64 loc) · 2.34 KB
/
flake.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
{
inputs.nixpkgs.url = "nixpkgs/nixos-23.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
python3 = pkgs.python3;
in
rec {
packages.ear = python3.pkgs.buildPythonPackage rec {
name = "ear";
src = ./.;
propagatedBuildInputs = with python3.pkgs; [ numpy scipy six attrs multipledispatch lxml pyyaml importlib-resources ];
nativeBuildInputs = with python3.pkgs; [ setuptools ];
pyproject = true;
doCheck = true;
nativeCheckInputs = with python3.pkgs; [ pytest pytestCheckHook pytest-cov pytest-datafiles soundfile ];
pytestFlagsArray = [ "ear" "-x" ];
preCheck = ''
export PATH="$PATH:$out/bin"
'';
};
defaultPackage = packages.ear;
packages.darker = python3.pkgs.buildPythonPackage rec {
pname = "darker";
version = "1.7.1";
src = python3.pkgs.fetchPypi {
inherit pname version;
hash = "sha256-z0FzvkrSmC5bLrq34IvQ0nFz8kWewbHPZq7JKQ2oDM4=";
};
propagatedBuildInputs = with python3.pkgs; [ black toml isort ];
nativeBuildInputs = with python3.pkgs; [ setuptools ];
pyproject = true;
};
devShells.ear = packages.ear.overridePythonAttrs (attrs: {
propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
python3.pkgs.matplotlib
python3.pkgs.flake8
python3.pkgs.ipython
];
nativeBuildInputs = attrs.nativeBuildInputs ++ [
python3.pkgs.matplotlib
python3.pkgs.flake8
python3.pkgs.ipython
python3.pkgs.black
python3.pkgs.pip
packages.darker
python3.pkgs.venvShellHook
# for building docs
python3.pkgs.sphinx
python3.pkgs.sphinx-rtd-theme
pkgs.graphviz
];
venvDir = "./venv";
postShellHook = ''
python -m pip install -e .
'';
});
devShell = devShells.ear;
}
);
}