forked from materialsinnovation/pymks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
101 lines (93 loc) · 2.58 KB
/
shell.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# { pkgs ? (import (builtins.fetchTarball {
# url = "https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz";
# sha256 = "0mhqhq21y5vrr1f30qd2bvydv4bbbslvyzclhw0kdxmkgg3z4c92";
# }) {}) }:
{ pkgs ? (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/20.03-beta.tar.gz";
sha256 = "04g53i02hrdfa6kcla5h1q3j50mx39fchva7z7l32pk699nla4hi";
}) {}) }:
let
pypkgs = pkgs.python3Packages;
sfepy = pypkgs.sfepy.overridePythonAttrs (old: rec {
name = "sfepy_${version}";
version = "2019.4";
src = builtins.fetchurl {
url="https://github.com/sfepy/sfepy/archive/release_${version}.tar.gz";
sha256 = "1l9vgcw09l6bwhgfzlbn68fzpvns25r6nkd1pcp7hz5165hs6zzn";
};
postPatch = ''
# broken test
rm tests/test_homogenization_perfusion.py
rm tests/test_splinebox.py
# slow tests
rm tests/test_input_*.py
rm tests/test_elasticity_small_strain.py
rm tests/test_term_call_modes.py
rm tests/test_refine_hanging.py
rm tests/test_hyperelastic_tlul.py
rm tests/test_poly_spaces.py
rm tests/test_linear_solvers.py
rm tests/test_quadratures.py
'';
});
in
pypkgs.buildPythonPackage rec {
pname = "pymks";
version = "0.3.4.dev";
nativeBuildInputs = with pypkgs; [
sfepy
nbval
numpy
scipy
pytest
matplotlib
sympy
cython
jupyter
pytestcov
nbval
pkgs.pkgs.git
tkinter
setuptools
sfepy
toolz
dask
pylint
flake8
pyfftw
scikitlearn
dask-ml
pandas
dask-glm
multipledispatch
pkgs.graphviz
graphviz
distributed
black
appdirs
toml
tkinter
ipywidgets
pip
pkgs.openssh
zarr
];
src=builtins.filterSource (path: type: type != "directory" || baseNameOf path != ".git") ./.;
preShellHook = ''
export OMPI_MCA_plm_rsh_agent=/usr/bin/ssh
SOURCE_DATE_EPOCH=$(date +%s)
export PYTHONUSERBASE=$PWD/.local
export USER_SITE=`python -c "import site; print(site.USER_SITE)"`
export PYTHONPATH=$PYTHONPATH:$USER_SITE
export PATH=$PATH:$PYTHONUSERBASE/bin
jupyter nbextension install --py widgetsnbextension --user
jupyter nbextension enable widgetsnbextension --user --py
pip install jupyter_contrib_nbextensions --user
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main
pip install --user Deprecated
# To install extra packages use
#
# $ pip install --user <package>
'';
}