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