Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyscf / default.nix
bloba8c0911276b4cba2a01b043af6c1a16a32da8804
1 { buildPythonPackage
2 , lib
3 , fetchFromGitHub
4 , cmake
5 , blas
6 , libcint
7 , libxc
8 , xcfun
9 , cppe
10 , h5py
11 , numpy
12 , scipy
13 , pytestCheckHook
16 buildPythonPackage rec {
17   pname = "pyscf";
18   version = "2.5.0";
19   format = "setuptools";
21   src = fetchFromGitHub {
22     owner = "pyscf";
23     repo = pname;
24     rev = "refs/tags/v${version}";
25     hash = "sha256-UCchzoYsqeIGViewPf4KedmhYktXLmp5Me4lzb1i8p0=";
26   };
28   # setup.py calls Cmake and passes the arguments in CMAKE_CONFIGURE_ARGS to cmake.
29   nativeBuildInputs = [ cmake ];
30   dontUseCmakeConfigure = true;
31   preConfigure = ''
32     export CMAKE_CONFIGURE_ARGS="-DBUILD_LIBCINT=0 -DBUILD_LIBXC=0 -DBUILD_XCFUN=0"
33     PYSCF_INC_DIR="${libcint}:${libxc}:${xcfun}";
34   '';
36   buildInputs = [
37     blas
38     libcint
39     libxc
40     xcfun
41   ];
43   propagatedBuildInputs = [
44     cppe
45     h5py
46     numpy
47     scipy
48   ];
50   nativeCheckInputs = [ pytestCheckHook ];
51   pythonImportsCheck = [ "pyscf" ];
52   preCheck = ''
53     # Set config used by tests to ensure reproducibility
54     echo 'pbc_tools_pbc_fft_engine = "NUMPY"' > pyscf/pyscf_config.py
55     export OMP_NUM_THREADS=1
56     ulimit -s 20000
57     export PYSCF_CONFIG_FILE=$(pwd)/pyscf/pyscf_config.py
58   '';
60   # Numerically slightly off tests
61   disabledTests = [
62     "test_tdhf_singlet"
63     "test_ab_hf"
64     "test_ea"
65     "test_bz"
66     "h2o_vdz"
67     "test_mc2step_4o4e"
68     "test_ks_noimport"
69     "test_jk_hermi0"
70     "test_j_kpts"
71     "test_k_kpts"
72     "test_lda"
73     "high_cost"
74     "skip"
75     "call_in_background"
76     "libxc_cam_beta_bug"
77     "test_finite_diff_rks_eph"
78     "test_finite_diff_uks_eph"
79     "test_finite_diff_roks_grad"
80     "test_finite_diff_df_roks_grad"
81     "test_frac_particles"
82     "test_nosymm_sa4_newton"
83     "test_pipek"
84     "test_n3_cis_ewald"
85     "test_veff"
86     "test_collinear_kgks_gga"
87     "test_libxc_gga_deriv4"
88   ];
90   pytestFlagsArray = [
91     "--ignore=pyscf/pbc/tdscf"
92     "--ignore=pyscf/pbc/gw"
93     "--ignore-glob=*_slow.*py"
94     "--ignore-glob=*_kproxy_.*py"
95     "--ignore-glob=test_proxy.py"
96   ];
98   meta = with lib; {
99     description = "Python-based simulations of chemistry framework";
100     homepage = "https://github.com/pyscf/pyscf";
101     license = licenses.asl20;
102     platforms = [ "x86_64-linux" "x86_64-darwin" ];
103     maintainers = [ maintainers.sheepforce ];
104   };