-
Notifications
You must be signed in to change notification settings - Fork 0
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
Hardcode python3 version for compat == 5? #217
Comments
I think we have to define hardcoded versions for another |
I think it is safe to run python3.4 code with python3.6, but not vice versa. The problem is that we do not run python3.6 in production, but we can create virtualenvironment in development if python3 points to python3.6. |
No, please don't do this. Python 3 is python 3. You don't need to differentiate between minor versions. |
Why not? Does it mean that we never use new features from newer python3.* minor releases? In my case, I think that it is not a big problem. But it is a thing that might be easily improved and may prevent some mistakes in the future. Or maybe I'm missing something and there is a much bigger cost to incorporate such change. There is already the case when different minor versions have small incompatibilities. |
No. We are using the Ubuntu system python. So on 16.04, that's 3.5, and on 18.04, that will be 3.6. Personally, I wouldn't use 3.6's new features yet, for maximum flexibility. But you can if you need to.
This is getting to the philosophy of how we deploy applications at Yola. We give applications virtualenvs, where they get to control the python libraries they are deployed with, but we aren't containerising everything, and the application does not get to select specific versions of other parts of the system (like the Python interpreter). So, there is no "correct version" to use in development. Rather we aim to have our services run across the entire range of currently supported Ubuntu LTS versions. This is usually trivial for older applications, but requires us to hold back a little from using the latest language features. In the context of the work you're doing, it isn't going to need to work on older Ubuntu versions. You don't have to have Python 3.2 support, for example, that'd be crazy. I agree that it isn't ideal that applications don't get to declare the python versions they're supporting somewhere. But the solution you're proposing is to tie us to a specific version, making it far harder to migrate to future versions. There were unrelated reasons why we cared about minor versions of python under python 2. They made it incredibly hard for us to migrate off Ubuntu 12.04 (we were stuck on it for a lot longer than I'd have liked) and I don't want to repeat that. |
No, it is not. Minor versions have deprecations. You officially need to port your code to be compatible with the Python 3.6.
Literally on my first day in Yola I've stumbled into a bug that was caused by using latest Python instead of 3.5(some methods started to expect a path instead of a string). We had similar issues once or twice since then. Moreover, recently we trapped into a bug that was fixed in patch version of 3.5, but still not present in Ubuntu's repositories. We don't need to agree which version to use(it is 3.5.2 in the previous LTS, I think?). But enforcing that restriction for build-virtualenv would make my life a little bit better. |
New Django requires 3.6. Can we prioritize switching everything to >= 18.04? |
I've noticed that we dynamically determine python3 version when virtualenv is being created (reference).
In newer versions of Ubuntu python3.6 is the default and environment with incompatible interpreter can be created.
What do you think about hardcoding python3 version and display error message when there is no interpreter with required version on developer's machine?
@yola/service-engineering @yola/operations-engineering
The text was updated successfully, but these errors were encountered: