-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
@wholmgren Mind if we do this sooner rather than later to simplify development for 0.7.0? We can always make a 0.6.4 branch/release for any hotfixes. |
No objection here. You'll need to drop 2.7 from the azure-pipelines.yml too. |
another mention of python 2.7: https://pvlib-python.readthedocs.io/en/stable/contributing.html#code-style |
.travis.yml
Outdated
- python: 3.5 | ||
env: CONDA_ENV=py35 | ||
- python: 3.6 | ||
env: | ||
- CONDA_ENV=py36 | ||
- TASK="coverage" | ||
- DEPLOY_ENV="true" | ||
- python: 3.6 | ||
- python: 3.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wholmgren Do you know if this is a significant problem in the current builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a problem -- this only specifies the base travis python version. The conda requirements file specifies the python version that's actually used in the test environment. I figured it was better to use the same version for consistency. But Travis did not yet have a base 3.7 available when it came time to add it to build matrix, so I used 3.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check my update in 6207754?
It's based on travis-ci/travis-ci#9815.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I missed the memo on this: Is the plan to retire Travis once the Azure pipelines are deemed stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check my update in 6207754?
I don't know what if any nuance there might be on this, but if it works and it's not noticeably slower then it's ok with me. Is there any benefit to making this change?
Is the plan to retire Travis once the Azure pipelines are deemed stable?
Main purpose of adding azure was that it let us remove appveyor. I want to see the azure pipelines documentation improve before making a plan to retire Travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just set up CI using Azure pipelines for Ubuntu 16.04, Windows, and macOS here. It might be nice to maintain only a single CI in pvlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -63,14 +54,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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@wholmgren One more question: There are four different |
Official minimums are in the |
@wholmgren I think I have all the build changes finished. I did have to update a test, which seemed to fail in strange ways in my Python 3.5 testing with the minimum numpy & pandas installations. The fix seems to make sense, but I'm not sure why it doesn't always fail. My next (and hopefully final) step will be to remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there.
I suggest that we keep this PR focused on CI and we remove the python 2 compatibility code in later PRs.
- pandas | ||
- pytz | ||
- coveralls | ||
- cython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cython?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
docs/environment.yml
Outdated
- pytables | ||
- pandas=0.22.0 | ||
- pytz | ||
- coveralls |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
pvlib/__init__.py
Outdated
@@ -1,3 +1,10 @@ | |||
# First ensure proper Python version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this.
There was a problem hiding this comment.
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.
setup.py
Outdated
EXTRAS_REQUIRE = { | ||
'optional': ['scipy', 'tables', 'numba', 'siphon', 'netcdf4', | ||
'ephem', 'cython', 'pvfactors'], | ||
'ephem', 'cython', 'pvfactors == 1.0.1'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not pin the dependency in our setup.py file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a minimum? It is pinned in the build environments?
setup.py
Outdated
@@ -40,13 +40,12 @@ | |||
INSTALL_REQUIRES = ['numpy >= 1.10.1', | |||
'pandas >= 0.16.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min version change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that got reverted in some of my testing.
docs/sphinx/source/installation.rst
Outdated
@@ -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. |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
Travis CI test statistics for 507428f:
|
@wholmgren Let me know if you have any other comments. Otherwise, this should be GTG if LGTM analysis passes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge tomorrow (Monday) unless there are objections.
from unittest.mock import ANY | ||
except ImportError: | ||
# python 2 | ||
from mock import ANY |
There was a problem hiding this comment.
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.
setup.py
Outdated
@@ -71,7 +67,8 @@ | |||
setuptools_kwargs = { | |||
'zip_safe': False, | |||
'scripts': [], | |||
'include_package_data': True | |||
'include_package_data': True, | |||
'python_requires': '>=3.5, <4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wholmgren I remembered that this is the more "proper" way to call this out. This way, pip install -e .
won't work if the Python version is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an even shorter syntax for this: '~=3.5'. See https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find!
No objections to merge |
Thanks @markcampanelli! |
pvlib python pull request guidelines
Thank you for your contribution to pvlib python! You may delete all of these instructions except for the list below.
You may submit a pull request with your code at any stage of completion.
The following items must be addressed before the code can be merged. Please don't hesitate to ask for help if you're unsure of how to accomplish any of the items below:
docs/sphinx/source/api.rst
for API changes.docs/sphinx/source/whatsnew
file for all changes.Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):
To ease development for the 0.7.0 release, let's drop support for Python 2 and 3.4 sooner rather than later.