nixpkgs/pkgs/development/python-modules/cwcwidth/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildPythonPackage, fetchPypi, cython, pytestCheckHook, setuptools }:
2021-04-27 17:52:23 +00:00
buildPythonPackage rec {
pname = "cwcwidth";
version = "0.1.9";
2021-04-27 17:52:23 +00:00
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-8Z0RoBSNSoys0GTJbpO8qM40FaGGroIEA49F4Qjbdrg=";
2021-04-27 17:52:23 +00:00
};
nativeBuildInputs = [ cython setuptools ];
2021-04-27 17:52:23 +00:00
nativeCheckInputs = [ pytestCheckHook ];
2021-04-27 17:52:23 +00:00
preCheck = ''
# Hack needed to make pytest + cython work
# https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
2021-04-27 17:52:23 +00:00
export HOME=$(mktemp -d)
cp -r $TMP/$sourceRoot/tests $HOME
pushd $HOME
# 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-04-27 17:52:23 +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-10-28 14:21:46 +00:00
maintainers = with maintainers; [ ];
2021-04-27 17:52:23 +00:00
};
}