diff --git a/.travis.yml b/.travis.yml index 1452c87..e391733 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: python python: - - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" @@ -12,4 +10,3 @@ install: - pip install . script: - python setup.py test - diff --git a/README.rst b/README.rst index 3a9b2b5..b115e83 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,7 @@ Alternatively, you can install the package using the bundled setup script: $ python setup.py install -This library works with Python 2.6 or later, and Python 3.3 or later. +This library works with Python 2.7 and Python 3.4 or later. Usage @@ -195,7 +195,7 @@ in computing the table data. For example, ``idna-data --version 9.0.0 make-libda will generate library data against Unicode 9.0.0. Note that this script requires Python 3, but all generated library data will work -in Python 2.6+. +in Python 2.7. Testing diff --git a/setup.py b/setup.py index 2442f74..a13be51 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,8 @@ def main(): python_version = sys.version_info[:2] - if python_version < (2,6): - raise SystemExit("Sorry, Python 2.6 or newer required") + if python_version < (2,7): + raise SystemExit("Sorry, Python 2.7 or newer required") package_data = {} exec(open('idna/package_data.py').read(), package_data) @@ -36,10 +36,9 @@ def main(): 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -47,6 +46,7 @@ def main(): 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Utilities', ], + 'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', 'test_suite': 'tests', } diff --git a/tests/test_idna.py b/tests/test_idna.py index 389ee30..b6f0394 100755 --- a/tests/test_idna.py +++ b/tests/test_idna.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import unittest -import sys import idna @@ -9,9 +8,6 @@ class IDNATests(unittest.TestCase): def setUp(self): - - self.python_version = sys.version_info[:2] - self.tld_strings = [ [u'\u6d4b\u8bd5', b'xn--0zwm56d'], [u'\u092a\u0930\u0940\u0915\u094d\u0937\u093e', b'xn--11b5bs3a9aj6g'], @@ -243,9 +239,8 @@ def test_encode(self): self.assertEqual(idna.encode('abc.abc'), b'abc.abc') self.assertEqual(idna.encode('xn--zckzah.abc'), b'xn--zckzah.abc') self.assertEqual(idna.encode(u'\u30c6\u30b9\u30c8.abc'), b'xn--zckzah.abc') - if self.python_version != (2, 6): - self.assertEqual(idna.encode(u'\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa'), - b'xn---------90gglbagaar.aa') + self.assertEqual(idna.encode(u'\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa'), + b'xn---------90gglbagaar.aa') self.assertRaises(idna.IDNAError, idna.encode, u'\u0521\u0524\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa', uts46=False) self.assertEqual(idna.encode('a'*63), b'a'*63) @@ -258,9 +253,8 @@ def test_decode(self): self.assertEqual(idna.decode(u'\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8'), u'\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8') self.assertEqual(idna.decode('abc.abc'), u'abc.abc') - if self.python_version != (2, 6): - self.assertEqual(idna.decode('xn---------90gglbagaar.aa'), - u'\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa') + self.assertEqual(idna.decode('xn---------90gglbagaar.aa'), + u'\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa') self.assertRaises(idna.IDNAError, idna.decode, 'XN---------90GGLBAGAAC.AA') self.assertRaises(idna.IDNAError, idna.decode, 'xn---------90gglbagaac.aa')