1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 twisted,
7 wrapt,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "crochet";
13 version = "2.1.1";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "itamarst";
18 repo = "crochet";
19 tag = version;
20 hash = "sha256-grymhvCC9zDBKhNnQC0o07hdLPV5KMWb6HSz/ntSbq8=";
21 };
22
23 # fix for python>=3.12
24 postPatch = ''
25 substituteInPlace versioneer.py \
26 --replace-fail "SafeConfigParser()" "ConfigParser()" \
27 --replace-fail "parser.readfp" "parser.read_file"
28 '';
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 twisted
34 wrapt
35 ];
36
37 pythonImportsCheck = [ "crochet" ];
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 meta = {
42 description = "Library that makes it easier to use Twisted from regular blocking code";
43 homepage = "https://github.com/itamarst/crochet";
44 changelog = "https://github.com/itamarst/crochet/blob/${src.tag}/docs/news.rst";
45 license = lib.licenses.mit;
46 maintainers = with lib.maintainers; [ erictapen ];
47 };
48}