summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/strip-ansi/default.nix
blob: 07c9c547cf5d8c00ecf63ec1cf2fe2aa5f202042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  fetchpatch,
  buildPythonPackage,
  fetchPypi,
  poetry-core,
  nix-update-script,
}:

buildPythonPackage rec {
  pname = "strip-ansi";
  version = "0.1.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-XWDyOcyKN/3VK0PD5m6JPUW6BCMRXbWeyg0u74Owdyk=";
  };

  patches = [
    # Replace `poetry` with `poetry-core`. Unreleased.
    # See: https://github.com/NixOS/nixpkgs/issues/103325
    (fetchpatch {
      url = "https://github.com/gwennlbh/python-strip-ansi/commit/0ea9b418d5b21bd3d3b1b3b91fad7e66f25acb97.diff";
      hash = "sha256-Pzlc7fx4kEmM8pezu+8K7z5oV44uq/rzeByqKxHVKx0=";
    })
  ];

  build-system = [
    poetry-core
  ];

  pythonImportsCheck = [
    "strip_ansi"
  ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Strip ANSI escape sequences from a string";
    homepage = "https://pypi.org/project/strip-ansi";
    # License is in the repository but not in PyPI metadata.
    # See: https://github.com/gwennlbh/python-strip-ansi/blob/master/LICENSE
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers._9999years ];
  };
}