Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: drop Python 2.7 and 3.4 #9582

Merged
merged 5 commits into from Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions .travis.yml
Expand Up @@ -10,7 +10,7 @@ env:
- OPENBLAS_NUM_THREADS=1
matrix:
include:
- python: 2.7
- python: 3.6
env:
- PYFLAKES=1
- PEP8=1
Expand All @@ -19,9 +19,12 @@ matrix:
- pip install pycodestyle==2.3.1
- pip install pyflakes==1.1.0
script:
- PYFLAKES_NODOCTEST=1 pyflakes scipy benchmarks/benchmarks | grep -E -v 'unable to detect undefined names|assigned to but never used|imported but unused|redefinition of unused|may be undefined, or defined from star imports' > test.out; cat test.out; test \! -s test.out
# pyflakes doesn't respect "# noqa" and cannot ignore files, so filter out six.py
- PYFLAKES_NODOCTEST=1 pyflakes scipy benchmarks/benchmarks | grep -E -v 'unable to detect undefined names|assigned to but never used|imported but unused|redefinition of unused|may be undefined, or defined from star imports' | grep -E -v 'scipy/_lib/six.py' > test.out; cat test.out; test \! -s test.out
- pycodestyle scipy benchmarks/benchmarks
- python: 2.7
- python: 3.7
dist: xenial # travis-ci/travis-ci/issues/9815
sudo: true
env:
- TESTMODE=fast
- COVERAGE=
Expand All @@ -32,7 +35,7 @@ matrix:
env:
- TESTMODE=full
- COVERAGE="--coverage --gcov"
- NUMPYSPEC="--upgrade numpy"
- NUMPYSPEC="numpy==1.15.4"
- python: 3.6
env:
- TESTMODE=fast
Expand All @@ -44,14 +47,14 @@ matrix:
env:
- TESTMODE=fast
- COVERAGE=
- NUMPYSPEC="numpy==1.8.2"
- NUMPYSPEC="numpy==1.13.3"
- USE_SDIST=1
- python: 3.4
- python: 3.6
env:
- TESTMODE=fast
- COVERAGE=
- USE_WHEEL=1
- NUMPYSPEC="--upgrade numpy"
- NUMPYSPEC="numpy==1.14.6"
# The following is needed for optimized "-OO" test run but since we use
# pytest-xdist plugin for load scheduling its workers don't pick up the
# flag. This environment variable starts all Py instances in -OO mode.
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.rst.txt
Expand Up @@ -31,11 +31,11 @@ PREREQUISITES

SciPy requires the following software installed for your platform:

1) Python__ 2.7 or >= 3.4
1) Python__ >= 3.5

__ https://www.python.org

2) NumPy__ >= 1.8.2
2) NumPy__ >= 1.13.3

__ https://www.numpy.org/

Expand All @@ -49,7 +49,7 @@ __ http://www.sphinx-doc.org/

5) If you want to build SciPy master or other unreleased version from source
(Cython-generated C sources are included in official releases):
Cython__ >= 0.23.4
Cython__ >= 0.28.5

__ http://cython.org/

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,7 +1,7 @@
Copyright (c) 2001, 2002 Enthought, Inc.
All rights reserved.

Copyright (c) 2003-2017 SciPy Developers.
Copyright (c) 2003-2019 SciPy Developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
17 changes: 0 additions & 17 deletions appveyor.yml
Expand Up @@ -26,11 +26,6 @@ environment:
PYTHON_ARCH: 32
TEST_MODE: fast

- PYTHON: C:\Python27-x64
PYTHON_VERSION: 2.7
PYTHON_ARCH: 64
TEST_MODE: fast

- PYTHON: C:\Python35-x64
PYTHON_VERSION: 3.5
PYTHON_ARCH: 64
Expand All @@ -41,18 +36,6 @@ environment:
PYTHON_ARCH: 64
TEST_MODE: full

- PYTHON: C:\Python27
PYTHON_VERSION: 2.7
PYTHON_ARCH: 32
SKIP_NOTAG: true
TEST_MODE: full

- PYTHON: C:\Python34
PYTHON_VERSION: 3.4
PYTHON_ARCH: 32
SKIP_NOTAG: true
TEST_MODE: full

- PYTHON: C:\Python35-x64
PYTHON_VERSION: 3.5
PYTHON_ARCH: 64
Expand Down
29 changes: 6 additions & 23 deletions pavement.py
Expand Up @@ -125,7 +125,7 @@
#-------------------------------------------------------

# Default python version
PYVER="2.7"
PYVER="3.6"

