about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix b/nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix
new file mode 100644
index 000000000000..945c941dec4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/awesome-slugify/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, buildPythonPackage, fetchPypi, unidecode, regex, python }:
+
+buildPythonPackage rec {
+  pname = "awesome-slugify";
+  version = "1.6.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0wgxrhr8s5vk2xmcz9s1z1aml4ppawmhkbggl9rp94c747xc7pmv";
+  };
+
+  prePatch = ''
+    substituteInPlace setup.py \
+        --replace 'Unidecode>=0.04.14,<0.05' 'Unidecode>=0.04.14'
+  '';
+
+  patches = [
+    ./slugify_filename_test.patch # fixes broken test by new unidecode
+  ];
+
+  propagatedBuildInputs = [ unidecode regex ];
+
+  checkPhase = ''
+      ${python.interpreter} -m unittest discover
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/dimka665/awesome-slugify";
+    description = "Python flexible slugify function";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}