diff --git a/pkgs/development/python-modules/charset-normalizer/default.nix b/pkgs/development/python-modules/charset-normalizer/default.nix index 5bd8e9acf680..7321c180eb07 100644 --- a/pkgs/development/python-modules/charset-normalizer/default.nix +++ b/pkgs/development/python-modules/charset-normalizer/default.nix @@ -3,15 +3,18 @@ aiohttp, buildPythonPackage, fetchFromGitHub, + mypy, pytestCheckHook, pythonOlder, requests, + setuptools, + setuptools-scm, }: buildPythonPackage rec { pname = "charset-normalizer"; - version = "3.4.0"; - format = "setuptools"; + version = "3.4.1"; + pyproject = true; disabled = pythonOlder "3.5"; @@ -19,14 +22,22 @@ buildPythonPackage rec { owner = "Ousret"; repo = "charset_normalizer"; tag = version; - hash = "sha256-de6rg/e9RPfuO44+/Uipad75YqZQrnqiSPopfBNOFP8="; + hash = "sha256-z6XUXfNJ4+2Gq2O13MgF1D3j/bVBjgAG2wCWLaNgADE="; }; postPatch = '' - substituteInPlace setup.cfg \ - --replace " --cov=charset_normalizer --cov-report=term-missing" "" + substituteInPlace pyproject.toml \ + --replace-fail "mypy>=1.4.1,<=1.14.0" mypy ''; + build-system = [ + mypy + setuptools + setuptools-scm + ]; + + env.CHARSET_NORMALIZER_USE_MYPYC = "1"; + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "charset_normalizer" ]; @@ -39,7 +50,7 @@ buildPythonPackage rec { description = "Python module for encoding and language detection"; mainProgram = "normalizer"; homepage = "https://charset-normalizer.readthedocs.io/"; - changelog = "https://github.com/Ousret/charset_normalizer/blob/${version}/CHANGELOG.md"; + changelog = "https://github.com/Ousret/charset_normalizer/blob/${src.tag}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ fab ]; };