Handling unwanted execution artefacts + folders
I keep getting this error. Any suggestions as to what I might be doing wrong?

I'm guessing this is a jupyter-cache and/or myst-nb problem. I'll move it over to myst-nb as a starter. pinging @chrisjsewell in case he can spot-check this
I've narrowed down the issue to these two code-blocks:
```{code-cell} ipython3
%%file math2.py
pi = 'foobar'
```
```{code-cell} ipython3
import math2
```
I can't find the location of math2.py.
hey @najuzilu is this an issue with ipython magics? For these sorts of issues I typically write a very small temporary notebook in another (small testing project) with what you think is causing the issue -- it helps on two fronts:
- takes less time over building the project multiple times as you try and narrow the bug down
- helps identify the key issue and provides a minimal example.
If you're using jupyter-cache the issue might be the split in assets and artefacts @AakashGfude do notebooks execute in the same workspace as the artefacts that are generated by the notebook.
Ah you're right, I found the file in artefacts under the appropriate hashed folder.
@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
nice diagnosis @AakashGfude
Hey all - does anybody have bandwidth to tackle this one soonishfully? I think that it is reasonable to be a blocker on a "release" of Jupyter Book since many folks may have this issue, and the fix seems relatively straightforward