Repository navigation
Use pandas.util.version so import pvlib works without packaging - #2941
Conversation
Hey @jayhemnani9910! 🎉Thanks for opening your first pull request! We appreciate your If AI is used for any portion of this PR, you must vet the content Finally, be sure the PR description includes the PR |
c962c78 to
28d5eeb
Compare
|
@echedey-ls should |
echedey-ls
left a comment
There was a problem hiding this comment.
Yeah, I oversaw where was packaging declared as a dependency.
| 'pytest-timeout', | ||
| 'pytest-rerunfailures', | ||
| 'pytest-remotedata', | ||
| 'packaging', |
|
This is to support the |
|
|
Yes.
I don't have much time to invest now on new changes like that. Maybe we should first analyze what handful of functions do so, how similar each one of them is to
I rather have a concise list of the reasons. I presume |
|
Since |
|
Maybe we can consider using |
|
So the options are:
Either is a one-line change. Tell me which one you prefer and I'll update the PR. |
|
Please switch the import to |
|
Switched in c6baa0e. |
|
My concern was the way we're papering over the pandas API change to a function that has in fact been problematic over the history of pvlib. I'm not opposed to the new packaging dependency. I'll look into it more. In the meantime might as well go ahead with this and get main working again. |
pvlib.tools imports packaging since pvlib#2924, but it was only in the test extra, so a fresh install failed on import.
c6baa0e to
cdc1925
Compare
|
Rebased on main (cdc1925), no conflicts left. |
testextra, which providespackaging)Since #2924,
pvlib/tools.pyimportspackaging.version, butpackagingis only in thetestextra. On a fresh install of main,import pvlibfails withModuleNotFoundError: No module named 'packaging'. 0.16.1 isn't affected, so this would ship in the next release.pvlib/tools.pynow importsVersionfrompandas.util.version, which every supported pandas has (it shipped in 1.3.0), sopackagingstays a test-only dependency. In a fresh venv on Python 3.13 with pandas 3.1.1 and nopackaginginstalled,import pvlib, a clear sky calculation and theinfer_freqhelper work.tests/test_tools.pypasses.