diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 7376901dd6..a894db7c7d 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -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 @@ -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 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8a47d437ed..80f10f0b16 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -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: @@ -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 diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 112b2c5c63..1ca23419a9 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -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 { diff --git a/ci/requirements-py3.7.yml b/ci/requirements-py3.7.yml deleted file mode 100644 index 89999404c7..0000000000 --- a/ci/requirements-py3.7.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: test_env -channels: - - defaults - - conda-forge -dependencies: - - coveralls - - cython - - ephem - - h5py - - numba - - numpy >= 1.17.3 - - pandas >= 1.3.0 - - pip - - pytest - - pytest-cov - - pytest-mock - - requests-mock - - pytest-timeout - - pytest-rerunfailures - - conda-forge::pytest-remotedata # version in default channel is old - - python=3.7 - - pytz - - requests - - scipy >= 1.6.0 - - statsmodels - - pip: - - nrel-pysam>=2.0 - - solarfactors diff --git a/ci/requirements-py3.7-min.yml b/ci/requirements-py3.8-min.yml similarity index 81% rename from ci/requirements-py3.7-min.yml rename to ci/requirements-py3.8-min.yml index f33e3805ce..ef230b1627 100644 --- a/ci/requirements-py3.7-min.yml +++ b/ci/requirements-py3.8-min.yml @@ -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 diff --git a/docs/examples/shading/plot_partial_module_shading_simple.py b/docs/examples/shading/plot_partial_module_shading_simple.py index 8f05a80af5..ce031eff10 100644 --- a/docs/examples/shading/plot_partial_module_shading_simple.py +++ b/docs/examples/shading/plot_partial_module_shading_simple.py @@ -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') diff --git a/docs/examples/solar-position/plot_sunpath_diagrams.py b/docs/examples/solar-position/plot_sunpath_diagrams.py index 618d5f9792..3f36d643a6 100644 --- a/docs/examples/solar-position/plot_sunpath_diagrams.py +++ b/docs/examples/solar-position/plot_sunpath_diagrams.py @@ -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 diff --git a/docs/sphinx/source/whatsnew/v0.10.5.rst b/docs/sphinx/source/whatsnew/v0.10.5.rst index 0751366b59..5b23138f35 100644 --- a/docs/sphinx/source/whatsnew/v0.10.5.rst +++ b/docs/sphinx/source/whatsnew/v0.10.5.rst @@ -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`) diff --git a/pvlib/version.py b/pvlib/version.py index 781e53797c..faab5f6f75 100644 --- a/pvlib/version.py +++ b/pvlib/version.py @@ -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__) diff --git a/pyproject.toml b/pyproject.toml index a24d1ced6c..de51b7c22c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "A set of functions and classes for simulating the performance of authors = [ { name = "pvlib python Developers", email = "pvlib-admin@googlegroups.com" }, ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ 'numpy >= 1.17.3', 'pandas >= 1.3.0', @@ -17,7 +17,6 @@ dependencies = [ 'requests', 'scipy >= 1.6.0', 'h5py', - 'importlib-metadata; python_version < "3.8"', ] license = { text = "BSD-3-Clause" } classifiers = [ diff --git a/readthedocs.yml b/readthedocs.yml index a377810054..2aa95e6866 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -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