Skip to content

Commit

Permalink
Drop support for Python 2.6, add Python 3.6 (#363)
Browse files Browse the repository at this point in the history
* Drop support for Python 2.6, add Python 3.6
* Added ci/requirements-3.6.txt
* Fix error with customized `_warning()` method that only appears with Python 3.6
  • Loading branch information
apdavison committed Sep 10, 2017
1 parent 6af7219 commit 3602ae0
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,9 +2,9 @@ language: python
sudo: required
python:
- "2.7"
- "2.6"
- "3.4"
- "3.5"
- "3.6"
env:
global:
- PATH=/home/travis/miniconda/bin:$PATH
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -49,8 +49,8 @@ Functionality:
Requirements
============

Sumatra requires Python versions 2.6, 2.7, 3.4 or 3.5. The web interface requires
Django (>= 1.6) and the django-tagging package.
Sumatra requires Python versions 2.7, 3.4, 3.5 or 3.6. The web interface requires
Django (>= 1.6 < 1.9) and the django-tagging package.
Sumatra requires that you keep your own code in a version control
system (currently Subversion, Mercurial, Git and Bazaar are supported). If you
are already using Bazaar there is nothing else to install. If you
Expand Down
10 changes: 0 additions & 10 deletions ci/requirements-2.6.txt

This file was deleted.

2 changes: 2 additions & 0 deletions ci/requirements-3.6.txt
@@ -0,0 +1,2 @@
# Additional requirements for Python 3.5
pyyaml # this is already in requirements.txt, but pip doesn't allow empty requirements files
8 changes: 3 additions & 5 deletions doc/developers_guide.txt
Expand Up @@ -9,14 +9,13 @@ Mac OS X, with the bash shell.
Requirements
------------

* Python_ 2.6, 2.7, 3.4 or 3.5
* Django_ >= 1.6
* Python_ 2.7, 3.4, 3.5 or 3.6
* Django_ >= 1.6 < 1.9
* django-tagging_ >= 0.3
* parameters >= 0.2.1
* nose_ >= 0.11.4
* future >= 0.14
* if using Python < 3.4, pathlib >= 1.0.0
* if using Python 2.6, ordereddict, unittest2_ >= 0.5.1
* docutils
* Jinja2

Expand Down Expand Up @@ -119,7 +118,7 @@ Coding standards and style
--------------------------

All code should conform as much as possible to `PEP 8`_, and should run with
Python 2.6, 2.7, 3.4 and 3.5. Lines should be no longer than 99 characters.
Python 2.7, 3.4, 3.5 and 3.6. Lines should be no longer than 99 characters.


Reviewing pull requests
Expand Down Expand Up @@ -150,7 +149,6 @@ Things to check for:
.. _Django: https://www.djangoproject.com/
.. _django-tagging: http://code.google.com/p/django-tagging/
.. _nose: https://nose.readthedocs.org/en/latest/
.. _unittest2: https://pypi.python.org/pypi/unittest2
.. _Distribute: https://pypi.python.org/pypi/distribute
.. _mpi4py: http://mpi4py.scipy.org/
.. _tox: http://codespeak.net/tox/
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -64,10 +64,10 @@ def get_tip_revision(self, path=os.getcwd()):
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering'],
cmdclass = {'sdist': sdist_git},
install_requires = install_requires,
Expand Down
4 changes: 3 additions & 1 deletion sumatra/commands.py
Expand Up @@ -49,7 +49,9 @@ def _warning(
message,
category = UserWarning,
filename = '',
lineno = -1):
lineno = -1,
file=None,
line=None):
print("Warning: ")
print(message)
warnings.showwarning = _warning
Expand Down
2 changes: 1 addition & 1 deletion sumatra/datastore/archivingfs.py
Expand Up @@ -15,7 +15,7 @@
import logging
import mimetypes
import datetime
from contextlib import closing # needed for Python 2.6
from contextlib import closing
from sumatra.core import TIMESTAMP_FORMAT, component


Expand Down
2 changes: 1 addition & 1 deletion sumatra/datastore/davfs.py
Expand Up @@ -10,7 +10,7 @@
import logging
from fs.contrib.davfs import DAVFS
from urllib.parse import urlparse
from contextlib import closing # needed for Python 2.6
from contextlib import closing

