1{ lib
2, aiohttp
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, pythonOlder
7, requests
8}:
9
10buildPythonPackage rec {
11 pname = "charset-normalizer";
12 version = "3.2.0";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "Ousret";
19 repo = "charset_normalizer";
20 rev = "refs/tags/${version}";
21 hash = "sha256-CfL5rlrwJs9453z+1xPUzs1B3OyjFBaU6klzY7gJCzA=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.cfg \
26 --replace " --cov=charset_normalizer --cov-report=term-missing" ""
27 '';
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 ];
32
33 pythonImportsCheck = [
34 "charset_normalizer"
35 ];
36
37 passthru.tests = { inherit aiohttp requests; };
38
39 meta = with lib; {
40 description = "Python module for encoding and language detection";
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}