Skip to content

Drop Python 2 and 3.4 #728

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

Merged
merged 12 commits into from
May 20, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ sudo: false # if false, use TravisCI's container based build
# someday add os: osx to specify osx, but python not yet supported on Travis
matrix:
include:
- python: 2.7
env: CONDA_ENV=py27-min
- python: 2.7
env: CONDA_ENV=py27
- python: 3.4
env: CONDA_ENV=py34
- python: 3.5
env: CONDA_ENV=py35-min
- python: 3.5
env: CONDA_ENV=py35
- python: 3.6
Expand All @@ -38,19 +34,15 @@ cache:
# setup miniconda for numpy, scipy, pandas, etc.
before_install:
- echo "before install"
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
export PYVER="2";
else
export PYVER="3";
fi
- export PYVER="3"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export OSSTR="MacOSX-x86_64.sh";
else
export OSSTR="Linux-x86_64.sh";
export PATH=/usr/lib/ccache:$PATH;
fi
- export BASE="http://repo.continuum.io/miniconda/Miniconda"
- export CONDAVER="4.5.4"
- export CONDAVER="4.6.14"
- wget $BASE$PYVER-$CONDAVER-$OSSTR -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
Expand All @@ -63,14 +55,6 @@ install:
- echo "install"
- conda env create --file ci/requirements-$CONDA_ENV.yml
- source activate test_env # all envs are named test_env in the yml files
# needed to make sure that pandas is compiled against the right
# version of numpy
- if [[ "$CONDA_ENV" == "py27-min" ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wholmgren Do we need to define a new minimum environment in Python 3?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. I'm pretty sure you'll be able to pin the minimum version numbers in the pip section of the file. I'm less sure about the conda section of the file. Either way is fine with me. I don't think we'll need anything special after that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I was wrong -- I'm not able to easily create a python 3.5 environment with the current numpy/pandas minimums on my mac. I suspect it's possible but I don't think it's worth the effort to struggle against theses old packages. I can easily build and test the environment with pandas 0.17:

# requirements-py35-min.yml
name: test_env
channels:
    - defaults
dependencies:
    - python=3.5
    - pip
    - pip:
        - numpy==1.10.1
        - pandas==0.17.0
        - pytz
        - nose
        - pytest
        - pytest-mock
        - pytest-timeout
        - coveralls

We should also specify a newer version of conda in the travis config. Latest is fine.

Only catch is that test_sun_rise_set_transit_spa claims it needs pandas 0.17, but it apparently needs 0.18.

pip uninstall numpy --yes;
pip uninstall pandas --yes;
pip install --no-cache-dir numpy==1.10.1;
pip install --no-cache-dir pandas==0.16.0;
fi
- conda list
- echo $PATH
- ls -l /home/travis/miniconda/envs/test_env/lib
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ Installation
pvlib-python releases may be installed using the ``pip`` and ``conda`` tools.
Please see the [Installation page](http://pvlib-python.readthedocs.io/en/latest/installation.html) of the documentation for complete instructions.

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

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


Contributing
Expand Down
4 changes: 0 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:

strategy:
matrix:
Python27:
python.version: '27'
Python35:
python.version: '35'
Python36:
Expand Down Expand Up @@ -68,8 +66,6 @@ jobs:

strategy:
matrix:
Python27-windows:
python.version: '27'
Python35-windows:
python.version: '35'
Python36-windows:
Expand Down
10 changes: 0 additions & 10 deletions ci/requirements-py27-min.yml

This file was deleted.

23 changes: 0 additions & 23 deletions ci/requirements-py27.yml

This file was deleted.

21 changes: 0 additions & 21 deletions ci/requirements-py34.yml

This file was deleted.

16 changes: 16 additions & 0 deletions ci/requirements-py35-min.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test_env
channels:
- defaults
dependencies:
- coveralls
- nose
- numpy=1.10.1
- pandas=0.18.0
- pip
- pytest
- pytest-cov
- pytest-mock
- pytest-timeout
- python=3.5
- pytz
- requests
26 changes: 15 additions & 11 deletions ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ channels:
- defaults
- conda-forge
dependencies:
- python=3.5
- numpy
- scipy
- pytables
- pandas
- pytz
- coveralls
- cython
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cython?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot it's in the setup.py extras section. I can't remember why it's there. I guess it should be here if it's in the setup.py file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried to make all the non-min requirements files match the optional setup. You'll also notice that I moved everything I could to the conda install. Anaconda recommends minimizing the mixing of conda and pip.

- ephem
- netcdf4
- nose
- numba
- siphon
- numpy
- pandas
- pip
- pytables # tables when using pip+PyPI
- pytest
- pytest-cov
- nose
- pytest-mock
- pytest-timeout
- python=3.5
- pytz
- requests
- scipy
- shapely # pvfactors dependency
- siphon # conda-forge
- pip:
- coveralls
- pytest-mock
- pytest-timeout
- pvfactors==1.0.1
26 changes: 15 additions & 11 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ channels:
- defaults
- conda-forge
dependencies:
- python=3.6
- numpy
- scipy
- pytables
- pandas
- pytz
- coveralls
- cython
- ephem
- netcdf4
- nose
- numba
- siphon
- numpy
- pandas
- pip
- pytables # tables when using pip+PyPI
- pytest
- pytest-cov
- nose
- pytest-mock
- pytest-timeout
- python=3.6
- pytz
- requests
- scipy
- shapely # pvfactors dependency
- siphon # conda-forge
- pip:
- coveralls
- pytest-mock
- pytest-timeout
- pvfactors==1.0.1
26 changes: 15 additions & 11 deletions ci/requirements-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ channels:
- defaults
- conda-forge
dependencies:
- python=3.7
- numpy
- scipy
- pytables
- pandas
- pytz
- coveralls
- cython
- ephem
- netcdf4
- nose
- numba
- siphon
- numpy
- pandas
- pip
- pytables # tables when using pip+PyPI
- pytest
- pytest-cov
- nose
- pytest-mock
- pytest-timeout
- python=3.7
- pytz
- requests
- scipy
- shapely # pvfactors dependency
- siphon # conda-forge
- pip:
- coveralls
- pytest-mock
- pytest-timeout
- pvfactors==1.0.1
1 change: 0 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
- defaults
dependencies:
- python=3.6
- mock # needed for local python 2.7 builds
- numpy=1.14.2
- scipy
- pytables
Expand Down
6 changes: 2 additions & 4 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
import os

# Mock modules so RTD works
try:
from mock import Mock as MagicMock
except ImportError:
from unittest.mock import MagicMock
from unittest.mock import MagicMock


class Mock(MagicMock):
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pvlib python generally follows the `PEP 8 -- Style Guide for Python Code
<https://www.python.org/dev/peps/pep-0008/>`_. Maximum line length for code
is 79 characters.

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

pvlib python uses a mix of full and abbreviated variable names. See
:ref:`variables_style_rules`. We could be better about consistency.
Expand Down
7 changes: 3 additions & 4 deletions docs/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ Any changes that you make to this pvlib-python will be available inside
your environment. If you run a git checkout, branch, or pull command the
result will be applied to your pvlib-python installation. This
is great for development. Note, however, that you will need to use
Python's ``reload`` function (`python 2
<https://docs.python.org/2/library/functions.html#reload>`_, `python 3
Python's ``reload`` function (`python 3
<https://docs.python.org/3/library/importlib.html#importlib.reload>`_)
if you make changes to pvlib during an interactive Python
session (including a Jupyter notebook). Restarting the Python
Expand All @@ -216,7 +215,7 @@ environment) when you start a new shell or terminal.
Compatibility
-------------

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

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

* scipy: single diode model, clear sky detection
* pytables: Linke turbidity look up for clear sky models
* pytables (tables on PyPI): Linke turbidity look up for clear sky models
* numba: fastest solar position calculations
* pyephem: solar positions calculations using an astronomical library
* siphon: forecasting PV power using the pvlib.forecast module
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/source/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ What's New

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

.. include:: whatsnew/v0.7.0.rst
.. include:: whatsnew/v0.6.3.rst
.. include:: whatsnew/v0.6.2.rst
.. include:: whatsnew/v0.6.1.rst
Expand Down
15 changes: 15 additions & 0 deletions docs/sphinx/source/whatsnew/v0.7.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. _whatsnew_0700:

v0.7.0 (MONTH DAY, YEAR)
---------------------

This is a major release that drops support for Python 2 and Python 3.4. We
recommend all users of v0.6.3 upgrade to this release.

**Python 2.7 support ended on June 1, 2019**. (:issue:`501`)


Contributors
~~~~~~~~~~~~
* Mark Campanellli (:ghuser:`markcampanelli`)
* Will Holmgren (:ghuser:`wholmgren`)
6 changes: 1 addition & 5 deletions pvlib/test/test_location.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import datetime
try:
from unittest.mock import ANY
except ImportError:
# python 2
from mock import ANY
from unittest.mock import ANY

import numpy as np
from numpy import nan
Expand Down
5 changes: 0 additions & 5 deletions pvlib/test/test_modelchain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import sys
try:
from unittest.mock import ANY
except ImportError:
# python 2
from mock import ANY
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, this is not used.


import numpy as np
import pandas as pd
Expand Down
Loading