-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Force Python 3.11 in Makefile #132
base: main
Are you sure you want to change the base?
Conversation
@wesleybl thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
I don't think this PR will solve the issue, but will make it worse, especially if users do not have python3.11 installed. Also if a developer does not have python3 as a default by now, they got bigger problems. |
I think the developers have python 3.11 installed, or at least I think they should have lol. |
|
Here's a snippet we use toward the top of Makefiles to give a more helpful error message:
|
On the other hand, I think @stevepiercy is right that it should be possible to use the makefile commands to develop a library like this in any supported Python version. The snippet I gave above is used in the context of a project that requires one specific Python version for all developers. |
@stevepiercy @davisagli what I can do is test if Python 3.11 exists and use python3 if it doesn't. |
What I'm wanting here is to use python 3.11 as the default. It could also receive the Python version as a parameter. This way the developer would be able to use other versions. |
@stevepiercy @davisagli I changed the code to use python3.11 by default but added an option to change that version |
An option to change the Pythom version using the PYTHON_VERSION parameter in the make command was also added.
Your preference might not be mine or other developers'. You can do what you want without modifying the Makefile for everyone. You can use pyenv to install multiple versions of Python, and set $ which python3
python3: aliased to /Users/stevepiercy/.pyenv/versions/3.10.12/bin/python3 You can also edit home = /Users/stevepiercy/.pyenv/versions/3.10.12/bin
include-system-site-packages = false
version = 3.10.12 |
@stevepiercy I have no experience in changing the python3 command. I'm afraid of breaking something in the distribution. I generally use the version specific commands. But I understand your point. I want to facilitate a situation that is specific to me. What I can do is leave python3 as the default and keep the |
I break the distribution often, especially when I bump my default user Python version. I fix it by removing the virtual environment, then recreating it. I never touch my system Python. However, I cannot recommend pyenv enough. I no longer fear managing Python versions. It also helps me to completely avoid destroying my system Python. As you suggest, the default should remain |
I am with @stevepiercy. pyenv once set up, it is easy to change the default Python version.
Then you can confirm that the version changed by:
pyenv has an authomatic installer: https://github.com/pyenv/pyenv#automatic-installer No need to change the Makefile. |
Another pyenv tip, set a version of Python for a given project: pyenv local 3.10.12 See also https://github.com/pyenv/pyenv#switch-between-python-versions |
On most OS, python3 is not the latest version of Python.