-
Notifications
You must be signed in to change notification settings - Fork 223
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
Prevent dependabot from proposing Python version upgrades beyond 3.11. #6772
Conversation
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.
Looks good! Thank you for the docs!
* ``docker/set_up_legacy_es_requirements.sh`` | ||
* ``pyproject.toml`` | ||
* ``socorro/tests/processor/test_processor_app.py`` | ||
* ``webapp/crashstats/crashstats/tests/test_sentry.py`` |
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.
That's unfortunate about the last two. If we forgot to update those two tests, they would fail so we'll definitely remember as opposed to the rest of these files where there's nothing that fails causing us to remember.
We could write a ANY_ENDSWITH
that always matches if the other thing is a string and ends with some specified substring. That would let us partial match and gloss over the python 3.11 specific file path. Maybe something like this:
class ANY_ENDSWITH:
def __init__(self, endstr):
self.endstr = endstr
def __eq__(self, other):
return (
isinstance(other, str) and other.endswith(self.endstr)
or isinstance(other, ANY_ENDSWITH) and self.endstr == other.endstr
)
def __ne__(self, other):
return not self.__eq__(other)
print("/some/python3.11/path/base.py" == "/some/python3.12/path/base.py")
# False
print("/some/python3.11/path/base.py" == ANY_ENDSWITH("path/base.py"))
# True
print(ANY_ENDSWITH("path/base.py") == "/some/python3.11/path/base.py")
# True
print(["a", "b", "/some/python3.11/path/base.py"] == ["a", "b", ANY_ENDSWITH("path/base.py")])
# True
print(ANY_ENDSWITH("path/base.py") == ANY_ENDSWITH("path/base.py"))
# True
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.
Sounds reasonable. I'd personally just use ANY
, since I can't really think of a situation where a change in the abs_path
of a stack frame points to a bug in our code.
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.
Should I file a bug for this? We have a similar thing in Tecken. We could also decide it's unfortunate, but ultimately irrelevant.
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.
seems like the kind of case where we could use sys.version_info
to define the expected value
https://mozilla-hub.atlassian.net/browse/OBS-375