Unverified Commit f39f8ea6 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

python3Packages.unicode-slugify: drop (#448893)

parents fcac063f 58614f09
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchpatch,
  pytestCheckHook,
  six,
  unidecode,
}:

buildPythonPackage rec {
  pname = "unicode-slugify";
  version = "0.1.5";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    sha256 = "25f424258317e4cb41093e2953374b3af1f23097297664731cdb3ae46f6bd6c3";
  };

  patches = [
    ./use_pytest_instead_of_nose.patch
    # mozilla/unicode-slugify#41: Fix Python 3.12 SyntaxWarning
    (fetchpatch {
      url = "https://github.com/mozilla/unicode-slugify/commit/a18826f440d0b74e536f5e32ebdcf30e720f20d8.patch";
      hash = "sha256-B27psp0XI5GhoR0l5lFpUOh88hHzjJYzJS5PnIkfFws=";
    })
  ];

  propagatedBuildInputs = [
    six
    unidecode
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  enabledTestPaths = [ "slugify/tests.py" ];

  meta = with lib; {
    description = "Generates unicode slugs";
    homepage = "https://pypi.org/project/unicode-slugify/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ mmai ];
  };
}
+0 −69
Original line number Diff line number Diff line
diff --git a/slugify/tests.py b/slugify/tests.py
index 9f636c4..5562e87 100644
--- a/slugify/tests.py
+++ b/slugify/tests.py
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
 
 import six
 import unittest
-from nose.tools import eq_, raises
+import pytest
 
 from slugify import slugify, smart_text, SLUG_OK
 
@@ -13,31 +13,31 @@ def test_slugify():
     x = '-'.join([u, u])
     y = ' - '.join([u, u])
 
-    @raises(ValueError)
     def test_incoherent_ok_and_only_ascii_raises_an_error():
         """Checks that only_ascii=True with non ascii "ok" chars actually raises an error."""
-        slugify('angry smiley !', ok='è_é', only_ascii=True)
+        with pytest.raises(ValueError):
+            slugify('angry smiley !', ok='è_é', only_ascii=True)
 
     def check(x, y):
-        eq_(slugify(x), y)
+        assert slugify(x) == y
 
     def check_only_ascii(x, y):
-        eq_(slugify(x, only_ascii=True), y)
+        assert slugify(x, only_ascii=True) == y
 
     def check_only_ascii_capital(x, y):
-        eq_(slugify(x, lower=False, only_ascii=True), y)
+        assert slugify(x, lower=False, only_ascii=True) == y
 
     def check_only_ascii_lower_nospaces(x, y):
-        eq_(slugify(x, lower=True, spaces=False, only_ascii=True), y)
+        assert slugify(x, lower=True, spaces=False, only_ascii=True) == y
 
     def check_ok_chars(x, y):
-        eq_(slugify(x, ok='-♰é_è'), y)
+        assert slugify(x, ok='-♰é_è') == y
 
     def check_empty_ok_chars(x, y):
-        eq_(slugify(x, ok=''), y)
+        assert slugify(x, ok='') == y
 
     def check_limited_ok_chars_only_ascii(x, y):
-        eq_(slugify(x, ok='-', only_ascii=True), y)
+        assert slugify(x, ok='-', only_ascii=True) == y
 
     s = [('xx x  - "#$@ x', 'xx-x-x'),
          ('Bän...g (bang)', 'bäng-bang'),
@@ -112,11 +112,11 @@ def test_slugify():
 
     #Test custom space replacement
     x, y = ('-☀- pretty waves under the sunset 😎', '--~pretty~waves~under~the~sunset')
-    eq_(slugify(x, space_replacement='~'), y)
+    assert slugify(x, space_replacement='~') == y
 
     #Test default auto space replacement
     x, y = ('-☀- pretty waves under the sunset 😎', 'pretty~waves~under~the~sunset')
-    eq_(slugify(x, ok='~'), y)
+    assert slugify(x, ok='~') == y
 
 
 class SmartTextTestCase(unittest.TestCase):
+1 −0
Original line number Diff line number Diff line
@@ -856,6 +856,7 @@ mapAliases {
  ufoLib2 = ufolib2; # added 2024-01-07
  ukrainealarm = throw "ukrainealarm has been removed, as it has been replaced as a home-assistant dependency by uasiren."; # added 2024-01-05
  unblob-native = throw "unblob-native has been removed because its functionality is merged into unblob 25.4.14."; # Added 2025-05-02
  unicode-slugify = throw "'unicode-slugify' has been removed becaues it was broken and unmaintained. Consider using 'python-slugify' instead."; # added 2025-10-05
  unifi = throw "'unifi' has been removed as upstream was archived in 2017"; # Added 2025-08-25
  unittest2 = throw "unittest2 has been removed as it's a backport of unittest that's unmaintained and not needed beyond Python 3.4."; # added 2022-12-01
  update_checker = update-checker; # added 2024-01-07
+0 −2
Original line number Diff line number Diff line
@@ -19527,8 +19527,6 @@ self: super: with self; {
  unicode-rbnf = callPackage ../development/python-modules/unicode-rbnf { };
  unicode-slugify = callPackage ../development/python-modules/unicode-slugify { };
  unicodecsv = callPackage ../development/python-modules/unicodecsv { };
  unicodedata2 = callPackage ../development/python-modules/unicodedata2 { };