-
Notifications
You must be signed in to change notification settings - Fork 128
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
Use looseversion in place of distutils #904
base: stable/caracal
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ | |
# Charm Helpers Developers <[email protected]> | ||
|
||
import copy | ||
from distutils.version import LooseVersion | ||
try: | ||
from distutils.version import LooseVersion | ||
except ImportError: | ||
from looseversion import LooseVersion | ||
from enum import Enum | ||
from functools import wraps | ||
from collections import namedtuple, UserDict | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ Jinja2 | |
netaddr | ||
|
||
pbr!=2.1.0,>=2.0.0 # Apache-2.0 | ||
|
||
looseversion;python_version >= '3.12' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does this work when being used in a classic charm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on your comment above, it probably breaks unless the parent charm ensures that the package is installed. |
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.
shouldn't this be more like:
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.
I really don't like this pattern where charmhelpers runs
apt_install
; I'd much rather the parent charm resolved the dependencies and installed python3-looseversion where necessary; (which might be all of them in the future). It makes unit testing harder whenapt_install()
is at module load time.