Skip to content

Commit

Permalink
Removed Python 2.6 support and related checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Panfilov committed Apr 1, 2016
1 parent a8dc808 commit 0e6ccab
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 56 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ notifications:

matrix:
include:
- python: 2.6
env: WITH_PYAMG=1 NO_SPHINX=1
- python: 2.7
env: PIP_FLAGS="--pre"
- python: 2.7
Expand Down
4 changes: 2 additions & 2 deletions DEPENDS.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Build Requirements
------------------
* `Python >= 2.6 <http://python.org>`__
* `Python >= 2.7 <http://python.org>`__
* `Numpy >= 1.7.2 <http://numpy.scipy.org/>`__
* `Cython >= 0.23 <http://www.cython.org/>`__
* `Six >=1.4 <https://pypi.python.org/pypi/six>`__
* `SciPy >=0.9 <http://scipy.org>`__

Runtime requirements
--------------------
* `Python >= 2.6 <http://python.org>`__
* `Python >= 2.7 <http://python.org>`__
* `Numpy >= 1.7.2 <http://numpy.scipy.org/>`__
* `SciPy >= 0.9 <http://scipy.org>`__
* `Matplotlib >= 1.1.0 <http://matplotlib.sf.net>`__
Expand Down
2 changes: 0 additions & 2 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Version 0.14

Version 0.13
------------
* Require Python 2.7+, remove warning in `__init__.py` and 2.6 hack in
`doc/release/contribs.py`.
* Remove deprecated `None` defaults for `skimage.exposure.rescale_intensity`
* Remove deprecated edge filters `hsobel`, `vsobel`, `hscharr`, `vscharr`,
`hprewitt`, `vprewitt`, `roberts_positive_diagonal`,
Expand Down
60 changes: 28 additions & 32 deletions doc/release/contribs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,41 @@

tag = sys.argv[1]

def call(cmd):
return subprocess.check_output(shlex.split(cmd), universal_newlines=True).split('\n')

if not sys.version_info[:2] == (2, 6):
tag_date = call("git show --format='%%ci' %s" % tag)[0]
print("Release %s was on %s\n" % (tag, tag_date))

def call(cmd):
return subprocess.check_output(shlex.split(cmd), universal_newlines=True).split('\n')
merges = call("git log --since='%s' --merges --format='>>>%%B' --reverse" % tag_date)
merges = [m for m in merges if m.strip()]
merges = '\n'.join(merges).split('>>>')
merges = [m.split('\n')[:2] for m in merges]
merges = [m for m in merges if len(m) == 2 and m[1].strip()]

tag_date = call("git show --format='%%ci' %s" % tag)[0]
print("Release %s was on %s\n" % (tag, tag_date))
num_commits = call("git rev-list %s..HEAD --count" % tag)[0]
print("A total of %s changes have been committed.\n" % num_commits)

merges = call("git log --since='%s' --merges --format='>>>%%B' --reverse" % tag_date)
merges = [m for m in merges if m.strip()]
merges = '\n'.join(merges).split('>>>')
merges = [m.split('\n')[:2] for m in merges]
merges = [m for m in merges if len(m) == 2 and m[1].strip()]
print("It contained the following %d merges:\n" % len(merges))
for (merge, message) in merges:
if merge.startswith('Merge pull request #'):
PR = ' (%s)' % merge.split()[3]
else:
PR = ''

num_commits = call("git rev-list %s..HEAD --count" % tag)[0]
print("A total of %s changes have been committed.\n" % num_commits)
print('- ' + message + PR)

print("It contained the following %d merges:\n" % len(merges))
for (merge, message) in merges:
if merge.startswith('Merge pull request #'):
PR = ' (%s)' % merge.split()[3]
else:
PR = ''
print("\nMade by the following committers [alphabetical by last name]:\n")

print('- ' + message + PR)
authors = call("git log --since='%s' --format=%%aN" % tag_date)
authors = [a.strip() for a in authors if a.strip()]

def key(author):
author = [v for v in author.split() if v[0] in string.ascii_letters]
if len(author) > 0:
return author[-1]

print("\nMade by the following committers [alphabetical by last name]:\n")
authors = sorted(set(authors), key=key)

authors = call("git log --since='%s' --format=%%aN" % tag_date)
authors = [a.strip() for a in authors if a.strip()]

def key(author):
author = [v for v in author.split() if v[0] in string.ascii_letters]
if len(author) > 0:
return author[-1]

authors = sorted(set(authors), key=key)

for a in authors:
print('- ' + a)
for a in authors:
print('- ' + a)
2 changes: 2 additions & 0 deletions doc/release/release_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ API Changes
Deprecations
------------

- Python 2.6 support has been dropped. Minimal required Python version is 2.7.


Contributors to this release
----------------------------
2 changes: 1 addition & 1 deletion optional_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ imread; python_version != '2.7'
SimpleITK; python_version != '3.4' and python_version != '3.5'
astropy
tifffile
imageio; python_version != '2.6'
imageio
6 changes: 0 additions & 6 deletions skimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,4 @@ def _raise_build_error(e):
from .util.dtype import *


if sys.version.startswith('2.6'):
msg = ("Python 2.6 is deprecated and will not be supported in "
"scikit-image 0.13+")
warnings.warn(msg, stacklevel=2)


del warnings, functools, osp, imp, sys
7 changes: 3 additions & 4 deletions skimage/_shared/tests/test_version_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ def test_get_module_version():


def test_is_installed():
assert version_req.is_installed('python', '>=2.6')
assert version_req.is_installed('python', '>=2.7')
assert not version_req.is_installed('numpy', '<1.0')


def test_require():

# A function that only runs on Python >2.6 and numpy > 1.5 (should pass)
@version_req.require('python', '>2.6')
# A function that only runs on Python >2.7 and numpy > 1.5 (should pass)
@version_req.require('python', '>2.7')
@version_req.require('numpy', '>1.5')
def foo():
return 1
Expand Down
7 changes: 0 additions & 7 deletions tools/travis_before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ retry () {
# add build dependencies
echo "cython>=0.23.4" >> requirements.txt

# require networkx 1.9.1 on 2.6, as 2.6 support was dropped in 1.10
# require matplotlib 1.4.3 on 2.6, as 2.6 support was dropped in 1.5
if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then
sed -i 's/networkx.*/networkx==1.9.1/g' requirements.txt
sed -i 's/matplotlib.*/matplotlib==1.4.3/g' requirements.txt
fi

if [[ $MINIMUM_REQUIREMENTS == 1 ]]; then
sed -i 's/>=/==/g' requirements.txt
fi
Expand Down

0 comments on commit 0e6ccab

Please sign in to comment.