Skip to content

Commit d68617c

Browse files
markcampanelliwholmgren
authored andcommitted
Drop Python 2 and 3.4 (#728)
* Drop Python 2 and 3.4 * Fix travis for 3.7 and update azure * Remove six dependency * Add min Travis build with consistent requirements and fixed tests * Pin pvfactors also in setup.py * Fix python version comparison for 3.7 patches * Revert unneeded test change * Remove Python 2 mock usages * Address code review comments * Appease the stickler * Check for Python version range in setup.py * Use more succint range syntax
1 parent f38fe07 commit d68617c

20 files changed

+120
-166
lines changed

.travis.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ sudo: false # if false, use TravisCI's container based build
1111
# someday add os: osx to specify osx, but python not yet supported on Travis
1212
matrix:
1313
include:
14-
- python: 2.7
15-
env: CONDA_ENV=py27-min
16-
- python: 2.7
17-
env: CONDA_ENV=py27
18-
- python: 3.4
19-
env: CONDA_ENV=py34
14+
- python: 3.5
15+
env: CONDA_ENV=py35-min
2016
- python: 3.5
2117
env: CONDA_ENV=py35
2218
- python: 3.6
@@ -38,19 +34,15 @@ cache:
3834
# setup miniconda for numpy, scipy, pandas, etc.
3935
before_install:
4036
- echo "before install"
41-
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
42-
export PYVER="2";
43-
else
44-
export PYVER="3";
45-
fi
37+
- export PYVER="3"
4638
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
4739
export OSSTR="MacOSX-x86_64.sh";
4840
else
4941
export OSSTR="Linux-x86_64.sh";
5042
export PATH=/usr/lib/ccache:$PATH;
5143
fi
5244
- export BASE="http://repo.continuum.io/miniconda/Miniconda"
53-
- export CONDAVER="4.5.4"
45+
- export CONDAVER="4.6.14"
5446
- wget $BASE$PYVER-$CONDAVER-$OSSTR -O miniconda.sh;
5547
- bash miniconda.sh -b -p $HOME/miniconda
5648
- export PATH="$HOME/miniconda/bin:$PATH"
@@ -63,14 +55,6 @@ install:
6355
- echo "install"
6456
- conda env create --file ci/requirements-$CONDA_ENV.yml
6557
- source activate test_env # all envs are named test_env in the yml files
66-
# needed to make sure that pandas is compiled against the right
67-
# version of numpy
68-
- if [[ "$CONDA_ENV" == "py27-min" ]]; then
69-
pip uninstall numpy --yes;
70-
pip uninstall pandas --yes;
71-
pip install --no-cache-dir numpy==1.10.1;
72-
pip install --no-cache-dir pandas==0.16.0;
73-
fi
7458
- conda list
7559
- echo $PATH
7660
- ls -l /home/travis/miniconda/envs/test_env/lib

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ Installation
3232
pvlib-python releases may be installed using the ``pip`` and ``conda`` tools.
3333
Please see the [Installation page](http://pvlib-python.readthedocs.io/en/latest/installation.html) of the documentation for complete instructions.
3434

35-
pvlib-python is compatible with Python versions 2.7 and 3.4-3.7.
35+
pvlib-python is compatible with Python 3.5 and above.
3636

37-
**Python 2.7 support will end on June 1, 2019**. Releases made after this
38-
date will require Python 3.
37+
**Python 2.7 support ended on June 1, 2019, with pvlib-python 0.6.3.**
3938

4039

4140
Contributing

azure-pipelines.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
Python27:
17-
python.version: '27'
1816
Python35:
1917
python.version: '35'
2018
Python36:
@@ -68,8 +66,6 @@ jobs:
6866

6967
strategy:
7068
matrix:
71-
Python27-windows:
72-
python.version: '27'
7369
Python35-windows:
7470
python.version: '35'
7571
Python36-windows:

ci/requirements-py27-min.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

ci/requirements-py27.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

ci/requirements-py34.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

ci/requirements-py35-min.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: test_env
2+
channels:
3+
- defaults
4+
dependencies:
5+
- coveralls
6+
- nose
7+
- numpy=1.10.1
8+
- pandas=0.18.0
9+
- pip
10+
- pytest
11+
- pytest-cov
12+
- pytest-mock
13+
- pytest-timeout
14+
- python=3.5
15+
- pytz
16+
- requests

ci/requirements-py35.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.5
7-
- numpy
8-
- scipy
9-
- pytables
10-
- pandas
11-
- pytz
6+
- coveralls
7+
- cython
128
- ephem
9+
- netcdf4
10+
- nose
1311
- numba
14-
- siphon
12+
- numpy
13+
- pandas
14+
- pip
15+
- pytables # tables when using pip+PyPI
1516
- pytest
1617
- pytest-cov
17-
- nose
18+
- pytest-mock
19+
- pytest-timeout
20+
- python=3.5
21+
- pytz
22+
- requests
23+
- scipy
1824
- shapely # pvfactors dependency
25+
- siphon # conda-forge
1926
- pip:
20-
- coveralls
21-
- pytest-mock
22-
- pytest-timeout
2327
- pvfactors==1.0.1

ci/requirements-py36.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.6
7-
- numpy
8-
- scipy
9-
- pytables
10-
- pandas
11-
- pytz
6+
- coveralls
7+
- cython
128
- ephem
9+
- netcdf4
10+
- nose
1311
- numba
14-
- siphon
12+
- numpy
13+
- pandas
14+
- pip
15+
- pytables # tables when using pip+PyPI
1516
- pytest
1617
- pytest-cov
17-
- nose
18+
- pytest-mock
19+
- pytest-timeout
20+
- python=3.6
21+
- pytz
22+
- requests
23+
- scipy
1824
- shapely # pvfactors dependency
25+
- siphon # conda-forge
1926
- pip:
20-
- coveralls
21-
- pytest-mock
22-
- pytest-timeout
2327
- pvfactors==1.0.1

ci/requirements-py37.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.7
7-
- numpy
8-
- scipy
9-
- pytables
10-
- pandas
11-
- pytz
6+
- coveralls
7+
- cython
128
- ephem
9+
- netcdf4
10+
- nose
1311
- numba
14-
- siphon
12+
- numpy
13+
- pandas
14+
- pip
15+
- pytables # tables when using pip+PyPI
1516
- pytest
1617
- pytest-cov
17-
- nose
18+
- pytest-mock
19+
- pytest-timeout
20+
- python=3.7
21+
- pytz
22+
- requests
23+
- scipy
1824
- shapely # pvfactors dependency
25+
- siphon # conda-forge
1926
- pip:
20-
- coveralls
21-
- pytest-mock
22-
- pytest-timeout
2327
- pvfactors==1.0.1

docs/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
- defaults
55
dependencies:
66
- python=3.6
7-
- mock # needed for local python 2.7 builds
87
- numpy=1.14.2
98
- scipy
109
- pytables

docs/sphinx/source/conf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
import os
1717

1818
# Mock modules so RTD works
19-
try:
20-
from mock import Mock as MagicMock
21-
except ImportError:
22-
from unittest.mock import MagicMock
19+
from unittest.mock import MagicMock
20+
2321

2422
class Mock(MagicMock):
2523
@classmethod

docs/sphinx/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pvlib python generally follows the `PEP 8 -- Style Guide for Python Code
196196
<https://www.python.org/dev/peps/pep-0008/>`_. Maximum line length for code
197197
is 79 characters.
198198

199-
Code must be compatible with python 2.7 and 3.4+.
199+
Code must be compatible with Python 3.5 and above.
200200

201201
pvlib python uses a mix of full and abbreviated variable names. See
202202
:ref:`variables_style_rules`. We could be better about consistency.

docs/sphinx/source/installation.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ Any changes that you make to this pvlib-python will be available inside
201201
your environment. If you run a git checkout, branch, or pull command the
202202
result will be applied to your pvlib-python installation. This
203203
is great for development. Note, however, that you will need to use
204-
Python's ``reload`` function (`python 2
205-
<https://docs.python.org/2/library/functions.html#reload>`_, `python 3
204+
Python's ``reload`` function (`python 3
206205
<https://docs.python.org/3/library/importlib.html#importlib.reload>`_)
207206
if you make changes to pvlib during an interactive Python
208207
session (including a Jupyter notebook). Restarting the Python
@@ -216,7 +215,7 @@ environment) when you start a new shell or terminal.
216215
Compatibility
217216
-------------
218217

219-
pvlib-python is compatible with Python versions 2.7 and 3.4-3.7.
218+
pvlib-python is compatible with Python 3.5 and above.
220219

221220
pvlib-python requires Pandas and Numpy. The minimum version requirements
222221
are specified in
@@ -228,7 +227,7 @@ be installed separately using pip or conda. These packages/features
228227
include:
229228

230229
* scipy: single diode model, clear sky detection
231-
* pytables: Linke turbidity look up for clear sky models
230+
* pytables (tables on PyPI): Linke turbidity look up for clear sky models
232231
* numba: fastest solar position calculations
233232
* pyephem: solar positions calculations using an astronomical library
234233
* siphon: forecasting PV power using the pvlib.forecast module

docs/sphinx/source/whatsnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ What's New
66

77
These are new features and improvements of note in each release.
88

9+
.. include:: whatsnew/v0.7.0.rst
910
.. include:: whatsnew/v0.6.3.rst
1011
.. include:: whatsnew/v0.6.2.rst
1112
.. include:: whatsnew/v0.6.1.rst
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. _whatsnew_0700:
2+
3+
v0.7.0 (MONTH DAY, YEAR)
4+
---------------------
5+
6+
This is a major release that drops support for Python 2 and Python 3.4. We
7+
recommend all users of v0.6.3 upgrade to this release.
8+
9+
**Python 2.7 support ended on June 1, 2019**. (:issue:`501`)
10+
11+
12+
Contributors
13+
~~~~~~~~~~~~
14+
* Mark Campanellli (:ghuser:`markcampanelli`)
15+
* Will Holmgren (:ghuser:`wholmgren`)

pvlib/test/test_location.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import datetime
2-
try:
3-
from unittest.mock import ANY
4-
except ImportError:
5-
# python 2
6-
from mock import ANY
2+
from unittest.mock import ANY
73

84
import numpy as np
95
from numpy import nan

pvlib/test/test_modelchain.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
import sys
2-
try:
3-
from unittest.mock import ANY
4-
except ImportError:
5-
# python 2
6-
from mock import ANY
72

83
import numpy as np
94
import pandas as pd

0 commit comments

Comments
 (0)