The Eclipse PyDev plugin includes fantastic integrated autopep8
support. It formats the code to PEP8 style automatically on save, with several knobs and options to tailor it to your needs.
But the autopep8
import formatter breaks site.addsitedir()
usage.
import site
site.addsitedir('/opt/path/lib/python')
# 'ourlib' is a package in '/opt/path/lib/python', which
# without the above addsitedir() would otherwise not import.
from ourlib import do_stuff
And after PyDev's autopep8
import formatter, it changes it to:
import site
from ourlib import do_stuff
site.addsitedir('/opt/path/lib/python')
Which breaks from ourlib import do_stuff
with ImportError: No module named ourlib
.
Question:
Is there a PyDev setting or autopep8
command-line option to keep it from moving site.addsitedir()
calls?