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

69 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
ncurses,
poetry-core,
procps,
pytest-rerunfailures,
pytestCheckHook,
tmux,
}:
buildPythonPackage rec {
pname = "libtmux";
version = "0.37.0";
pyproject = true;
src = fetchFromGitHub {
owner = "tmux-python";
repo = "libtmux";
rev = "refs/tags/v${version}";
hash = "sha256-I0E6zkfQ6mx2svCaXEgKPhrrog3iLgXZ4E3CMMxPkIA=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"--doctest-docutils-modules",' ""
'';
build-system = [ poetry-core ];
nativeCheckInputs = [
procps
tmux
ncurses
pytest-rerunfailures
pytestCheckHook
];
pytestFlagsArray = [ "tests" ];
disabledTests =
[
# Fail with: 'no server running on /tmp/tmux-1000/libtmux_test8sorutj1'.
"test_new_session_width_height"
# Assertion error
"test_capture_pane_start"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# tests/test_pane.py:113: AssertionError
"test_capture_pane_start"
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
"tests/test_test.py"
];
pythonImportsCheck = [ "libtmux" ];
meta = with lib; {
description = "Typed scripting library / ORM / API wrapper for tmux";
homepage = "https://libtmux.git-pull.com/";
changelog = "https://github.com/tmux-python/libtmux/raw/v${version}/CHANGES";
license = licenses.mit;
maintainers = with maintainers; [ otavio ];
};
}