# Paver options object, holds all default dirs
options(bootstrap=Bunch(bootstrap_dir="bootstrap"),
Expand Down Expand Up @@ -155,40 +155,23 @@

# Wine config for win32 builds
if sys.platform == "win32":
WINE_PY26 = [r"C:\Python26\python.exe"]
WINE_PY27 = [r"C:\Python27\python.exe"]
WINE_PY32 = [r"C:\Python32\python.exe"]
WINE_PY33 = [r"C:\Python33\python.exe"]
WINE_PY34 = [r"C:\Python34\python.exe"]
WINE_PY35 = [r"C:\Python35\python.exe"]
WINDOWS_ENV = os.environ
MAKENSIS = ["makensis"]
elif sys.platform == "darwin":
WINE_PY26 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"]
WINE_PY27 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"]
WINE_PY32 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"]
WINE_PY33 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"]
WINE_PY34 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python34/python.exe"]
WINE_PY35 = ["wine", os.environ['HOME'] + "/.wine/drive_c/Python35/python.exe"]
WINDOWS_ENV = os.environ
WINDOWS_ENV["DYLD_FALLBACK_LIBRARY_PATH"] = "/usr/X11/lib:/usr/lib"
MAKENSIS = ["wine", "makensis"]
else:
WINE_PY26 = [os.environ['HOME'] + "/.wine/drive_c/Python26/python.exe"]
WINE_PY27 = [os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"]
WINE_PY32 = [os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"]
WINE_PY33 = [os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"]
WINE_PY34 = [os.environ['HOME'] + "/.wine/drive_c/Python34/python.exe"]
WINE_PY35 = [os.environ['HOME'] + "/.wine/drive_c/Python35/python.exe"]
WINDOWS_ENV = os.environ
MAKENSIS = ["wine", "makensis"]
WINE_PYS = {'3.4':WINE_PY34, '3.3':WINE_PY33, '3.2':WINE_PY32,
'2.7':WINE_PY27, '2.6':WINE_PY26}
WINE_PYS = {'3.5':WINE_PY35}

# Framework Python locations on OS X
MPKG_PYTHON = {
"2.6": "/Library/Frameworks/Python.framework/Versions/2.6/bin/python",
"2.7": "/Library/Frameworks/Python.framework/Versions/2.7/bin/python",
"3.2": "/Library/Frameworks/Python.framework/Versions/3.2/bin/python3",
"3.3": "/Library/Frameworks/Python.framework/Versions/3.3/bin/python3",
"3.4": "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3"
"3.5": "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"
}
# Full path to the *static* gfortran runtime
LIBGFORTRAN_A_PATH = "/usr/local/lib/libgfortran.a"
Expand Down
4 changes: 2 additions & 2 deletions scipy/__init__.py
Expand Up @@ -108,9 +108,9 @@

from scipy.version import version as __version__
from scipy._lib._version import NumpyVersion as _NumpyVersion
if _NumpyVersion(__numpy_version__) < '1.8.2':
if _NumpyVersion(__numpy_version__) < '1.13.3':
import warnings
warnings.warn("Numpy 1.8.2 or above is recommended for this version of "
warnings.warn("Numpy 1.13.3 or above is required for this version of "
"scipy (detected version %s)" % __numpy_version__,
UserWarning)

Expand Down
2 changes: 1 addition & 1 deletion scipy/cluster/_optimal_leaf_ordering.pyx
Expand Up @@ -88,7 +88,7 @@ cdef int _simultaneous_sort(float* dist, int* idx,
# The smallest of the three is moved to the beginning of the array,
# the middle (the pivot value) is moved to the end, and the largest
# is moved to the pivot index.
pivot_idx = size / 2
pivot_idx = size // 2
if dist[0] > dist[size - 1]:
dual_swap(dist, idx, 0, size - 1)
if dist[size - 1] > dist[pivot_idx]:
Expand Down
2 changes: 1 addition & 1 deletion scipy/optimize/_trlib/_trlib.pyx
@@ -1,6 +1,6 @@
from scipy.optimize._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
import numpy as np
cimport ctrlib
from . cimport ctrlib
cimport libc.stdio
cimport numpy as np

Expand Down
2 changes: 1 addition & 1 deletion scipy/special/_ellip_harm.pxd
Expand Up @@ -63,7 +63,7 @@ cdef inline double* lame_coefficients(double h2, double k2, int n, int p,

cdef double s2, alpha, beta, gamma, lamba_romain, pp, psi, t1, tol, vl, vu
cdef int r, tp, j, size, i, info, lwork, liwork, c, iu
cdef char t
cdef Py_UNICODE t

r = n/2
alpha = h2
Expand Down
5 changes: 0 additions & 5 deletions scipy/stats/_distn_infrastructure.py
Expand Up @@ -354,11 +354,6 @@ def instancemethod(func, obj, cls):
for obj in [s for s in dir() if s.startswith('_doc_')]:
exec('del ' + obj)
del obj
try:
del s
except NameError:
# in Python 3, loop variables are not visible after the loop
pass


def _moment(data, n, mu=None):
Expand Down
20 changes: 8 additions & 12 deletions setup.py
Expand Up @@ -26,13 +26,11 @@
import sysconfig


if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 4):
raise RuntimeError("Python version 2.7 or >= 3.4 required.")
if sys.version_info[:2] < (3, 5):
raise RuntimeError("Python version >= 3.5 required.")

import builtins

if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins

CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Expand All @@ -41,12 +39,10 @@
License :: OSI Approved :: BSD License
Programming Language :: C
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Expand Down Expand Up @@ -423,12 +419,12 @@ def setup_package():
try:
import numpy
except ImportError: # We do not have numpy installed
build_requires = ['numpy>=1.8.2']
build_requires = ['numpy>=1.13.3']
else:
# If we're building a wheel, assume there already exist numpy wheels
# for this platform, so it is safe to add numpy to build requirements.
# See gh-5184.
build_requires = (['numpy>=1.8.2'] if 'bdist_wheel' in sys.argv[1:]
build_requires = (['numpy>=1.13.3'] if 'bdist_wheel' in sys.argv[1:]
else [])

metadata = dict(
Expand All @@ -446,7 +442,7 @@ def setup_package():
test_suite='nose.collector',
setup_requires=build_requires,
install_requires=build_requires,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
python_requires='>=3.5',
)

if "--force" in sys.argv:
Expand Down
2 changes: 1 addition & 1 deletion tools/cythonize.py
Expand Up @@ -84,7 +84,7 @@ def process_pyx(fromfile, tofile, cwd):
except ImportError:
pass

flags = ['--fast-fail']
flags = ['--fast-fail', '-3']
if tofile.endswith('.cxx'):
flags += ['--cplus']

Expand Down