I decided to reorganize
http://stromberg.dnsalias.org/~dstromberg/backshift/into a "package"
(into a directory with an __init__.py), but started
encountering pylint errors afterward that I'm not sure what to do with.
The errors I'm getting are, for example:
************* Module backshift.backshift_file_mod
E: 24: No name 'python2x3' in module 'backshift'
E: 25: No name 'metadata_mod' in module 'backshift'
E: 26: No name 'constants_mod' in module 'backshift'
************* Module backshift.base255
E: 24: No name 'python2x3' in module 'backshift'
But python2x3 definitely does exist in the backshift package:
$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import backshift.python2x3
>>>
...and I'm adding "." to my sys.path for pylint:
output=$(set -eu; "$pylint" \
'--init-hook'='import sys; sys.path.append(".")' \
'--max-line-length'=133 \
'--indent-string'="\\t" \
'--module-rgx'='[A-Za-z_][-a-zA-Z0-9_]+$' \
'--class-rgx'='[A-Za-z_][-a-zA-Z0-9_]+$' \
"$@" 2>&1 || true)
A quick google on the topic didn't turn up much, though maybe I wasn't using
ideal search terms.
Does pylint support linting packages with absolute imports? Do I need to
change how my modules and/or code are arranged to better take advantage of
pylint?
Thanks!
PS: I -love- pylint. it's hard to imagine writing a serious program in
Python without it now.
--
Dan Stromberg
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects