-
Notifications
You must be signed in to change notification settings - Fork 54
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
with old Python: instead of message informing about min required version, OCELOT drops long backtrace #234
Comments
If we don't support Python 3.6 (which I don't think we should, because it is ancient) then the solution is not to have a nice error when imported, but rather to not allow it to be installed in the first place. If somehow a user manages to install OCELOT on an ancient, unsupported version of Python (e.g. 2.7) and they have a nasty traceback, that will then be their problem. OCELOT is installed using setuptools. We just need to add the right kwarg Who wants to do it? Is it even really clear which Python versions we support exactly? @sergey-tomin is the expert here. |
I agree 100% that Python 3.6 shouldn't be supported. I never implemented such version checking in setuptools, so I wouldn't implement it. |
I agree that it is a mistake that we have no way of preventing bad/old Pythons from being used. I prefer the To be honest we should probably bin the I don't mind implementing something like this but I suppose it would be nice to understand what minor versions of Python we are actually going to support and which to bin. |
Concerning the minimum Python versions required by the different parts of OCELOT: Different parts may very well have different requirements. Probably @sergey-tomin and @sserkez know better. But what about creating the "infrastructure" for it and just block out very old stuff such as the 3.6.x versions to begin with? |
In principle yes it's a nice idea but if the users need to pull from git and reinstall ocelot to benefit from this warning that their Python version is too old, then we might as well just cut to the chase and prevent them from installing in the first place. |
We need @sergey-tomin input to proceed with this, which Python versions we say we support and which we get rid of. I am not sure if we are even testing against all versions of Python we supposedly support. |
Assuming that it is not very much work, I would propose that we already build the framework for the Python version check. Users running 3.6.x could be stopped already now because it just doesn't work for 3.6.x (actually improving the situation for them because they would see a "nice" error message instead of that backtrace). And once we know what is the oldest officially supported version we adjust the version numbers... By the way, I typically use OCELOT from a cloned directory that I keep up-to-date as needed. This enables me to quickly jump around between branches etc. So in my use case this version check would definitely be great. |
We have no hard definition of which Python OCLEOT even supports as far as I am aware, so first we would need that. Even if we did, I am opposed to this, I think it is not appropriate for OCELOT to start checking Python versions. I just checked numpy and they don't check for python version as far as I can tell. Llvmlite does the same, they do it at install time like I suggested originally.
Me too. If we have minimum version in setup.py or pyproject.toml then we are fine. Beyond that, I don't even know how one would manage to mix python versions with ocelot, unless they are abusing PYTHONPATH, which is their problem and one should generally not be doing anyway. |
Hey @sergey-tomin and @ZeugAusHH i found this: https://devguide.python.org/versions/# versions 3.6 and 3.7 are now completely unsupported by Python. We shouldn't be using them nor supporting them, if not even Python itself uses/supports them. 3.8 will be dumped October this year. Let's get with the times and embrace the future together as one strong ocelot family. |
@sergey-tomin asked me to look into this so I did. I tried installing ocelot starting with python3.6 and for each version check if ocelot imports and so on. 3.6Doesn't work. Things this version hates about ocelot:
stopped editing ocelot at this point to find the next error, it doesn't work, move on. 3.7
i deleted these lines and all tests passed 3.8Doesn't even install on my m1 macbook. I suspect this is a problem i have with my python environment though rather than an ocelot problem, but i don't care at all about fixing this to find out more. the error:
3.9imports fine. didn't run tests. assume they pass since they passed in 3.7. 3.10+Didn't check these. Python 3.12 works fine. so there you go. in any case i oppose adding code at import time to check for python 3.6, if you run python 3.6 this is a problem you have, e.g. also if you run ruby interpreter on ocelot code or if you try to compile it as c++. |
Thank you @st-walker |
bin 3.7 and 3.6. support 3.8 but in time we should bin 3.8 too. 3.9+ we carry on with.
yes it is not ocelot's job to help you if you use python 2 or something. it's not our problem. I propose we just update the README and close this issue. |
Running OCELOT with very old Python versions gives a long backtrace instead of user friendly message "OCELOT requires Python 3.x or higher".
I tested this with v3.6.8 (which dates back to 2018) and is the default on MAXWELL cluster unless you choose to activate different version by loading modules. The test was done with the current status of OCELOT master branch, 18f64f2.
Probably a test for the minimum requirement should be added to https://github.com/ocelot-collab/ocelot/blob/master/ocelot/__init__.py .
demo script
With Python v3.9.16
Now with very old Python version 3.6.8
The text was updated successfully, but these errors were encountered: