nixpkgs/pkgs/development/python-modules/ase/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

77 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchPypi,
buildPythonPackage,
isPy27,
pythonAtLeast,
setuptools,
numpy,
scipy,
matplotlib,
flask,
pillow,
psycopg2,
tkinter,
pytestCheckHook,
pytest-mock,
pytest-xdist,
}:
buildPythonPackage rec {
pname = "ase";
version = "3.23.0";
pyproject = true;
disabled = isPy27;
src = fetchPypi {
inherit pname version;
hash = "sha256-kaKqMdib2QsO/f5KfoQmTzKCiyq/yfOOZeBBrXb+yK4=";
};
build-system = [ setuptools ];
dependencies = [
numpy
scipy
matplotlib
flask
pillow
psycopg2
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
tkinter
];
nativeCheckInputs = [
pytestCheckHook
pytest-mock
pytest-xdist
];
disabledTests = [
"test_fundamental_params"
"test_ase_bandstructure"
"test_imports"
"test_units"
"test_favicon"
"test_vibrations_methods" # missing attribute
"test_jmol_roundtrip" # missing attribute
"test_pw_input_write_nested_flat" # Did not raise DeprecationWarning
"test_fix_scaled" # Did not raise UserWarning
] ++ lib.optionals (pythonAtLeast "3.12") [ "test_info_calculators" ];
preCheck = ''
export PATH="$out/bin:$PATH"
'';
pythonImportsCheck = [ "ase" ];
meta = with lib; {
description = "Atomic Simulation Environment";
homepage = "https://wiki.fysik.dtu.dk/ase/";
license = licenses.lgpl21Plus;
maintainers = [ ];
};
}