From 28d5eeb941f33a213943b8d2e3e184e88312ad30 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/3] 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 5893d8bf46..e7359a965b 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -21,6 +21,8 @@ Bug fixes is scalar (:issue:`2881`, :pull:`2882`) * :py:func:`pvlib.scaling.wvm` no longer returns all NaNs when ``positions`` contains a single site (:issue:`2895`, :pull:`2896`) +* 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 efecb3cd2250628c9708e4e3b146ebd870eeb386 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/3] 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 c6baa0ec2b7ba72747ea6c9b200a39f7c46856a5 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/3] Use pandas.util.version instead of packaging in tools.py --- docs/sphinx/source/whatsnew/v0.16.2.rst | 4 ++-- pvlib/tools.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.16.2.rst b/docs/sphinx/source/whatsnew/v0.16.2.rst index e7359a965b..b69a47c514 100644 --- a/docs/sphinx/source/whatsnew/v0.16.2.rst +++ b/docs/sphinx/source/whatsnew/v0.16.2.rst @@ -21,8 +21,8 @@ Bug fixes is scalar (:issue:`2881`, :pull:`2882`) * :py:func:`pvlib.scaling.wvm` no longer returns all NaNs when ``positions`` contains a single site (:issue:`2895`, :pull:`2896`) -* 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]"]