summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorSamuel Leathers <sam@appliedtrust.com>2017-09-15 15:04:19 -0400
committerFranz Pletz <fpletz@fnordicwalking.de>2017-09-18 23:21:24 +0200
commit7fa2c54a60902ee924a3b540cad0d5ed4894c418 (patch)
tree18074fbe55fa1be55841d3cdf9b3f9ec65b898d7 /pkgs/development/python-modules
parent384b64426e8eb89d865276bdc7e2d1a31d81f2a0 (diff)
downloadnixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar.gz
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar.bz2
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar.lz
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar.xz
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.tar.zst
nixlib-7fa2c54a60902ee924a3b540cad0d5ed4894c418.zip
awesome-slugify: fixes tests
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/awesome-slugify/default.nix30
-rw-r--r--pkgs/development/python-modules/awesome-slugify/slugify_filename_test.patch13
2 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/awesome-slugify/default.nix b/pkgs/development/python-modules/awesome-slugify/default.nix
new file mode 100644
index 000000000000..105c70c28b34
--- /dev/null
+++ b/pkgs/development/python-modules/awesome-slugify/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, buildPythonPackage, fetchPypi, unidecode, regex, python }:
+
+buildPythonPackage rec {
+  pname = "awesome-slugify";
+  version = "1.6.5";
+  name  = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0wgxrhr8s5vk2xmcz9s1z1aml4ppawmhkbggl9rp94c747xc7pmv";
+  };
+
+  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 ];
+  };
+}
diff --git a/pkgs/development/python-modules/awesome-slugify/slugify_filename_test.patch b/pkgs/development/python-modules/awesome-slugify/slugify_filename_test.patch
new file mode 100644
index 000000000000..3283d76eae05
--- /dev/null
+++ b/pkgs/development/python-modules/awesome-slugify/slugify_filename_test.patch
@@ -0,0 +1,13 @@
+diff --git i/slugify/tests.py w/slugify/tests.py
+index 4c9fa1c..3e14328 100644
+--- i/slugify/tests.py
++++ w/slugify/tests.py
+@@ -57,7 +57,7 @@ class PredefinedSlugifyTestCase(unittest.TestCase):
+         self.assertEqual(slugify_url('The Über article'), 'uber-article')
+ 
+     def test_slugify_filename(self):
+-        self.assertEqual(slugify_filename(u'Дrаft №2.txt'), u'Draft_2.txt')
++        self.assertEqual(slugify_filename(u'Дrаft №2.txt'), u'Draft_No._2.txt')
+ 
+ 
+ class ToLowerTestCase(unittest.TestCase):