Files
nixpkgs/pkgs/development/python-modules/pycookiecheat/default.nix
T
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

78 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
cryptography,
fetchFromGitHub,
keyring,
pytestCheckHook,
pythonOlder,
playwright,
setuptools,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "pycookiecheat";
version = "0.7.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "n8henrie";
repo = "pycookiecheat";
rev = "refs/tags/v${version}";
hash = "sha256-x568e4M7fz93hq0y06Grz9GlrjGV38GxWd+PhNiAyBY=";
};
pythonRelaxDeps = [
"cryptography"
"keyring"
];
build-system = [
setuptools
setuptools-scm
];
dependencies = [
cryptography
keyring
];
nativeCheckInputs = [
playwright
pytestCheckHook
];
pythonImportsCheck = [ "pycookiecheat" ];
preCheck = ''
export HOME=$(mktemp -d)
'';
disabledTests = [
# Tests want to use playwright executable
"test_fake_cookie"
"test_firefox_cookies"
"test_firefox_get_default_profile"
"test_firefox_no_cookies"
"test_load_firefox_cookie_db"
"test_no_cookies"
"test_warns_for_string_browser"
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_slack_config" ];
meta = with lib; {
description = "Borrow cookies from your browser's authenticated session for use in Python scripts";
homepage = "https://github.com/n8henrie/pycookiecheat";
changelog = "https://github.com/n8henrie/pycookiecheat/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [
fab
n8henrie
];
};
}