-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.13 preparation #2201
Comments
@RDaxini or @IoannisSifnaios, any interest in continuous integration (CI) infrastructure management? Adding python 3.13 to the test matrix would be a good way to dip your toes into that world :) Note that we can't start testing on 3.13 just yet since some of pvlib's dependencies (e.g. h5py) haven't released wheels for it yet. So Step 0 here is just to check in on the dependencies every once in a while. Once those wheels are available, we'll modify the GitHub Actions workflow files to include 3.13. See #1886 for an example of what that looks like. |
@kandersolar Sure I am interested. I was reviewing #1886 as advised and I noticed here that although some of the dependencies were unavailable in python 3.12, e.g. numba, this does not seem to have been a problem(?) ---why not? This is not something with which I have any experience so I might just be missing/misunderstanding something obvious 😅 |
It's a good question! The reason is that some of pvlib's dependencies are required while others are merely optional. "Required" means that You can check that the dependencies omitted in #1886 are all optional dependencies as defined in Lines 13 to 20 in a14e95e
Lines 48 to 56 in a14e95e
And just to finish the story, we did add those dependencies back in once wheels became available: #1964 |
@kandersolar is there an easy way of finding which optional dependencies do not work with python 3.13? E.g., if we make a PR, would we get an error about which ones are not compatible? Or do we have to manually check each one of them to see if it is 3.13 compatible or not? |
Yes a PR would certainly tell you whether the package landscape is sufficiently progressed for us to start using it for pvlib. I suppose there is no harm in opening a PR now, with the expectation that it will remain open for some time waiting for the dependencies to become available. In fact the current roadblock may be whether python 3.13 itself is installable on the CI yet :P |
We need to bring back the discussion of solarfactors again pvlib/solarfactors#16 |
Makes sense! I guess we should at least wait for the official release (1/10/2024) |
I will ask again: Please start putting upper bounds on the Python versions supported in the
If I update the
|
A more granular way to handle this so that optional dependencies don't hold users back is:
Note that All that said, please still use UPDATED: solarfactors apparently requires Python <3.12, which I updated here. |
@markcampanelli are those all the dependencies that would need to get pinned? I understand the problem, I see how this mitigates the situation, but I think the overall best solution would be that our dependencies make sure they work for the latest pythons - or at least pin the maximum version they work with. I don't really like the idea of somebody testing periodically whether or not pvlib deps are finally compatible, and do a patch release just for that. Btw, for anyone still not aware of the Btw, at least in PySAM they are unaware of the problem - 3.13 not being tested nor an issue is opened. |
@echedey-ls See #2339 for how I would revise the current
Personally, I would ALSO put lower and upper bounds on everything the This doesn't prevent all possible ways that things can go sideways with dependencies (which I'm convinced is nearly infinite!), but usually there has to be a bug or someone else has to screw up semver for this approach to fail. Maybe all this seems pedantic and creating extra maintenance work, but I would say PLEASE resist the belief that one can predict the future with respect to dependencies. Also, this type of policy and the required maintenance will encourage a minimal dependency tree, which I view as generally a good practice that brings much developer sanity in the long run. |
This seems related to CFEP-25
|
@echedey-ls I apologize that I didn't actually answer your main question above. Yes, I think those are all the optional dependencies that would need to be limited w.r.t. the Python version. I was able to pip-install |
The problem is that current and previous versions of pvlib are in fact compatible with Python 3.13. That fact does not depend on whether PyPI makes it easy to install pvlib's (optional?) dependencies on Python 3.13. I don't think imposing a I remain of the view that the arguments in favor of upper bounds apply to applications, not libraries, and pvlib is a library. It is one piece of a puzzle. Where pvlib is being used are part of an application, the onus of ensuring a working environment for that application is on the application's developer.
The docs Installation page used to say e.g. "pvlib is compatible with python 3.5 and above", but it was a conscious decision to remove that (#1035). I think that could be reconsidered, but note that the PyPI page automatically reports the python requirements based on |
Putting my software engineer/QA hat on for a moment: The fact that pvlib’s CI does not currently run build and test on Python 3.13 on the main branch means that I (pretending, say, to be an agnostic outsider using pvlib as a library in “production”) do not trust this claim enough to use pvlib with Python 3.13 for any work that is not experimental. All I am requesting is that the upper Python bound be increased in sync with build and test being proven in CI on the main branch. I am totally ok if the optional dependencies retain (and declare, for much improved clarity) lower upper bounds as needed. |
My apologies if I am coming off as insensitive here to the additional maintenance burden of my suggestion. I think Python now releases minor bumps every six months, and major breaks in scipy, numpy, pandas, etc. are much more rare than that. So, at least every six months someone would have to run through a dependency check (presumably at the same time that they add the next Python version to the CI test matrix and possibly remove older versions). I totally appreciate that this eats up time that we’d all rather spend on, say, delivering a new algorithm. I am willing to accept that that maintenance burden is too much ATM, in which case let’s just be more explicit about this policy in the docs so users cannot say they weren’t warned. |
For once, my hesitation doesn't stem from any additional maintenance burden :P My understanding is that putting an upper bound on Python itself is not actually a solution to any problem. Regardless of whether or not it's pvlib's responsibility to provide such a bound (which is a philosophical disagreement), there is a very real-world issue here: putting an upper bound in Say that we released a v0.11.3 with
Of course this doesn't actually solve the problem at hand; arguably it just makes things worse. As far as I know, this issue makes upper bounds in I suppose the reason that you got a nice error message ( |
@kandersolar I think I see your point now, thanks. However, it sounds to me a bit like "It's been broken since the beginning, so don't fix it now." Seems like a user can stumble into untested code either way. If we were to fix this going forward, then the user would have to realize that they didn't get the latest, and perhaps do something like
at which point they would get the error if their Python were out of range. I think I still prefer this, but I'll noodle on if there is a more elegant way to move forward with the change. |
Just to be clear: my understanding is that this should say can't fix, not don't fix. |
I don't want to distract from the main point of this issue, but would it help if somehow we show in the README (by extension, in PyPI) or in trove classifiers which python versions are currently tested against? I hate proposing such an indirect mitigation, but may help at announcing the python versions pvlib and it's dependencies can run on. |
@echedey-ls One can specify the minor version of Python in the
This reminds me: I still need to add 3.13 to my test matrix, update my |
Thanks for reminding that @markcampanelli ; my point is simpler than that. If we show the currently CI tested Python versions in PyPI or in the readme with a badge similar to FastAPI's, would that make it easier for you to know when the next Python version is already tested? (Instead of you having to test locally) |
Is your feature request related to a problem? Please describe.
Final release candidate of Python 3.13 announced. Requests upstream for prep
Describe the solution you'd like
As Python 3.13 to test matrix similar to RdTools
Describe alternatives you've considered
Put upper bound on Python compatibility
Additional context
See Google group discussion on py3.13rc02.
The text was updated successfully, but these errors were encountered: