summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/crochet/default.nix
blob: 12c85322c75aa53b36fff27096e75dccc025513c (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
48
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  twisted,
  wrapt,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "crochet";
  version = "2.1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "itamarst";
    repo = "crochet";
    tag = version;
    hash = "sha256-grymhvCC9zDBKhNnQC0o07hdLPV5KMWb6HSz/ntSbq8=";
  };

  # fix for python>=3.12
  postPatch = ''
    substituteInPlace versioneer.py \
      --replace-fail "SafeConfigParser()" "ConfigParser()" \
      --replace-fail "parser.readfp" "parser.read_file"
  '';

  build-system = [ setuptools ];

  dependencies = [
    twisted
    wrapt
  ];

  pythonImportsCheck = [ "crochet" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    description = "Library that makes it easier to use Twisted from regular blocking code";
    homepage = "https://github.com/itamarst/crochet";
    changelog = "https://github.com/itamarst/crochet/blob/${src.tag}/docs/news.rst";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ erictapen ];
  };
}