summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cwcwidth/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/cwcwidth/default.nix')
-rw-r--r--pkgs/development/python-modules/cwcwidth/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cwcwidth/default.nix b/pkgs/development/python-modules/cwcwidth/default.nix
new file mode 100644
index 000000000000..a17a8a936aa0
--- /dev/null
+++ b/pkgs/development/python-modules/cwcwidth/default.nix
@@ -0,0 +1,34 @@
+{ lib, buildPythonPackage, fetchPypi, cython, pytestCheckHook }:
+
+buildPythonPackage rec {
+ pname = "cwcwidth";
+ version = "0.1.4";
+ format = "pyproject";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "1azrphpkcyggg38xvkfb9dpc4xmmm90p02kf8dkqd4d6j5w96aj8";
+ };
+
+ nativeBuildInputs = [ cython ];
+
+ checkInputs = [ pytestCheckHook ];
+ # Hack needed to make pytest + cython work
+ # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298
+ preCheck = ''
+ export HOME=$(mktemp -d)
+ cp -r $TMP/$sourceRoot/tests $HOME
+ pushd $HOME
+ '';
+ 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;
+ maintainers = with maintainers; [ eduardosm ];
+ };
+}