jupyter-cache icon indicating copy to clipboard operation
jupyter-cache copied to clipboard

Handling unwanted artefacts + folders

Open chrisjsewell opened this issue 5 years ago • 2 comments

@mmcky @najuzilu @choldgraf notebooks execute in the same workspace as the artefacts . Regarding this issue, the artefacts are not the problem, they are properly created with ipython magics and accessed. The problem is the __pycache__ folder which usually gets created with every import statement. In this case, because of the artefacts import statements, I presume..

Now, jupyter-cache specifically checks for artefacts to be a file:- image

And in this case, __pycache__ is also passed as an artefact, which breaks the system because it is a folder.

We will need to have some checks on what gets added to the array of paths passed as artefacts to jupyter-cache

Originally posted by @AakashGfude in https://github.com/ExecutableBookProject/MyST-NB/issues/122#issuecomment-608954774

chrisjsewell avatar Apr 04 '20 07:04 chrisjsewell

Perhaps the best approach here is to add a filter on paths to skip known patterns like __pycache__. Is there a configuration file available for jupyter-cache that allows for these patterns to be defined at the user level?

mmcky avatar Apr 08 '20 06:04 mmcky

I think I might have a fix for this here: https://github.com/executablebooks/jupyter-cache/pull/49 but I'm not totally sure. I don't have more time to work on it today but if anybody wants to take it over and its helpful, please do so

choldgraf avatar May 13 '20 21:05 choldgraf