I'm looking into branching python packages in Eclipse using the Subclipse plugin. I can physically branch fine, the problem occurs when I'm using the Debug and Run feature in Eclipse. It doesn't change where the imports are coming from; take this example...
PythonProject > trunk > test > __init__.py
main.py
message.py
main.py contains:
from test.message import message
print message
message.py contains:
message = "Hello world!"
the __init__
is empty.
When branching:
PythonProject > branches > 1 > test > __init__.py
main.py
message.py
main.py contains:
from test.message import message
print message
message.py contains:
message = "Hello earth!"
But when I run debug or run from the branched main.py I get "Hello world!" printed. I need Eclipse to pick up the new PYTHONPATH. I know this can be done with a sys.path.append
/ sys.pah.insert
but I hope there's a much slicker solution.
Hope this makes sense.