Skip to content

Commit a673b85

Browse files
authored
Increase python requirement to >= 3.8 (#2029)
* 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
1 parent 3230fea commit a673b85

File tree

11 files changed

+17
-50
lines changed

11 files changed

+17
-50
lines changed

.github/workflows/pytest-remote-data.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ jobs:
5656
strategy:
5757
fail-fast: false # don't cancel other matrix jobs when one fails
5858
matrix:
59-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
59+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
6060
suffix: [''] # the alternative to "-min"
6161
include:
62-
- python-version: 3.7
62+
- python-version: 3.8
6363
suffix: -min
6464

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

105105
- name: Upload coverage to Codecov
106-
if: matrix.python-version == 3.7 && matrix.suffix == ''
106+
if: matrix.python-version == 3.8 && matrix.suffix == ''
107107
uses: codecov/codecov-action@v4
108108
with:
109109
fail_ci_if_error: true

.github/workflows/pytest.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
fail-fast: false # don't cancel other matrix jobs when one fails
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
15+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
1616
environment-type: [conda, bare]
1717
suffix: [''] # placeholder as an alternative to "-min"
1818
include:
1919
- os: ubuntu-latest
20-
python-version: 3.7
20+
python-version: 3.8
2121
environment-type: conda
2222
suffix: -min
2323
exclude:
@@ -82,7 +82,7 @@ jobs:
8282
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
8383
8484
- name: Upload coverage to Codecov
85-
if: matrix.python-version == 3.7 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
85+
if: matrix.python-version == 3.8 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
8686
uses: codecov/codecov-action@v4
8787
with:
8888
fail_ci_if_error: true

benchmarks/asv.conf.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@
113113
"include": [
114114
// minimum supported versions
115115
{
116-
"python": "3.7",
116+
"python": "3.8",
117117
"build": "",
118118
"numpy": "1.17.5",
119119
"pandas": "1.3.0",
120120
"scipy": "1.6.0",
121121
// Note: these don't have a minimum in setup.py
122122
"h5py": "3.1.0",
123-
"ephem": "3.7.6.0",
124-
"numba": "0.40.0"
123+
"ephem": "3.7.7.0", // first version to support py 3.8
124+
"numba": "0.47.0", // first version to support py 3.8
125125
},
126126
// latest versions available
127127
{

ci/requirements-py3.7.yml

-28
This file was deleted.

ci/requirements-py3.7-min.yml renamed to ci/requirements-py3.8-min.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ dependencies:
88
- pytest-cov
99
- pytest-mock
1010
- pytest-timeout
11-
- python=3.7
11+
- python=3.8
1212
- pytz
1313
- requests
1414
- pip:
1515
- dataclasses
16-
- h5py==3.1.0
16+
- h5py==2.10.0 # chosen for compatibility with numpy 1.17.3 and py3.8
1717
- numpy==1.17.3
1818
- pandas==1.3.0
1919
- scipy==1.6.0

docs/examples/shading/plot_partial_module_shading_simple.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def find_pmp(df):
317317

318318
results = pd.DataFrame(data)
319319
results['pmp'] /= results['pmp'].max() # normalize power to 0-1
320-
results_pivot = results.pivot('fd', 'fs', 'pmp')
320+
results_pivot = results.pivot(index='fd', columns='fs', values='pmp')
321321
plt.figure()
322322
plt.imshow(results_pivot, origin='lower', aspect='auto')
323323
plt.xlabel('shaded fraction')

docs/examples/solar-position/plot_sunpath_diagrams.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@
103103

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

109108
solpos = solarposition.get_solarposition(times, lat, lon)
110109
# remove nighttime

docs/sphinx/source/whatsnew/v0.10.5.rst

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Documentation
3838

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

4344

pvlib/version.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
try:
2-
from importlib.metadata import PackageNotFoundError, version
3-
except ImportError:
4-
# for python < 3.8
5-
from importlib_metadata import PackageNotFoundError, version
1+
from importlib.metadata import PackageNotFoundError, version
62

73
try:
84
__version__ = version(__package__)

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ description = "A set of functions and classes for simulating the performance of
99
authors = [
1010
{ name = "pvlib python Developers", email = "[email protected]" },
1111
]
12-
requires-python = ">=3.7"
12+
requires-python = ">=3.8"
1313
dependencies = [
1414
'numpy >= 1.17.3',
1515
'pandas >= 1.3.0',
1616
'pytz',
1717
'requests',
1818
'scipy >= 1.6.0',
1919
'h5py',
20-
'importlib-metadata; python_version < "3.8"',
2120
]
2221
license = { text = "BSD-3-Clause" }
2322
classifiers = [

readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-20.04
1010
tools:
11-
python: "3.7"
11+
python: "3.8"
1212
jobs:
1313
# fetch the full history so that setuptools_scm can determine the
1414
# correct version string for long PRs with many commits

0 commit comments

Comments
 (0)