master-thesis/python/shell.nix
2021-12-07 11:06:56 +01:00

107 lines
2.5 KiB
Nix

{ pkgs ? import <nixpkgs> {} }:
let
mach-nix = import (builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix";
ref = "master";
}) {
python = "python39Full";
};
fcSpline = (mach-nix.buildPythonPackage
{src=/home/hiro/src/fcSpline;
pname="fcSpline";
version="0.1";
requirements=''
numpy
cython
setuptools
scipy
'';
});
pyEnv = mach-nix.mkPython rec {
packagesExtra = [
fcSpline
(mach-nix.buildPythonPackage
{src=./energy_flow_proper/hops/submodules/stocproc;
pname="stocproc";
packagesExtra = [fcSpline];
# buildInputs.add = [fcSpline];
version = "1.0.1";
requirements = ''
numpy
cython
setuptools
mpmath
scipy
'';
})
(mach-nix.buildPythonPackage
{
src=./energy_flow_proper/hops/submodules/binfootprint;
pname="binfootpriont";
})
(mach-nix.buildPythonPackage
{
src=./energy_flow_proper/hops/submodules/jobmanager;
pname="jobmanager";
})
(mach-nix.buildPythonPackage
{
src=./energy_flow_proper/hops/submodules/progression;
pname="progression";
})
];
_.stocproc.buildInputs.add = [fcSpline];
#_.stocproc.patches = [./stocproc.patch];
requirements = ''
numpy >= 1.20
data-science-types
mypy
beartype
sphinx-autodoc-typehints
numba
quadpy
idesolver
# jupyter-spaces
ptpython
jedi
black
flake8
matplotlib
scipy >= 1.6
jupyter
h5py
sqlitedict
pycairo
pygobject
lmfit
qutip
sphinx
sphinx_rtd_theme
pydata-sphinx-theme
service_factory
typer
nuitka
mcint
tuna
tqdm
'';
ignoreCollisions = true;
providers.tk = "nixpkgs";
_.jupyter.postInstall = ''
rm $out/lib/python*/site-packages/__pycache__/jupyter.cpython-39.pyc
rm $out/lib/python*/site-packages/jupyter.py
'';
};
in
pkgs.mkShell {
buildInputs = [pyEnv pkgs.cairo pkgs.openblas pkgs.sage pkgs.sshfs pkgs.nodePackages.pyright];
BLAS = "${pkgs.lib.strings.makeLibraryPath [pkgs.openblas]}";
shellHook = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BLAS
export PYTHONPATH=$PYTHONPATH:${builtins.toString ./energy_flow_proper/hops}:${builtins.toString ./energy_flow_proper/dependency_hash}:${builtins.toString ./energy_flow_proper}
'';
}