Skip to content

Commit

Permalink
Increase python requirement to >= 3.8 (#2029)
Browse files Browse the repository at this point in the history
* require python >=3.8

* update CI configurations

* whatsnew

* remove pre-3.8 cruft

* fix h5py/numpy versioning issue for py3.8-min

* update gallery examples for newer pandas

* update asv config for python 3.8

* fix asv config syntax error

* one more asv config edit
  • Loading branch information
kandersolar authored May 3, 2024
1 parent 3230fea commit a673b85
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pytest-remote-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
strategy:
fail-fast: false # don't cancel other matrix jobs when one fails
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
suffix: [''] # the alternative to "-min"
include:
- python-version: 3.7
- python-version: 3.8
suffix: -min

runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data

- name: Upload coverage to Codecov
if: matrix.python-version == 3.7 && matrix.suffix == ''
if: matrix.python-version == 3.8 && matrix.suffix == ''
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
fail-fast: false # don't cancel other matrix jobs when one fails
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
environment-type: [conda, bare]
suffix: [''] # placeholder as an alternative to "-min"
include:
- os: ubuntu-latest
python-version: 3.7
python-version: 3.8
environment-type: conda
suffix: -min
exclude:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
- name: Upload coverage to Codecov
if: matrix.python-version == 3.7 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
if: matrix.python-version == 3.8 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@
"include": [
// minimum supported versions
{
"python": "3.7",
"python": "3.8",
"build": "",
"numpy": "1.17.5",
"pandas": "1.3.0",
"scipy": "1.6.0",
// Note: these don't have a minimum in setup.py
"h5py": "3.1.0",
"ephem": "3.7.6.0",
"numba": "0.40.0"
"ephem": "3.7.7.0", // first version to support py 3.8
"numba": "0.47.0", // first version to support py 3.8
},
// latest versions available
{
Expand Down
28 changes: 0 additions & 28 deletions ci/requirements-py3.7.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ dependencies:
- pytest-cov
- pytest-mock
- pytest-timeout
- python=3.7
- python=3.8
- pytz
- requests
- pip:
- dataclasses
- h5py==3.1.0
- h5py==2.10.0 # chosen for compatibility with numpy 1.17.3 and py3.8
- numpy==1.17.3
- pandas==1.3.0
- scipy==1.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def find_pmp(df):

results = pd.DataFrame(data)
results['pmp'] /= results['pmp'].max() # normalize power to 0-1
results_pivot = results.pivot('fd', 'fs', 'pmp')
results_pivot = results.pivot(index='fd', columns='fs', values='pmp')
plt.figure()
plt.imshow(results_pivot, origin='lower', aspect='auto')
plt.xlabel('shaded fraction')
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/solar-position/plot_sunpath_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@

tz = 'Asia/Calcutta'
lat, lon = 28.6, 77.2
times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', closed='left',
freq='H', tz=tz)
times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz)

solpos = solarposition.get_solarposition(times, lat, lon)
# remove nighttime
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/source/whatsnew/v0.10.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Documentation

Requirements
~~~~~~~~~~~~
* Python 3.8 or higher. (:issue:`1975`, :pull:`2029`)
* Minimum version of scipy advanced from 1.5.0 to 1.6.0. (:pull:`2027`)


Expand Down
6 changes: 1 addition & 5 deletions pvlib/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
try:
from importlib.metadata import PackageNotFoundError, version
except ImportError:
# for python < 3.8
from importlib_metadata import PackageNotFoundError, version
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version(__package__)
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ description = "A set of functions and classes for simulating the performance of
authors = [
{ name = "pvlib python Developers", email = "[email protected]" },
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
'numpy >= 1.17.3',
'pandas >= 1.3.0',
'pytz',
'requests',
'scipy >= 1.6.0',
'h5py',
'importlib-metadata; python_version < "3.8"',
]
license = { text = "BSD-3-Clause" }
classifiers = [
Expand Down
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.7"
python: "3.8"
jobs:
# fetch the full history so that setuptools_scm can determine the
# correct version string for long PRs with many commits
Expand Down

0 comments on commit a673b85

Please sign in to comment.