-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add 'final' and 'strip' to hooks, rework 'ensure_lab' and github on demand #11
Conversation
6826bde
to
6bb795d
Compare
6bb795d
to
dc6ea32
Compare
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 to me.
I've tested this out on dev and it all worked fine, with & without branches in the paths.
The suggestions here are just personal preference / nitpicky so up to you if you want to change anything based on them.
@@ -21,7 +21,7 @@ To signal failure, a hook should raise an ``Exception``. | |||
If a hook does not wish to modify the parameters used by future hooks or |
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.
There's a typo (not in your recent changes) just above:
modififactions -> modifications
|
||
|
||
async def github_notebook(params: Parameters) -> Parameters | None: | ||
async def github_notebook(params: Parameters) -> Parameters: |
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.
Perhaps a suggestion for when you have more development effort on this would be splitting the path processing here to its own method and writing some tests for that to make sure it can handle all unusual cases of paths
160b528
to
7644e54
Compare
prefix = "notebooks/github.com/" | ||
if path.startswith(prefix): | ||
# Needs stripping | ||
path = path[(len(prefix)) :] | ||
if path.endswith(".ipynb"): | ||
# Also needs stripping | ||
path = path[: -(len(".ipynb"))] |
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.
Wondering if this would be simpler:
path = path.removeprefix("notebooks/github.com/").removesuffix(".ipynb")
No description provided.