-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Adding a pre-commit
hook to update get_info
#55
Adding a pre-commit
hook to update get_info
#55
Conversation
Yay for getting the doc_strings to show in the NX documentation! Does it fail because it changes the files? If so, after running it once the files should be changed -- so |
the hook updates the
And running |
Yes, you have a loop:
Each makes the file init.py look different. So one of the two will not be satisfied. Looks like you could make A kind of a cheat is to have |
I added a script that would update the Also, I think if we would want to merge a non-upto-date branch(that doesn't even update any docs) in the future then we might face unnecessary merge conflicts in the PR #56 ------(rerun the update script in PR #57 )------> PR #57 ------> PR #55 |
I've been thinking more about how to make this simple -- and yet still work. That would short-cut the cycle of update_get_info -- ruff -- update_get_info... Your comment about having lots of merge conflicts is certainly true. Though there might not be as many as you think because any new functions or doc_string changes would occur in a different place in the file. So only if the changes happened to be adjacent would there be a merge conflict. I'm think I will go ahead and reopen this PR and try the changes as follows: indent = "\n" + " " * 12
out = "{"
for func, finfo in funcs.items():
out += indent + f'"{func}": {{' + indent + f' "url": "{finfo["url"]}",'
out += indent + f' "additional_docs": "{finfo["additional_docs"]}",'
out += (
indent
+ f' "additional_parameters": """{finfo["additional_parameters"]}""",'
)
out += indent + "},"
out += "\n },\n }\n"
return out And then at the end of the file, take out the close bracket, and no
|
…es] to [tool.ruff.lint] to get rid of the deprecation warning
d083d92
to
14243d1
Compare
I'm looking to review this PR about using pre-commit to update Can you describe what this PR does and how it helps update the pre-commit while avoiding the circular conflicts we were having before? |
Recently, when I was revisiting this PR, I observed that the style test was failing on Github(but passing locally) because, for some reason, the ordering of the functions in the To figure this out, I dug a layer deeper and tried to see if there was any inconsistency in the Please LMK if you have any further questions. Thank you :) |
expr.value | ||
for expr in node.value.elts | ||
if isinstance(expr, ast.Constant) |
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.
initially made this change in PR #68 (ref. https://github.com/networkx/nx-parallel/pull/68/files#r1689581947)
Added this here also because it seems more relevant to this PR as well.
@dschult Please LMK if it would be possible to get this PR also reviewed and merged before GSoC ends(on August 26th) based on your schedule, so that I can accordingly mention it in my GSoC final report. I'm open to scheduling a meeting to discuss this PR if that would help you review this better and faster. Thank you :) |
Yes -- let's get this PR finished up and merged this week. It looks like it works now (with the function names being sorted). And it appears to work on CI too. Is there more to do, or is it ready to merge as far as you are concerned? Some questions: :) |
Looks ready to me :)
I don't think I tried using |
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.
This looks ready to me! Thanks @Schefflera-Arboricola
We probably don't want the version numbers of pre-commit and ruff to be pinned, right?
And do we want to use python3
instead of python
in script.sh?
You know the answers better than I do I think for those questions.
All of this was made explicit in the process of trying to figure out what exactly was causing the inconsistency in the order of the functions in |
What does this PR currently do?
Adds a pre-commit hook that updates the dictionary returned by the
get_info
function.What this PR initially did?
Solves the issue of nx-parallel's info not appearing in the "Additional backend implementation" box(ref. ss):
WIP : running
pre-commit
updates the get_info but it also fails every time