mnba / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

run shedskin on files not in CWD (patch) #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, one has to run shedskin on a python file in the current directory.
This patch makes it so that if you run shedskin on a file in another dir, it 
will create .*pp, .so and executables in that same directory.
As is, the makefile is still created in the CWD, but this can be changed.

Original issue reported on code.google.com by bpederse on 24 Jun 2011 at 9:32

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for yet another patch! :D

unfortunately this is a bit tricky to implement well, other than to just chdir 
to the other dir. but that would also take care of the Makefile.. :-) this 
patch doesn't work for example if the module in the other dir imports another 
module in the same dir.

Original comment by mark.duf...@gmail.com on 25 Jun 2011 at 4:51

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 25 Jun 2011 at 8:12

GoogleCodeExporter commented 9 years ago
ah. I will have another look re relative/local imports.

Original comment by bpederse on 26 Jun 2011 at 1:18

GoogleCodeExporter commented 9 years ago
hmm, do you really think this would be a very useful feature though..? it's a 
bit confusing for users what should happen when they use this, and it's easy 
enough to just go to the other directory by themselves.

Original comment by mark.duf...@gmail.com on 26 Jun 2011 at 3:08

GoogleCodeExporter commented 9 years ago
are you still interested in pushing this (for 0.9, perhaps)? or can I close the 
issue..?

Original comment by mark.duf...@gmail.com on 24 Jul 2011 at 12:51

GoogleCodeExporter commented 9 years ago
I had a look briefly, but didn't understand how to make relative imports fail 
(so that I could fix them). If you think it's not a useful feature, I will not 
pursue it.

Original comment by bpederse on 26 Jul 2011 at 3:31

GoogleCodeExporter commented 9 years ago
if you make a directory called X, with two files, an empty test2.py and test.py 
containing:

import test2

then run 'shedskin X/test', it won't be able to find test2. 

but yeah, I'm not sure if this would be a very useful feature.. if you think it 
is, feel free to convince me! ;) I'm also not sure the current 'shedskin -d' 
option is very useful.. I guess since both this and -d can be achieved with a 
few simple shell commands.

Original comment by mark.duf...@gmail.com on 28 Jul 2011 at 6:30

GoogleCodeExporter commented 9 years ago
I removed the -d option just now.. :-) less is more!

Original comment by mark.duf...@gmail.com on 31 Jul 2011 at 10:22