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

Updated puzzle debug regex to handle missing version info #3731

Closed

Conversation

joshuakraitberg
Copy link

@joshuakraitberg joshuakraitberg commented Feb 25, 2021

Pull Request Check List

Resolves: #3729
Related: #3724, #3739

  • Added tests for changed code.
  • Updated documentation for changed code.

@@ -710,7 +710,7 @@ def debug(self, message: str, depth: int = 0) -> None:

if message.startswith("fact:"):
if "depends on" in message:
m = re.match(r"fact: (.+?) depends on (.+?) \((.+?)\)", message)
m = re.match(r"fact: (.+?) depends on ((.+?)($| \((.+?)\)))", message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we reference m.group(2) and m.group(3), this require more changes.

Suggested change
m = re.match(r"fact: (.+?) depends on ((.+?)($| \((.+?)\)))", message)
m = re.match(r"fact: (.+?) depends on (?:(.+?)($| \((.+?)\)))", message)

And we need to change the way we format the message in case m.group(3) is empty.

Copy link
Author

@joshuakraitberg joshuakraitberg Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the regex as I made it m.group(2) == m.group(3), but only for the special case below, regularly group 2 and 3 will be identical to before.

So message == "fact: xxx (==1.7.0) depends on cryptography", group 2 and 3 would be cryptography.

I have changed to match your request, if group 3 is None I put a *. Not sure what you'd like to see here.

I think having group 2 and 3 be equal in this case might be the most logical solution for what the debug log prints.

@Secrus
Copy link
Member

Secrus commented Apr 17, 2023

See the linked issue for closing reasons.

@Secrus Secrus closed this Apr 17, 2023
Copy link

github-actions bot commented Mar 3, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poetry "depends on" debug regex fails to match if dependancy has missing version info
3 participants