Skip to content

Commit 54dee23

Browse files
committed
Drop support for Python 2.6
This is starting to cause other packages to fail and Python 2.6 has been deprecated for half a decade at this point.
1 parent c2aedef commit 54dee23

8 files changed

Lines changed: 9 additions & 29 deletions

File tree

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: python
22
python:
33
- "2.7"
4-
- "2.6"
54
- "3.3"
65
- "3.4"
76
- "3.5"
87
- "3.6"
98
- "3.6-dev"
9+
- "3.7-dev"
1010

1111
addons:
1212
apt:
@@ -15,11 +15,12 @@ addons:
1515

1616
matrix:
1717
allow_failures:
18-
python: "3.6-dev"
18+
python:
19+
- "3.6-dev"
20+
- "3.7-dev"
1921

2022
install:
2123
- pip install --upgrade pip
22-
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
2324
- pip install coveralls coverage
2425

2526
script: coverage run --include=bagit.py setup.py test

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ project as needed or you can install globally with:
1616

1717
pip install bagit
1818

19-
Python v2.6+ is required.
19+
Python v2.7+ is required.
2020

2121
Command Line Usage
2222
------------------

bagit.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ def find_locale_dir():
115115
# Payload-Oxum is autogenerated
116116
]
117117

118-
# The getattr call can be replaced with direct access when we're willing to
119-
# break compatibility with Python 2.6:
120-
CHECKSUM_ALGOS = getattr(hashlib, 'algorithms_guaranteed', set(('md5', 'sha1', 'sha256', 'sha384', 'sha512')))
118+
CHECKSUM_ALGOS = hashlib.algorithms_guaranteed
121119
DEFAULT_CHECKSUMS = ['sha256', 'sha512']
122120

123121
#: Block size used when reading files for hashing:
@@ -1394,9 +1392,6 @@ def main():
13941392
if args.processes < 0:
13951393
parser.error(_("The number of processes must be 0 or greater"))
13961394

1397-
if sys.version_info < (2, 7) and args.processes > 1:
1398-
parser.error(_('Multiple processes are not supported on Python 2.6'))
1399-
14001395
if args.fast and not args.validate:
14011396
parser.error(_('--fast is only allowed as an option for --validate!'))
14021397

locale/bagit-python.pot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,6 @@ msgstr ""
345345
msgid "The number of processes must be 0 or greater"
346346
msgstr ""
347347

348-
msgid "Multiple processes are not supported on Python 2.6"
349-
msgstr ""
350-
351348
msgid "--fast is only allowed as an option for --validate!"
352349
msgstr ""
353350

locale/en/LC_MESSAGES/bagit-python.po

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,6 @@ msgstr ""
352352
msgid "The number of processes must be 0 or greater"
353353
msgstr ""
354354

355-
msgid "Multiple processes are not supported on Python 2.6"
356-
msgstr ""
357-
358355
msgid "--fast is only allowed as an option for --validate!"
359356
msgstr ""
360357

setup.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import sys
1010
from setuptools import setup
1111

12-
if sys.version_info < (2, 6):
13-
print("Python 2.6 or higher is required")
12+
if sys.version_info < (2, 7):
13+
print("Python 2.7 or higher is required")
1414
sys.exit(1)
1515

1616
description = 'Create and validate BagIt packages'
@@ -20,9 +20,6 @@
2020

2121
tests_require = ['mock', 'coverage']
2222

23-
if sys.version_info < (2, 7):
24-
tests_require.append('unittest2')
25-
2623

2724
def get_message_catalogs():
2825
message_catalogs = []
@@ -65,7 +62,6 @@ def get_message_catalogs():
6562
'Topic :: Communications :: File Sharing',
6663
'Topic :: Software Development :: Libraries :: Python Modules',
6764
'Topic :: System :: Filesystems',
68-
'Programming Language :: Python :: 2.6',
6965
'Programming Language :: Python :: 2.7',
7066
'Programming Language :: Python :: 3.1',
7167
'Programming Language :: Python :: 3.2',

test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import bagit
2020
import mock
2121

22-
if sys.version_info < (2, 7):
23-
import unittest2 as unittest # NOQA
24-
2522
logging.basicConfig(filename='test.log', level=logging.DEBUG)
2623
stderr = logging.StreamHandler()
2724
stderr.setLevel(logging.WARNING)
@@ -633,7 +630,6 @@ def test_garbage_in_bagit_txt(self):
633630
bf.write(bagfile)
634631
self.assertRaises(bagit.BagValidationError, bagit.Bag, self.tmpdir)
635632

636-
@unittest.skipIf(sys.version_info < (2, 7), 'multiprocessing is unstable on Python 2.6')
637633
def test_make_bag_multiprocessing(self):
638634
bagit.make_bag(self.tmpdir, processes=2)
639635
self.assertTrue(os.path.isdir(j(self.tmpdir, 'data')))

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[tox]
2-
envlist = py26,py27,py33,py34,py35,py36
2+
envlist = py27,py33,py34,py35,py36
33

44
[testenv]
55
commands = python setup.py test
6-
deps =
7-
py26: unittest2

0 commit comments

Comments
 (0)