I ran into the same thing yesterday with another language where the relative imports are based off the path of the file given to it.
For cases where you can give the checker import paths on the command line, I can supply some more % escapes we can use in the command line that expand to the original file path, and the original file's directory.
I was also considering an option to make the temp file in the same directory as the source file, since it has a short life. But that wouldn't be usable in all situations - some languages base an implicit module name from the filename which could occasionally get you in trouble, and I think there are some source control systems that provide virtual mounts where unexpected temp files could be a problem. But it might be worth it to provide the option. I haven't decided yet.