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
fix: Issue #1253 (problems editing Jupyter Notebooks) #1255
Conversation
snakemake/notebook.py
Outdated
@@ -42,12 +42,12 @@ def draft(self, listen): | |||
|
|||
nb["cells"].append(nbformat.v4.new_code_cell("# start coding here")) | |||
|
|||
os.makedirs(os.path.dirname(self.local_path), exist_ok=True) | |||
os.makedirs(os.path.dirname(str(self.local_path)), exist_ok=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.
Can you use self.local_path.get_path_or_uri()
here? That is more idiomatic with the new API.
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.
And in all str() occurrences below as well.
snakemake/script.py
Outdated
@@ -393,7 +393,7 @@ def evaluate(self, edit=False): | |||
|
|||
@property | |||
def local_path(self): | |||
path = self.path[7:] | |||
path = str(self.path)#[7:] |
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.
Here, I'd rather rely on the SourceFile methods for checking whether the path is absolute or not and so on.
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.
I've quickly made the modifications myself. THanks a lot for the initial approach, it was a very helpful pointer to the source of the problem!
Kudos, SonarCloud Quality Gate passed! |
Description
Snakemake 6.10 was unable to open Jupyter Notebooks for editing as the use of LocalSourceFile objects for file paths was not supported in notebook.py or script.py (affecting Notebooks). This PR addresses that issue (logged as GH Issue #1253 )
QC
docs/
) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).