-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
85 lines (80 loc) · 2.2 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "Wraps mbf-bam into an mach-nix importable builder";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/23.11";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
overlays = [];
pkgs = import nixpkgs {inherit system overlays;};
in let
palettable = let
p = pkgs.python39Packages;
in
p.buildPythonPackage rec {
pname = "palettable";
version = "3.3.0";
# buildInputs = [p.pandas];
propagatedBuildInputs = [p.numpy p.setuptools];
src = p.fetchPypi {
inherit pname version;
sha256 = "sha256-cv7Kcc99eYMM1tkYGwLt8ie4Z9UDvslTz5+pG/RIlr0=";
};
};
mizani = let
p = pkgs.python39Packages;
in
p.buildPythonPackage rec {
pname = "mizani";
version = "0.8.1";
# buildInputs = [p.pandas];
propagatedBuildInputs = [p.numpy palettable p.pandas p.matplotlib p.scipy];
src = p.fetchPypi {
inherit pname version;
sha256 = "sha256-itCg76UvG830H2dbZKjA980k52PVO6ztZhPyC9btSSg=";
};
patchPhase = ''
sed -i '3 a version=${version}' setup.cfg
'';
doCheck = false;
};
plotnine = let
p = pkgs.python39Packages;
in
p.buildPythonPackage rec {
pname = "plotnine";
version = "0.10.1";
buildInputs = [mizani];
propagatedBuildInputs = [p.pandas p.statsmodels mizani];
src = p.fetchPypi {
inherit pname version;
sha256 = "sha256-2RKgS2ONz4IsUaZ4i4VmQjI0jVFfFR2zpkwAAZZvaEE=";
};
doCheck = false;
};
mypython = pkgs.python39.withPackages (p: [
#todo: figure out how to derive this from pyproject.toml
p.pytest
p.pytest-mock
p.pytest-cov
p.wrapt
p.pandas
p.numpy
p.natsort
plotnine
]);
in {
# pass in nixpkgs, mach-nix and what you want it to report back as a version
devShell.x86_64-linux = pkgs.mkShell {
# supplx the specific rust version
# be sure to set this back in your build scripts,
# otherwise pyo3 will get recompiled all the time
nativeBuildInputs = [
mypython
];
};
};
}