2021-05-20 23:08:51 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, cython, pytestCheckHook }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cwcwidth";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.1.6";
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "1b31da599c9f0cf41f39ed10c1ceaa01d6024e31c6cd9aea2885b1f2a6d15fba";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
preCheck = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
# Hack needed to make pytest + cython work
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
|
2021-05-20 23:08:51 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
cp -r $TMP/$sourceRoot/tests $HOME
|
|
|
|
pushd $HOME
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
# locale settings used by upstream, has the effect of skipping
|
|
|
|
# otherwise-failing tests on darwin
|
|
|
|
export LC_ALL='C.UTF-8'
|
|
|
|
export LANG='C.UTF-8'
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
postCheck = "popd";
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cwcwidth" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for wc(s)width";
|
|
|
|
homepage = "https://github.com/sebastinas/cwcwidth";
|
|
|
|
changelog = "https://github.com/sebastinas/cwcwidth/blob/main/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|