From 28aedc629c89a296fb206362481c9f4d573e29f9 Mon Sep 17 00:00:00 2001 From: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com> Date: Tue, 10 Nov 2026 03:22:44 +0530 Subject: [PATCH 1/6] Declare packaging as a dependency pvlib.tools imports packaging since #2924, but it was only in the test extra, so a fresh install failed on import. --- docs/sphinx/source/whatsnew/v0.16.2.rst | 2 ++ pyproject.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index fb3ff54f76..f25cd36f90 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -24,6 +24,8 @@ Bug fixes * Document the URL default :py:func:`pvlib.iotools.get_acis_station_data` actually uses. Its docstring named the GridData endpoint; should be StnData. (:pull:`2950`) +* Declare ``packaging`` as a dependency, so ``import pvlib`` works on a fresh + install. (:pull:`2941`) Enhancements ~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index de7fbb7fb8..37c06d0f41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ dependencies = [ 'scipy >= 1.9.2', 'h5py', 'tzdata', # ensure all timezones are available in all installs for consistency GH#2795 + 'packaging', ] license = "BSD-3-Clause" classifiers = [ From 79795be8a2c78ef1be76306c6652d4c98372c1e9 Mon Sep 17 00:00:00 2001 From: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com> Date: Wed, 11 Nov 2026 12:48:13 +0530 Subject: [PATCH 2/6] Drop packaging from the test extra, now that it is a dependency --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 37c06d0f41..cd3b3a8ba5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,6 @@ test = [ 'pytest-timeout', 'pytest-rerunfailures', 'pytest-remotedata', - 'packaging', ] all = ["pvlib[test,optional,doc]"] From cdc19254f32f7a09842103235b39f2d4e914871c Mon Sep 17 00:00:00 2001 From: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com> Date: Sun, 15 Nov 2026 10:24:45 +0530 Subject: [PATCH 3/6] Use pandas.util.version instead of packaging in tools.py --- docs/sphinx/source/whatsnew/v0.16.2.rst | 2 ++ pvlib/tools.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index f25cd36f90..2eaa3088f0 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -26,6 +26,8 @@ Bug fixes (:pull:`2950`) * Declare ``packaging`` as a dependency, so ``import pvlib`` works on a fresh install. (:pull:`2941`) +* ``import pvlib`` no longer fails on a fresh install without ``packaging``. + (:pull:`2941`) Enhancements ~~~~~~~~~~~~ diff --git a/pvlib/tools.py b/pvlib/tools.py index a81306b60c..016a12513f 100644 --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -9,7 +9,7 @@ import numpy as np import pandas as pd -from packaging.version import Version +from pandas.util.version import Version import zoneinfo diff --git a/pyproject.toml b/pyproject.toml index cd3b3a8ba5..de7fbb7fb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ dependencies = [ 'scipy >= 1.9.2', 'h5py', 'tzdata', # ensure all timezones are available in all installs for consistency GH#2795 - 'packaging', ] license = "BSD-3-Clause" classifiers = [ @@ -77,6 +76,7 @@ test = [ 'pytest-timeout', 'pytest-rerunfailures', 'pytest-remotedata', + 'packaging', ] all = ["pvlib[test,optional,doc]"] From 97359680490f52ae488e794a479e5a722c829e9b Mon Sep 17 00:00:00 2001 From: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com> Date: Sat, 21 Nov 2026 01:30:49 +0530 Subject: [PATCH 4/6] Revert the whatsnew entry --- docs/sphinx/source/whatsnew/v0.16.2.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index 2eaa3088f0..fb3ff54f76 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -24,10 +24,6 @@ Bug fixes * Document the URL default :py:func:`pvlib.iotools.get_acis_station_data` actually uses. Its docstring named the GridData endpoint; should be StnData. (:pull:`2950`) -* Declare ``packaging`` as a dependency, so ``import pvlib`` works on a fresh - install. (:pull:`2941`) -* ``import pvlib`` no longer fails on a fresh install without ``packaging``. - (:pull:`2941`) Enhancements ~~~~~~~~~~~~ From 9825faf13f2cffee5edb92833d61f7f64779ff1c Mon Sep 17 00:00:00 2001 From: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com> Date: Sat, 21 Nov 2026 01:34:43 +0530 Subject: [PATCH 5/6] Keep one whatsnew entry --- docs/sphinx/source/whatsnew/v0.16.2.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index fb3ff54f76..f25cd36f90 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -24,6 +24,8 @@ Bug fixes * Document the URL default :py:func:`pvlib.iotools.get_acis_station_data` actually uses. Its docstring named the GridData endpoint; should be StnData. (:pull:`2950`) +* Declare ``packaging`` as a dependency, so ``import pvlib`` works on a fresh + install. (:pull:`2941`) Enhancements ~~~~~~~~~~~~ From 39c984f8219fb80a39247746953af901b8378b09 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Sat, 21 Nov 2026 13:24:26 +0100 Subject: [PATCH 6/6] Update docs/sphinx/source/whatsnew/v0.16.2.rst --- docs/sphinx/source/whatsnew/v0.16.2.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index f25cd36f90..fb3ff54f76 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -24,8 +24,6 @@ Bug fixes * Document the URL default :py:func:`pvlib.iotools.get_acis_station_data` actually uses. Its docstring named the GridData endpoint; should be StnData. (:pull:`2950`) -* Declare ``packaging`` as a dependency, so ``import pvlib`` works on a fresh - install. (:pull:`2941`) Enhancements ~~~~~~~~~~~~