From a51f2caed3ed5bacf191f7035a031cad83805fc6 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 14 Sep 2015 09:33:59 -0700 Subject: [PATCH 1/3] add python 3.5 to setup and travis --- .travis.yml | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 63c99928f7..ae5d414f35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,13 @@ python: - 2.7 - 3.3 - 3.4 + - 3.5 env: - PD_VERSION=0.13.1 - PD_VERSION="0.14.*" - PD_VERSION="0.15.*" - PD_VERSION="0.16.*" + - PD_VERSION="0.17.*" # setup miniconda for numpy, scipy, pandas before_install: diff --git a/setup.py b/setup.py index 912882a085..853ad6cca0 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ exec(f.read()) # check python version. -if not sys.version_info[:2] in ((2,7), (3,3), (3,4)): +if not sys.version_info[:2] in ((2,7), (3,3), (3,4), (3,5)): sys.exit('%s requires Python 2.7, 3.3, or 3.4' % DISTNAME) setuptools_kwargs = { From b19f74cba127c27c8499ac0784978081643bfb80 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 14 Sep 2015 10:11:22 -0700 Subject: [PATCH 2/3] add 3.5 to travis conda line move 3.5 install line in travis build for pure install reconfigure travis setup to use pip for some things make pandas versions explicit in req files add numba to non min builds remove numba from 3.5 since it is not yet supported move scipy to setup.py. remove from conda ymls switch from setup.py to pip install . add path echo add ls lib add atlas try installing scipy using apt move np/pd earlier in build remove scipy as dependency. add scipy testing to travis script. remove cruft. simplify pip scipy install command remove numba from py34. update readme --- .travis.yml | 87 ++++++++++++++++++++++++------------ README.md | 4 +- ci/requirements-py27-min.yml | 11 +++++ ci/requirements-py27.yml | 12 +++++ ci/requirements-py34.yml | 11 +++++ ci/requirements-py35.yml | 11 +++++ setup.py | 2 +- 7 files changed, 107 insertions(+), 31 deletions(-) create mode 100644 ci/requirements-py27-min.yml create mode 100644 ci/requirements-py27.yml create mode 100644 ci/requirements-py34.yml create mode 100644 ci/requirements-py35.yml diff --git a/.travis.yml b/.travis.yml index ae5d414f35..e24c2169e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,71 @@ +# Based on +# http://conda.pydata.org/docs/travis.html +# https://github.com/xray/xray/blob/master/.travis.yml +# https://github.com/scipy/scipy/blob/master/.travis.yml + language: python -python: - - 2.7 - - 3.3 - - 3.4 - - 3.5 -env: - - PD_VERSION=0.13.1 - - PD_VERSION="0.14.*" - - PD_VERSION="0.15.*" - - PD_VERSION="0.16.*" - - PD_VERSION="0.17.*" +sudo: false # if false, use TravisCI's container based build + +matrix: + include: + - python: 2.7 + env: CONDA_ENV=py27-min + - python: 2.7 + env: CONDA_ENV=py27 + - python: 3.4 + env: CONDA_ENV=py34 + addons: + apt: + packages: + - libatlas-dev + - libatlas-base-dev + - liblapack-dev + - gfortran + - libgmp-dev + - libmpfr-dev + - python: 3.5 + env: CONDA_ENV=py35 + addons: + apt: + packages: + - libatlas-dev + - libatlas-base-dev + - liblapack-dev + - gfortran + - libgmp-dev + - libmpfr-dev + + +# - ccache +#cache: +# directories: +# - $HOME/.ccache # setup miniconda for numpy, scipy, pandas before_install: - echo "before install" - - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda/bin:$PATH - - conda update --yes conda - - sudo rm -rf /dev/shm - - sudo ln -s /run/shm /dev/shm - - date - - uname -a - - python -V + - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then + wget http://repo.continuum.io/miniconda/Miniconda-3.16.0-Linux-x86_64.sh -O miniconda.sh; + else + wget http://repo.continuum.io/miniconda/Miniconda3-3.16.0-Linux-x86_64.sh -O miniconda.sh; + fi + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda update -q conda + - conda info -a install: - echo "install" - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy pandas=$PD_VERSION nose pytz ephem; fi - - if [[ $TRAVIS_PYTHON_VERSION == '3.3' || $TRAVIS_PYTHON_VERSION == '3.4' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=1.8 scipy=0.14 pandas nose pytz ephem; conda install --yes pandas=$PD_VERSION --no-deps; fi - - test $PD_VERSION != 0.13.1 && conda install --yes "numba>=0.17" || echo "Not installing numba" - - conda install --yes coverage - - pip install coveralls + - conda env create --file ci/requirements-$CONDA_ENV.yml + - source activate test_env # all envs are named test_env in the yml files + - conda list + - echo $PATH + - ls -l /home/travis/miniconda/envs/test_env/lib + #- pip install . # use pip to automatically install anything not in the yml files (i.e. numpy/scipy/pandas for py3*) + - pip install scipy # won't do anything if already installed - python setup.py install - # for nosetests to actually work since it alters the path - - python setup.py build_ext --inplace script: - nosetests -v --with-coverage --cover-package=pvlib pvlib diff --git a/README.md b/README.md index 98064de804..a3b996507e 100644 --- a/README.md +++ b/README.md @@ -127,9 +127,9 @@ License Compatibility ============= -pvlib-python is compatible with Python versions 2.7, 3.3, and 3.4, and pandas versions 0.13.1 through 0.16.2. +pvlib-python is compatible with Python versions 2.7, 3.3, 3.4, 3.5 and Pandas versions 0.13.1 through 0.17. Note that our Numba-accelerated solar position algorithms have more specific version requirements that will be resolved by the Numba installer. -For Linux + Python 3 users: The combination of Linux, Python 3, NumPy 1.9, and SciPy 0.15 has some bugs. The most common place for these bugs to show up when using pvlib-python is in calculating IV curve parameters using the ``singlediode`` function. Downgrade your NumPy to 1.8 and SciPy to 0.14, then install whatever version of pandas you want but without dependencies. The conda commands for this are: +For Linux + Python 3 users: Continuum's Python 3.x SciPy conda package is not compiled properly and has a few bugs related to complex arithmetic. The most common place for these bugs to show up when using pvlib-python is in calculating IV curve parameters using the ``singlediode`` function. We reported [the issue](https://github.com/ContinuumIO/anaconda-issues/issues/425) to Continuum and are waiting for it to be fixed. In the meantime, you can compile your own SciPy distribution, or you can use this trick on Python 3.3 and 3.4 (not 3.5): Downgrade your NumPy to 1.8 and SciPy to 0.14, then install whatever version of pandas you want but without dependencies. The conda commands for this are: ``` conda install numpy=1.8 scipy=0.14 diff --git a/ci/requirements-py27-min.yml b/ci/requirements-py27-min.yml new file mode 100644 index 0000000000..1cd6103267 --- /dev/null +++ b/ci/requirements-py27-min.yml @@ -0,0 +1,11 @@ +name: test_env +dependencies: + - python=2.7 + - numpy==1.8.2 + - scipy + - pandas==0.13.1 + - nose + - pytz + - ephem + - pip: + - coveralls \ No newline at end of file diff --git a/ci/requirements-py27.yml b/ci/requirements-py27.yml new file mode 100644 index 0000000000..52d8d575f2 --- /dev/null +++ b/ci/requirements-py27.yml @@ -0,0 +1,12 @@ +name: test_env +dependencies: + - python=2.7 + - numpy + - scipy + - pandas + - nose + - pytz + - ephem + - numba + - pip: + - coveralls \ No newline at end of file diff --git a/ci/requirements-py34.yml b/ci/requirements-py34.yml new file mode 100644 index 0000000000..efcf7848a2 --- /dev/null +++ b/ci/requirements-py34.yml @@ -0,0 +1,11 @@ +name: test_env +dependencies: + - python=3.4 + - nose + - pytz + - ephem + #- numba + - pip: + - numpy + - pandas + - coveralls \ No newline at end of file diff --git a/ci/requirements-py35.yml b/ci/requirements-py35.yml new file mode 100644 index 0000000000..219a1025e8 --- /dev/null +++ b/ci/requirements-py35.yml @@ -0,0 +1,11 @@ +name: test_env +dependencies: + - python=3.5 + - nose + - pytz + - ephem +# - numba + - pip: + - numpy + - pandas + - coveralls \ No newline at end of file diff --git a/setup.py b/setup.py index 853ad6cca0..231dbd0e0c 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setuptools_kwargs = { 'zip_safe': False, - 'install_requires': ['numpy >= 1.7.0', + 'install_requires': ['numpy >= 1.8.2', 'pandas >= 0.13.1', 'pytz', 'six', From 5bb39e2e030282aa29e78cac7dee6270613c4dc8 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Tue, 27 Oct 2015 09:40:53 -0700 Subject: [PATCH 3/3] try adding ccache like scipy does --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e24c2169e9..26e62d879c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,19 @@ matrix: - libgmp-dev - libmpfr-dev +addons: + apt: + packages: + - ccache -# - ccache -#cache: -# directories: -# - $HOME/.ccache +cache: + directories: + - $HOME/.ccache # setup miniconda for numpy, scipy, pandas before_install: - echo "before install" + - export PATH=/usr/lib/ccache:$PATH - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget http://repo.continuum.io/miniconda/Miniconda-3.16.0-Linux-x86_64.sh -O miniconda.sh; else