Skip to content
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

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

smarnach
Copy link
Contributor

@smarnach smarnach requested a review from a team as a code owner October 29, 2024 11:40
Copy link
Contributor

@willkg willkg left a 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``
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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

@smarnach smarnach changed the title Dependabot ignore python beyond 3.11 Prevent dependabot from proposing Python version upgrades beyond 3.11. Oct 29, 2024
@smarnach smarnach added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit a1e14a5 Oct 29, 2024
1 check passed
@smarnach smarnach deleted the dependabot-ignore-python-beyond-3.11 branch October 29, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants