1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6
7 # popular downstream dependencies
8, aiohttp
9, requests
10}:
11
12buildPythonPackage rec {
13 pname = "charset-normalizer";
14 version = "3.0.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "Ousret";
21 repo = "charset_normalizer";
22 rev = "refs/tags/${version}";
23 hash = "sha256-2kXs6ZdemA6taV4aa9xBKLmhbSgpybjg3Z61EUFabrk=";
24 };
25
26 nativeCheckInputs = [
27 pytestCheckHook
28 ];
29
30 postPatch = ''
31 substituteInPlace setup.cfg \
32 --replace " --cov=charset_normalizer --cov-report=term-missing" ""
33 '';
34
35 pythonImportsCheck = [
36 "charset_normalizer"
37 ];
38
39 passthru.tests = { inherit aiohttp requests; };
40
41 meta = with lib; {
42 description = "Python module for encoding and language detection";
43 homepage = "https://charset-normalizer.readthedocs.io/";
44 license = licenses.mit;
45 maintainers = with maintainers; [ fab ];
46 };
47}