Skip to content

Commit

Permalink
Stop testing EOL Python 2.6 and 3.3 (#62)
Browse files Browse the repository at this point in the history
Python 2.6 and 3.3 are EOL. They are no longer receiving bug fixes,
including for security issues. Python 2.6 went EOL on 2013-10-29 and
Python 3.3 went EOL on 2017-09-29. For details, see:

https://devguide.python.org/#status-of-python-branches

For additional discussion on why project maintainers may wish to drop
Python 2.6 support, please see:

https://snarky.ca/stop-using-python-2-6/
http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html

Reduces testing resources.
  • Loading branch information
jdufresne authored and kjd committed Jun 11, 2018
1 parent 5d76cb6 commit 2618ad1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
Expand All @@ -12,4 +10,3 @@ install:
- pip install .
script:
- python setup.py test

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -36,17 +36,17 @@ 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',
'Topic :: Internet :: Name Service (DNS)',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
'python_requires': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
'test_suite': 'tests',
}

Expand Down
14 changes: 4 additions & 10 deletions tests/test_idna.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#!/usr/bin/env python

import unittest
import sys

import idna


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'],
Expand Down Expand Up @@ -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)
Expand All @@ -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')

Expand Down

0 comments on commit 2618ad1

Please sign in to comment.