ocamlPackages.hxd: 0.3.2 -> 0.3.3 (#364231)
[NixPkgs.git] / pkgs / development / python-modules / cwcwidth / default.nix
blob75b8b091c39b4732b685b9db4fc5b40b7e590fc8
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   cython,
6   pytestCheckHook,
7   setuptools,
8 }:
10 buildPythonPackage rec {
11   pname = "cwcwidth";
12   version = "0.1.9";
13   format = "pyproject";
15   src = fetchPypi {
16     inherit pname version;
17     hash = "sha256-8Z0RoBSNSoys0GTJbpO8qM40FaGGroIEA49F4Qjbdrg=";
18   };
20   nativeBuildInputs = [
21     cython
22     setuptools
23   ];
25   nativeCheckInputs = [ pytestCheckHook ];
26   preCheck = ''
27     # Hack needed to make pytest + cython work
28     # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
29     export HOME=$(mktemp -d)
30     cp -r $TMP/$sourceRoot/tests $HOME
31     pushd $HOME
33     # locale settings used by upstream, has the effect of skipping
34     # otherwise-failing tests on darwin
35     export LC_ALL='C.UTF-8'
36     export LANG='C.UTF-8'
37   '';
38   postCheck = "popd";
40   pythonImportsCheck = [ "cwcwidth" ];
42   meta = with lib; {
43     description = "Python bindings for wc(s)width";
44     homepage = "https://github.com/sebastinas/cwcwidth";
45     changelog = "https://github.com/sebastinas/cwcwidth/blob/main/CHANGELOG.md";
46     license = licenses.mit;
47     maintainers = [ ];
48   };