1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 buildPythonPackage,
6 pythonAtLeast,
7
8 # build-system
9 setuptools,
10
11 # dependencies
12 flask,
13 matplotlib,
14 numpy,
15 pillow,
16 psycopg2,
17 scipy,
18 tkinter,
19
20 # tests
21 addBinToPathHook,
22 pytestCheckHook,
23 pytest-mock,
24 pytest-xdist,
25 writableTmpDirAsHomeHook,
26}:
27
28buildPythonPackage rec {
29 pname = "ase";
30 version = "3.26.0";
31 pyproject = true;
32
33 src = fetchFromGitLab {
34 owner = "ase";
35 repo = "ase";
36 tag = version;
37 hash = "sha256-1738NQPgOqSr2PZu1T2b9bL0V+ZzGk2jcWBhLF21VQs=";
38 };
39
40 build-system = [ setuptools ];
41
42 dependencies = [
43 flask
44 matplotlib
45 numpy
46 pillow
47 psycopg2
48 scipy
49 ]
50 ++ lib.optionals stdenv.hostPlatform.isDarwin [
51 tkinter
52 ];
53
54 nativeCheckInputs = [
55 addBinToPathHook
56 pytestCheckHook
57 pytest-mock
58 pytest-xdist
59 writableTmpDirAsHomeHook
60 ];
61
62 disabledTests = [
63 "test_fundamental_params"
64 "test_ase_bandstructure"
65 "test_imports"
66 "test_units"
67 "test_favicon"
68 "test_vibrations_methods" # missing attribute
69 "test_jmol_roundtrip" # missing attribute
70 "test_pw_input_write_nested_flat" # Did not raise DeprecationWarning
71 "test_fix_scaled" # Did not raise UserWarning
72 "test_ipi_protocol" # flaky
73 ]
74 ++ lib.optionals (pythonAtLeast "3.12") [ "test_info_calculators" ];
75
76 pythonImportsCheck = [ "ase" ];
77
78 meta = {
79 description = "Atomic Simulation Environment";
80 homepage = "https://ase-lib.org/";
81 changelog = "https://ase-lib.org/releasenotes.html";
82 license = lib.licenses.lgpl21Plus;
83 maintainers = [ ];
84 };
85}