Today I'm on a mission to remove little red X's from my django project in pydev. Mostly, this involves fixing import problems with pydev.
I'm using South for database migrations. South (if you don't know) generates python modules, and pydev doesn't like them. I don't want to edit the south code since it's generated.
Is there a way to instruct pydev to exclude certain packages from analysis? Something like #@UndefinedVariable
, except for the entire module? Ideally I'd like to ignore packages named "migrations".
In South, I have added a "#@PydevCodeAnalysisIgnore" to the templates in south/management/datamigration.py
and south/management/schemamigration.py
. It doesn't let me ignore entire packages, but serves my purposes well enough.
I have lots of generated code. To avoid PyDev complaints, I postprocess those modules as follows (bash script):
for file in `find gen -name '*.py'`; do
mv $file $file.bak
echo '#@PydevCodeAnalysisIgnore' > $file
cat $file.bak >> $file
rm $file.bak
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With