2022-09-16 10:42:22 +02:00
|
|
|
{
|
|
|
|
lib,
|
2025-04-25 17:05:45 +02:00
|
|
|
stdenv,
|
2022-09-16 10:42:22 +02:00
|
|
|
buildPythonPackage,
|
2025-04-25 17:05:45 +02:00
|
|
|
fetchFromGitHub,
|
2022-09-16 10:42:22 +02:00
|
|
|
cython,
|
|
|
|
setuptools,
|
2025-04-25 17:05:45 +02:00
|
|
|
pytestCheckHook,
|
2022-09-16 10:42:22 +02:00
|
|
|
}:
|
2021-04-27 19:52:23 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cwcwidth";
|
2025-02-10 20:51:52 +00:00
|
|
|
version = "0.1.10";
|
2025-04-25 17:05:45 +02:00
|
|
|
pyproject = true;
|
2021-04-27 19:52:23 +02:00
|
|
|
|
2025-04-25 17:05:45 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sebastinas";
|
|
|
|
repo = "cwcwidth";
|
|
|
|
tag = "v${version}";
|
|
|
|
hash = "sha256-JrzItV+nCpQCz9MM1pcq5FtGZOsWNbgAra6i5WT4Mcg=";
|
2021-04-27 19:52:23 +02:00
|
|
|
};
|
|
|
|
|
2025-04-25 17:05:45 +02:00
|
|
|
build-system = [
|
2022-09-16 10:42:22 +02:00
|
|
|
cython
|
|
|
|
setuptools
|
|
|
|
];
|
2021-04-27 19:52:23 +02:00
|
|
|
|
2025-04-25 17:05:45 +02:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-04-27 19:52:23 +02:00
|
|
|
preCheck = ''
|
2025-04-25 17:05:45 +02:00
|
|
|
# prevent import shadow
|
|
|
|
rm -rf cwcwidth
|
|
|
|
|
|
|
|
# locale settings used by upstream, has the effect of skipping otherwise-failing tests on darwin
|
2021-11-22 23:24:50 +00:00
|
|
|
export LC_ALL='C.UTF-8'
|
|
|
|
export LANG='C.UTF-8'
|
2021-04-27 19:52:23 +02:00
|
|
|
'';
|
2025-04-25 17:05:45 +02:00
|
|
|
|
|
|
|
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
# Despite setting the locales above, this test fails with:
|
|
|
|
# AssertionError: Tuples differ: (1, 1, 1, 1) != (1, 1, 1, 0)
|
|
|
|
"test_combining_spacing"
|
|
|
|
];
|
2021-04-27 19:52:23 +02:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "cwcwidth" ];
|
|
|
|
|
2025-04-25 17:05:45 +02:00
|
|
|
meta = {
|
2021-04-27 19:52:23 +02:00
|
|
|
description = "Python bindings for wc(s)width";
|
|
|
|
homepage = "https://github.com/sebastinas/cwcwidth";
|
2025-04-25 17:05:45 +02:00
|
|
|
changelog = "https://github.com/sebastinas/cwcwidth/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = lib.licenses.mit;
|
2024-07-28 16:44:11 +02:00
|
|
|
maintainers = [ ];
|
2021-04-27 19:52:23 +02:00
|
|
|
};
|
|
|
|
}
|