from sumatra.core import component
from .archivingfs import ArchivingFileSystemDataStore, ArchivedDataFile, TIMESTAMP_FORMAT
Expand Down
2 changes: 1 addition & 1 deletion sumatra/programs.py
Expand Up @@ -155,7 +155,7 @@ class PythonExecutable(Executable):
name = "Python"
executable_names = ('python', 'python2', 'python3', 'python2.5',
'python2.6', 'python2.7', 'python3.1', 'python3.2',
'python3.3', 'python3.4', 'python3.5')
'python3.3', 'python3.4', 'python3.5', 'python3.6')
file_extensions = ('.py',)
default_executable_name = "python"
requires_script = True
Expand Down
5 changes: 1 addition & 4 deletions test/system/test_postgres.py
Expand Up @@ -23,10 +23,7 @@
have_docker = False
except ImportError:
have_docker = False
try:
from unittest2 import SkipTest
except ImportError:
from unittest import SkipTest
from unittest import SkipTest
import utils
from utils import setup, teardown as default_teardown, run_test, build_command
try:
Expand Down
5 changes: 1 addition & 4 deletions test/system/test_webdav.py
Expand Up @@ -20,10 +20,7 @@
have_docker = True
except ImportError:
have_docker = False
try:
from unittest2 import SkipTest
except ImportError:
from unittest import SkipTest
from unittest import SkipTest
import utils
from utils import setup, teardown as default_teardown, run_test, build_command

Expand Down
5 changes: 1 addition & 4 deletions test/system/test_webui.py
Expand Up @@ -9,10 +9,7 @@
import os
from time import sleep
from builtins import input
try:
from unittest2 import SkipTest
except ImportError:
from unittest import SkipTest
from unittest import SkipTest
try:
from selenium import webdriver
have_selenium = True
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_commands.py
Expand Up @@ -8,10 +8,7 @@
from builtins import str
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
import hashlib
import shutil
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_core.py
Expand Up @@ -2,10 +2,7 @@
Unit tests for the sumatra.core module
"""

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest

from sumatra.core import _Registry as Registry

Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_dependency_finder.py
Expand Up @@ -6,10 +6,7 @@
from builtins import str
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import distutils.spawn
import sumatra.dependency_finder as df
import sys
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_formatting.py
Expand Up @@ -5,10 +5,7 @@
from __future__ import unicode_literals
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import tempfile
from datetime import datetime
import os
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_launch.py
Expand Up @@ -6,10 +6,7 @@
from builtins import str
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
from sumatra.launch import SerialLaunchMode, DistributedLaunchMode
import sys
import os
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_parameters.py
Expand Up @@ -5,10 +5,7 @@
from __future__ import unicode_literals
from builtins import str

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
import textwrap
from copy import deepcopy
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_programs.py
Expand Up @@ -5,10 +5,7 @@
from builtins import str
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import distutils.spawn
import sys
import os
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_publishing.py
Expand Up @@ -4,10 +4,7 @@
from __future__ import unicode_literals
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest

import sys
import os
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_recordstore.py
Expand Up @@ -9,10 +9,7 @@
standard_library.install_aliases()
from builtins import str
from builtins import object
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
import sys
import tempfile
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_versioncontrol.py
Expand Up @@ -6,10 +6,7 @@
from builtins import str
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
import os
import pickle
import tempfile
Expand Down
5 changes: 1 addition & 4 deletions test/unittests/test_web.py
Expand Up @@ -5,10 +5,7 @@
from __future__ import unicode_literals
from builtins import object

try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest
from datetime import datetime


Expand Down
7 changes: 0 additions & 7 deletions tox.ini
Expand Up @@ -13,13 +13,6 @@ changedir = {toxinidir}/test/unittests
commands =
nosetests []

[testenv:py26]
deps =
{[testenv]deps}
unittest2
pathlib
configparser

[testenv:py27]
deps =
{[testenv]deps}
Expand Down

0 comments on commit 3602ae0

Please sign in to comment.