def setup_dir(f):
setup_dir = os.path.dirname(os.path.abspath(__file__))<EOL>def wrapped(*args, **kwargs):<EOL><INDENT>with chdir(setup_dir):<EOL><INDENT>return f(*args, **kwargs)<EOL><DEDENT><DEDENT>return wrapped<EOL>
Decorate f to run inside the directory where setup.py resides.