jenkins-bot merged this change.

View Change

Approvals: Framawiki: Looks good to me, but someone else must approve Dalba: Looks good to me, approved jenkins-bot: Verified
[cleanup] remove unicodedata2 dependency

Python issue 10254 has been solved after dropping pyhon 2.6
and 2.6.6 was the only supported plattfrom with the NFC bug.

Bug: T102461
Bug: T108068
Change-Id: Id6e6b99b295a67ba85f17f4037be2819f31d9ea0
---
M pywikibot/bot.py
M pywikibot/page.py
M requirements.txt
M setup.py
M tests/python_tests.py
5 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 6d95901..3007f70 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -336,7 +336,6 @@
check_package_list = [
'requests',
'mwparserfromhell',
- 'unicodedata', 'unicodedata2', # T102461
]

# report all imported packages
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 20c78de..ae83c31 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -23,11 +23,7 @@
import os.path
import re
import sys
-
-try:
- import unicodedata2 as unicodedata
-except ImportError:
- import unicodedata
+import unicodedata

from collections import Counter, defaultdict, namedtuple, OrderedDict
from warnings import warn
diff --git a/requirements.txt b/requirements.txt
index bcbb4b8..e44dee9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -33,8 +33,6 @@

ipaddr>=2.1.10 ; python_version < '3'

-unicodedata2>=7.0.0-2 ; python_version < '3'
-
# OAuth support
# mwoauth 0.2.4 is needed because it supports getting identity information
# about the user
diff --git a/setup.py b/setup.py
index 9a27c84..4889c42 100644
--- a/setup.py
+++ b/setup.py
@@ -67,7 +67,6 @@
extra_deps.update({
'csv': ['unicodecsv'],
'MySQL': ['oursql'],
- 'unicode7': ['unicodedata2>=7.0.0-2'],
})

script_deps = {
diff --git a/tests/python_tests.py b/tests/python_tests.py
index 6dcbd9f..1ed6366 100755
--- a/tests/python_tests.py
+++ b/tests/python_tests.py
@@ -8,10 +8,6 @@
from __future__ import absolute_import, unicode_literals

import unicodedata
-try:
- import unicodedata2
-except ImportError:
- unicodedata2 = None

from tests.aspects import TestCase, unittest

@@ -45,12 +41,6 @@
# See T102461 and http://bugs.python.org/issue10254
text = 'Li̍t-sṳ́'
self.assertEqual(text, unicodedata.normalize('NFC', text))
-
- @unittest.skipIf(not unicodedata2, 'unicodedata2 not found')
- def test_issue_10254_unicodedata2(self):
- """Test Python issue #10254 is avoided with unicodedata2 package."""
- text = 'Li̍t-sṳ́'
- self.assertEqual(text, unicodedata2.normalize('NFC', text))


if __name__ == '__main__': # pragma: no cover

To view, visit change 432763. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id6e6b99b295a67ba85f17f4037be2819f31d9ea0
Gerrit-Change-Number: 432763
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>