nixpkgs/pkgs/development/python-modules/fs/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

85 lines
1.8 KiB
Nix

{
lib,
glibcLocales,
buildPythonPackage,
fetchPypi,
setuptools,
six,
appdirs,
scandir ? null,
backports_os ? null,
typing ? null,
pytz,
enum34,
pyftpdlib,
psutil,
mock,
pythonAtLeast,
isPy3k,
pytestCheckHook,
stdenv,
}:
buildPythonPackage rec {
pname = "fs";
version = "2.4.16";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-rpfH1RIT9LcLapWCklMCiQkN46fhWEHhCPvhRPBp0xM=";
};
buildInputs = [ glibcLocales ];
# strong cycle with parameterized
doCheck = false;
nativeCheckInputs = [
pyftpdlib
mock
psutil
pytestCheckHook
];
propagatedBuildInputs =
[
six
appdirs
pytz
setuptools
]
++ lib.optionals (!isPy3k) [ backports_os ]
++ lib.optionals (!pythonAtLeast "3.6") [ typing ]
++ lib.optionals (!pythonAtLeast "3.5") [ scandir ]
++ lib.optionals (!pythonAtLeast "3.5") [ enum34 ];
LC_ALL = "en_US.utf-8";
preCheck = ''
HOME=$(mktemp -d)
'';
pytestFlagsArray = [ "--ignore=tests/test_opener.py" ];
disabledTests =
[ "user_data_repr" ]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
# remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved
"test_ftpfs"
]
++ lib.optionals (pythonAtLeast "3.9") [
# update friend version of this commit: https://github.com/PyFilesystem/pyfilesystem2/commit/3e02968ce7da7099dd19167815c5628293e00040
# merged into master, able to be removed after >2.4.1
"test_copy_sendfile"
];
__darwinAllowLocalNetworking = true;
meta = with lib; {
description = "Filesystem abstraction";
homepage = "https://github.com/PyFilesystem/pyfilesystem2";
license = licenses.bsd3;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
};
}