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

65 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
pythonOlder,
fetchPypi,
cachelib,
flask,
asgiref,
pytest-asyncio,
pytest-xprocess,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "flask-caching";
version = "2.3.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "flask_caching";
inherit version;
hash = "sha256-1+TKZKM7Sf6zOfzdF+a6JfXgEWjPiF5TeQ6IX4Ok0s8=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "cachelib >= 0.9.0, < 0.10.0" "cachelib"
'';
propagatedBuildInputs = [
cachelib
flask
];
nativeCheckInputs = [
asgiref
pytest-asyncio
pytest-xprocess
pytestCheckHook
];
disabledTests =
[
# backend_cache relies on pytest-cache, which is a stale package from 2013
"backend_cache"
# optional backends
"Redis"
"Memcache"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# ignore flaky test
"test_cache_timeout_dynamic"
"test_cached_view_class"
];
meta = with lib; {
description = "Caching extension for Flask";
homepage = "https://github.com/pallets-eco/flask-caching";
changelog = "https://github.com/pallets-eco/flask-caching/blob/v${version}/CHANGES.rst";
maintainers = [ ];
license = licenses.bsd3;
};
}