Handling unwanted artefacts + folders
@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:-

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
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?
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