-
Notifications
You must be signed in to change notification settings - Fork 102
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
Drop use of walrus operator #993
Conversation
The python-libjuju 2.9.46 release introduced the use of the walrus operator which is incompatible with python 3.6, more details at juju/python-libjuju#993
If this is the only breaking point for 3.6, I won't be against removing this particular use of the walrus, just to unblock you. However, it's important to note that we dropped support for python < 3.8 a long while ago, and will soon be moving to support 3.11-3.12 and 3.13. So you should expect more things to fail if you continue using python < 3.8. |
The python-libjuju 2.9.45 release introduced the use of the walrus operator which is incompatible with python 3.6, more details at juju/python-libjuju#993
juju/utils.py
Outdated
# Secondly check: $XDG_DATA_HOME for ~/.local/share | ||
elif xdg_data_home := os.environ.get('XDG_DATA_HOME'): | ||
xdg_data_home = os.environ.get('XDG_DATA_HOME') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to get this if the juju_data
is available. Please put it in the else case down below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack. Addressed by f05162e
I understand the desire (and need) to drop support for old versions of python, although this is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
/merge |
@freyes All the commits need to be signed to be able to land this, please rebase with |
since I will need to do a "push --force", do you mind if I squash those two commits into a single one?, it would make history cleaner. |
The walrus operator (`:=`) was introduced in Python 3.8, the use of it in the `2.9` branch breaks python 3.6 compatibility which is the version used in Ubuntu 18.04 (Bionic). https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since I will need to do a "push --force", do you mind if I squash those two commits into a single one?, it would make history cleaner.
I'd even prefer it that way, thanks a lot for taking care of this, this is good to go 👍
/merge |
#1023 ## What's Changed * Drop use of walrus operator by @freyes in #993 * No controller model access needed for connection with a non-admin user by @cderici in #1003 * Password resolution in connector by @cderici in #1002 * Remove dependency to juju-cli for controller_name by @cderici in #1009 #### Notes & Discussion JUJU-5413
Description
The walrus operator (
:=
) was introduced in Python 3.8, the use of it in the2.9
branch breaks python 3.6 compatibility which is the version used in Ubuntu 18.04 (Bionic).https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions
QA Steps
All CI tests need to pass.
Notes & Discussion
This regression was introduced by #975