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 5 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-7.

**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
38 changes: 24 additions & 14 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- mock # needed for local python 2.7 builds
- numpy=1.14.2
- scipy
- pytables
- pandas=0.22.0
- pytz
- coveralls
Copy link
Member

Choose a reason for hiding this comment

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

Why do you want to change the docs environment? This has been a pain to test and debug on RTD in the past. I suggest addressing separately if there's a need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure what to do here, but I'm fine reverting.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, please do revert this change.

- cython
- ephem
- ipython
- matplotlib
- netcdf4
- nose
- numba
- ipython=6.3
- matplotlib=2.2.2
- siphon=0.7.0
- sphinx=1.7.2
- netCDF4=1.3.1
- hdf4=4.2.12
- sphinx_rtd_theme
- numpy
- pandas
- pip
- pytables # tables when using pip+PyPI
- pytest
- pytest-cov
- pytest-mock
- pytest-timeout
- python=3.6
- pytz
- requests
- scipy
- shapely # pvfactors dependency
- siphon # conda-forge
- sphinx
- sphinx_rtd_theme
- pip:
- pvfactors==1.0.1
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-7.

pvlib python uses a mix of full and abbreviated variable names. See
:ref:`variables_style_rules`. We could be better about consistency.
Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,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-7.
Copy link
Member

Choose a reason for hiding this comment

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

I suggest "3.5 and above".

Copy link
Member

Choose a reason for hiding this comment

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

Also in readme and contributing.


pvlib-python requires Pandas and Numpy. The minimum version requirements
are specified in
Expand All @@ -228,7 +228,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`)
7 changes: 7 additions & 0 deletions pvlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# First ensure proper Python version.
Copy link
Member

Choose a reason for hiding this comment

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

No need for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would help people who need to upgrade, but I'm fine removing.

import sys
if not ((3, 5) <= sys.version_info and sys.version_info <= (3, 7)):
raise RuntimeError("Current Python version is {}.{}.{}, but pvlib-python \
is only compatible with Python 3.5-7.".format(
sys.version_info[0], sys.version_info[1], sys.version_info[2]))

from pvlib.version import __version__
from pvlib import tools
from pvlib import atmosphere
Expand Down
Loading