From mhamilt at sandia.gov Thu Aug 7 20:57:22 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Thu, 7 Aug 2014 12:57:22 -0600 Subject: [code-quality] How does pylint find files to process Message-ID: <53E3CC12.6050006@sandia.gov> Hi, I'm having trouble figuring out how pylint finds python files to process. If I find() all the .py files in my project and pass them on the command line pylint processes them correctly (after I set up PYTHONPATH, of course.) However, if I just pass my project directory to pylint it fails with: F: 1, 0: error while code parsing: Unable to load file '.../__init__.py' ([Errno 2] No such file or directory: '.../__init__.py') (parse-error) If I create an empty __init__.py file it works, but only finds and processes some of the files. This seems to imply that I need to created __init__.py files in my entire tree. Is that the case? -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories From bcannon at gmail.com Fri Aug 8 20:01:18 2014 From: bcannon at gmail.com (Brett Cannon) Date: Fri, 08 Aug 2014 18:01:18 +0000 Subject: [code-quality] Custom pylint checkers for Python 2/3 compatibility References: Message-ID: I've started work on a pull request to add my Python 3 checkers into Pylint: https://bitbucket.org/brettsky/pylint . The work isn't quite done, but I have run into one issue where one of my checker is causing various regression tests to fail across the board due to strings not being specified as either unicode or bytes. Is there an easy way to make a checker opt-in instead of opt-out by default? Or should I go through and fix all the strings in Pylint (probably through `from __future__ import unicode`)? On Sat Jul 26 2014 at 10:58:57 AM Brett Cannon wrote: > Sure. I will try to make time next week to make a pull request against > Pylint with a checkers/python3.py or something. > > On Fri Jul 25 2014 at 6:14:21 PM Claudiu Popa > wrote: > >> Hello Brett. >> >> At a quick glance, the patch looks really good, even with the scarce >> documentation that we have. :-) >> Maybe you can turn this into a pull request for Pylint, so that we may >> have in the near future a mode that only checks Python 2/3 >> compatibility? That way would be easier for review, too. >> >> Thank you. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bcannon at gmail.com Fri Aug 8 20:09:50 2014 From: bcannon at gmail.com (Brett Cannon) Date: Fri, 08 Aug 2014 18:09:50 +0000 Subject: [code-quality] Custom pylint checkers for Python 2/3 compatibility References: Message-ID: On Fri Aug 08 2014 at 2:01:18 PM Brett Cannon wrote: > I've started work on a pull request to add my Python 3 checkers into > Pylint: https://bitbucket.org/brettsky/pylint . The work isn't quite > done, but I have run into one issue where one of my checker is causing > various regression tests to fail across the board due to strings not being > specified as either unicode or bytes. Is there an easy way to make a > checker opt-in instead of opt-out by default? Or should I go through and > fix all the strings in Pylint (probably through `from __future__ import > unicode`)? > I just realized I should have checked setup.py to see if 2to3 was being used, which it is. =) So it seems that I will have to port Pylint over to a Python 2/3 source-compatible code base in order to pass any checks with my set of checkers against Pylint itself. Is that okay? And if so what Python version support is required (Tox file suggests 2.7, 3.2-3.4)? > > On Sat Jul 26 2014 at 10:58:57 AM Brett Cannon wrote: > >> Sure. I will try to make time next week to make a pull request against >> Pylint with a checkers/python3.py or something. >> >> On Fri Jul 25 2014 at 6:14:21 PM Claudiu Popa >> wrote: >> >>> Hello Brett. >>> >>> At a quick glance, the patch looks really good, even with the scarce >>> documentation that we have. :-) >>> Maybe you can turn this into a pull request for Pylint, so that we may >>> have in the near future a mode that only checks Python 2/3 >>> compatibility? That way would be easier for review, too. >>> >>> Thank you. >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From pcmanticore at gmail.com Fri Aug 8 20:59:04 2014 From: pcmanticore at gmail.com (Claudiu Popa) Date: Fri, 8 Aug 2014 21:59:04 +0300 Subject: [code-quality] Custom pylint checkers for Python 2/3 compatibility In-Reply-To: References: Message-ID: On Fri, Aug 8, 2014 at 9:09 PM, Brett Cannon wrote: > > I just realized I should have checked setup.py to see if 2to3 was being > used, which it is. =) So it seems that I will have to port Pylint over to a > Python 2/3 source-compatible code base in order to pass any checks with my > set of checkers against Pylint itself. Is that okay? And if so what Python > version support is required (Tox file suggests 2.7, 3.2-3.4)? > Right now, Pylint 1.3 is the last version which supports 2.5 and 2.6 and starting with Pylint 1.4, which will be released really soon, it will support only 2.7-3.4. So having a Python 2/3 source-compatible base is the way to go for the near future. I believe we'll drop 2to3 as well. A pull request for this will be appreciated. :-) From bcannon at gmail.com Fri Aug 8 21:20:46 2014 From: bcannon at gmail.com (Brett Cannon) Date: Fri, 08 Aug 2014 19:20:46 +0000 Subject: [code-quality] Custom pylint checkers for Python 2/3 compatibility References: Message-ID: On Fri Aug 08 2014 at 2:59:04 PM Claudiu Popa wrote: > On Fri, Aug 8, 2014 at 9:09 PM, Brett Cannon wrote: > > > > I just realized I should have checked setup.py to see if 2to3 was being > > used, which it is. =) So it seems that I will have to port Pylint over > to a > > Python 2/3 source-compatible code base in order to pass any checks with > my > > set of checkers against Pylint itself. Is that okay? And if so what > Python > > version support is required (Tox file suggests 2.7, 3.2-3.4)? > > > > > Right now, Pylint 1.3 is the last version which supports 2.5 and 2.6 > and starting with Pylint 1.4, which will be released really soon, it > will support only 2.7-3.4. So having a Python 2/3 source-compatible > base is the way to go for the near future. I believe we'll drop 2to3 > as well. A pull request for this will be appreciated. :-) > Any issue if I just make it part of my Python 3 checker pull request? It's obviously easier when I have my own checkers to make sure I'm not screwing it up. =) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pcmanticore at gmail.com Fri Aug 8 21:27:47 2014 From: pcmanticore at gmail.com (Claudiu Popa) Date: Fri, 8 Aug 2014 22:27:47 +0300 Subject: [code-quality] Custom pylint checkers for Python 2/3 compatibility In-Reply-To: References: Message-ID: On Fri, Aug 8, 2014 at 10:20 PM, Brett Cannon wrote: > > Any issue if I just make it part of my Python 3 checker pull request? It's > obviously easier when I have my own checkers to make sure I'm not screwing > it up. =) Nope, it's fine with me if it'll be in your Python 3 checker pull request. From mhamilt at sandia.gov Fri Aug 8 22:20:37 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Fri, 8 Aug 2014 14:20:37 -0600 Subject: [code-quality] [EXTERNAL] Re: How does pylint find files to process In-Reply-To: References: <53E3CC12.6050006@sandia.gov> Message-ID: <53E53115.3080306@sandia.gov> On 08/08/14 13:15, Claudiu Popa wrote: > On Thu, Aug 7, 2014 at 9:57 PM, Mark E. Hamilton wrote: >> Hi, >> >> I'm having trouble figuring out how pylint finds python files to process. If >> I find() all the .py files in my project and pass them on the command line >> pylint processes them correctly (after I set up PYTHONPATH, of course.) >> >> However, if I just pass my project directory to pylint it fails with: >> >> F: 1, 0: error while code parsing: Unable to load file '.../__init__.py' >> ([Errno 2] No such file or directory: '.../__init__.py') (parse-error) >> >> If I create an empty __init__.py file it works, but only finds and processes >> some of the files. This seems to imply that I need to created __init__.py >> files in my entire tree. Is that the case? >> > > > Yes, that's the case, you need __init__.py files in order to tell > pylint that those are packages. Pylint doesn't support (yet) Python > 3's implicit namespace packages (PEP 420). > FWIW, we're using these versions: ceerws3111a 1123% pylint --version No config file found, using default configuration pylint 1.2.1, astroid 1.1.1, common 0.61.0 Python 2.7.4 (default, Aug 26 2013, 10:48:13) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] IAE, perhaps this is just a misunderstanding we have about python. All of our python scripts work, and we've never had __init__.py files in every subdirectory. What you say would imply that even directories which contain no python files have to have a __init__.py file. For instance, if I have this: % find . . ./test_dir1 ./test_dir1/subdir1 ./test_dir1/subdir1/test1.py it seems that I would have to create __init__.py files in '.', test_dir1, and subdir1, even though '.' and test_dir1 don't contain any python files. However, to test this I ran pylint this way: pylint ${PWD} I get the 'Unable to load' error I reported above. This touch __init__.py pylint ${PWD} only processes the __init__.py file, as expected from what you said, and reports a missing-dosctring. However, when I do this pylint throws traceback. touch test_dir1/__init__.py pylint ${PWD} No config file found, using default configuration Traceback (most recent call last): File "/projects/sierra/linux_rh6/install/Python/2.7/bin/pylint", line 9, in load_entry_point('pylint==1.2.1', 'console_scripts', 'pylint')() File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/__init__.py", line 21, in run_pylint Run(sys.argv[1:]) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/lint.py", line 1051, in __init__ linter.check(args) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/lint.py", line 608, in check for descr in self.expand_files(files_or_modules): File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/lint.py", line 638, in expand_files result, errors = expand_modules(modules, self.config.black_list) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/utils.py", line 648, in expand_modules submodname = '.'.join(modpath_from_file(subfilepath)) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 250, in modpath_from_file filename, ', \n'.join(sys.path))) ImportError: Unable to find module for /ascldap/users/mhamilt/project/test_dir1/__init__.py in /home/mhamilt, /projects/sierra/linux_rh6/install/Python/2.7.4/bin, ... Creating __init__.py in subdir1 doesn't resolve this traceback, nor does creating a python file in test_dir1. However, setting PYTHONPATH to this export PYTHONPATH=${PWD}/test_dir1 pylint ${PWD} does resolve the traceback, and pylint processes the two __init__.py files. Finally, doing this touch test_dir1/subdir1/__init__.py % find . . ./test_dir1 ./test_dir1/__init__.py ./test_dir1/subdir1 ./test_dir1/subdir1/test1.py ./test_dir1/subdir1/__init__.py ./test_dir2 ./test_dir2/subdir2 ./test_dir2/subdir2/test2.py ./__init__.py pylint ${PWD} works, processes all three __init__.py files and the test1.py file. If I unset PYTHONPATH the traceback returns. I don't understand: 1. Why pylint is throwing a traceback 2. Why setting PYTHONPATH to the directory in the middle is necessary. 3. Why creating all those __init__files is necessary. -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories 505-844-7666 From mhamilt at sandia.gov Fri Aug 8 22:31:36 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Fri, 8 Aug 2014 14:31:36 -0600 Subject: [code-quality] Pylint not reporting modules passed on command line Message-ID: <53E533A8.1000108@sandia.gov> Hi, again, I've got a test structure that looks like this: % find . . ./test_dir1 ./test_dir1/subdir1 ./test_dir1/subdir1/test1.py ./test_dir2 ./test_dir2/subdir2 ./test_dir2/subdir2/test2.py If I pass both .py files to pylint on the command line it processes both, but only reports one of them in the 'by module' section. % pylint test_dir1/subdir1/test1.py test_dir2/subdir2/test2.py No config file found, using default configuration ************* Module test1 C: 5, 0: Line too long (87/80) (line-too-long) ... ************* Module test2 C: 1, 0: Missing module docstring (missing-docstring) ... % errors / warnings by module ----------------------------- +-------+------+--------+---------+-----------+ |module |error |warning |refactor |convention | +=======+======+========+=========+===========+ |test2 |0.00 |100.00 |100.00 |60.00 | +-------+------+--------+---------+-----------+ ... Statistics by type ------------------ +---------+-------+-----------+-----------+------------+---------+ |type |number |old number |difference |%documented |%badname | +=========+=======+===========+===========+============+=========+ |module |2 |2 |= |0.00 |0.00 | +---------+-------+-----------+-----------+------------+---------+ ... It's always the same file (test2.py) which gets reported, even if I change the order of the files on the command line. The same thing occurs if I pass --output-format=text or --output-format=html; both the pylint_global.txt and pylint_global.html files are missing the test1.py module from the 'errors/warnings by module' section. Is this a bug, or just something I'm doing wrong or misunderstanding? -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories 505-844-7666 From mhamilt at sandia.gov Fri Aug 8 22:47:01 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Fri, 8 Aug 2014 14:47:01 -0600 Subject: [code-quality] Pylint output inconsistent Message-ID: <53E53745.80503@sandia.gov> Hi, Why does the 'Statistics by type' move around when I run pylint multiple times? Sometimes it is reported between 'Raw Metrics' and 'Duplication', other times it comes before 'Raw Metrics', and sometimes it comes after the 'Report' section. I can run it four times and get four different orders, without changing anything. -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories 505-844-7666 From pcmanticore at gmail.com Mon Aug 18 17:06:19 2014 From: pcmanticore at gmail.com (Claudiu Popa) Date: Mon, 18 Aug 2014 18:06:19 +0300 Subject: [code-quality] Pylint output inconsistent In-Reply-To: <53E53745.80503@sandia.gov> References: <53E53745.80503@sandia.gov> Message-ID: On Fri, Aug 8, 2014 at 11:47 PM, Mark E. Hamilton wrote: > Hi, > > Why does the 'Statistics by type' move around when I run pylint multiple > times? Sometimes it is reported between 'Raw Metrics' and 'Duplication', > other times it comes before 'Raw Metrics', and sometimes it comes after the > 'Report' section. I can run it four times and get four different orders, > without changing anything. It should be sorted now, using the version from the repository. From mhamilt at sandia.gov Tue Aug 19 18:10:23 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Tue, 19 Aug 2014 10:10:23 -0600 Subject: [code-quality] pylint traceback AttributeError: 'NoneType' object has no attribute 'scope' Message-ID: <53F376EF.2010308@sandia.gov> With this test script: % cat test_util.py #!/usr/bin/env python """Some docstring""" import sys if __name__ == '__main__': """Another docstring.""" pass pylint throws this traceback: % pylint --rcfile=/dev/null test_util.py Traceback (most recent call last): File "/projects/sierra/linux_rh6/install/Python/2.7/bin/pylint", line 9, in load_entry_point('pylint==1.3.0', 'console_scripts', 'pylint')() File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/__init__.py", line 21, in run_pylint Run(sys.argv[1:]) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 991, in __init__ linter.check(args) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 585, in check self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", line 662, in check_astroid_module walker.walk(astroid) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 804, in walk self.walk(child) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 804, in walk self.walk(child) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", line 801, in walk cb(astroid) File "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/base.py", line 558, in visit_discard if (sibling.scope() is scope and AttributeError: 'NoneType' object has no attribute 'scope' Removing the second docstring (see below) resolves this error: % cat test_util.py #!/usr/bin/env python """Some docstring""" import sys if __name__ == '__main__': # """Another docstring.""" pass -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories 505-844-7666 From pcmanticore at gmail.com Tue Aug 19 19:47:12 2014 From: pcmanticore at gmail.com (Claudiu Popa) Date: Tue, 19 Aug 2014 20:47:12 +0300 Subject: [code-quality] pylint traceback AttributeError: 'NoneType' object has no attribute 'scope' In-Reply-To: <53F376EF.2010308@sandia.gov> References: <53F376EF.2010308@sandia.gov> Message-ID: On Tue, Aug 19, 2014 at 7:10 PM, Mark E. Hamilton wrote: > With this test script: > > % cat test_util.py > #!/usr/bin/env python > """Some docstring""" > import sys > if __name__ == '__main__': > """Another docstring.""" > pass > > pylint throws this traceback: > > > % pylint --rcfile=/dev/null test_util.py > Traceback (most recent call last): > File "/projects/sierra/linux_rh6/install/Python/2.7/bin/pylint", line 9, > in > load_entry_point('pylint==1.3.0', 'console_scripts', 'pylint')() > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/__init__.py", > line 21, in run_pylint > Run(sys.argv[1:]) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", > line 991, in __init__ > linter.check(args) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", > line 585, in check > self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/lint.py", > line 662, in check_astroid_module > walker.walk(astroid) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", > line 804, in walk > self.walk(child) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", > line 804, in walk > self.walk(child) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/utils.py", > line 801, in walk > cb(astroid) > File > "/projects/sierra/linux_rh6/install/Python/2.7/lib/python2.7/site-packages/pylint-1.3.0-py2.7.egg/pylint/checkers/base.py", > line 558, in visit_discard > if (sibling.scope() is scope and > AttributeError: 'NoneType' object has no attribute 'scope' > > > Removing the second docstring (see below) resolves this error: > > % cat test_util.py > #!/usr/bin/env python > """Some docstring""" > import sys > if __name__ == '__main__': > # """Another docstring.""" > pass > Hi, Mark. Which version of astroid? I'm unable to replicate this using the latest. Also, for these type of crashes, it's best to report them on our bug tracker. Thanks. From mhamilt at sandia.gov Tue Aug 19 21:20:53 2014 From: mhamilt at sandia.gov (Mark E. Hamilton) Date: Tue, 19 Aug 2014 13:20:53 -0600 Subject: [code-quality] [EXTERNAL] Re: pylint traceback AttributeError: 'NoneType' object has no attribute 'scope' In-Reply-To: References: <53F376EF.2010308@sandia.gov> Message-ID: <53F3A395.50405@sandia.gov> Claudiu, On 08/19/14 11:47, Claudiu Popa wrote: > Hi, Mark. > > Which version of astroid? I'm unable to replicate this using the > latest. Also, for these type of crashes, it's best to report them on > our bug tracker. > Thanks. Sorry, I should have included that information: % pylint --rcfile=/dev/null --version pylint 1.3.0, astroid 1.2.0, common 0.61.0 Python 2.7.4 (default, Aug 26 2013, 10:48:13) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] I will be happy to report it to the bug tracker; I just wasn't sure if a user could do so. -- ---------------- Mark E. Hamilton Engineering Sciences Center Senior Member of Technical Staff Sandia National Laboratories 505-844-7666 From pcmanticore at gmail.com Sun Aug 24 21:49:10 2014 From: pcmanticore at gmail.com (Claudiu Popa) Date: Sun, 24 Aug 2014 22:49:10 +0300 Subject: [code-quality] [ANN] Pylint 1.3.1 / Astroid 1.2.1 released Message-ID: Hello! I'm happy to announce that Pylint 1.3.1 and Astroid 1.2.1 were released. These releases include some bugfixes with the new string formatting checker and a couple of crash fixes. Please note that Pylint 1.3.X is the last version of Pylint which supports Python 2.5 and 2.6. Enjoy! From francois.magimel at etu.enseeiht.fr Sun Aug 24 22:07:45 2014 From: francois.magimel at etu.enseeiht.fr (=?UTF-8?B?RnJhbsOnb2lzIE1hZ2ltZWw=?=) Date: Sun, 24 Aug 2014 22:07:45 +0200 Subject: [code-quality] How and where to add tests for Python 3 Message-ID: <53FA4611.9070605@etu.enseeiht.fr> Hello! I'm new in this mailing, so I will introduce myself first. I'm Fran?ois (alias Linkid), a French engineering student who code mainly in Python. I'm involved in some open source projects and some of them like Django or OpenStack. I would like to add a test for Python 3 to check an import, but I don't really know on which project (pep8, pyflakes, ?) to do that and how to do it (by a push request on github or somewhere else, by a bug report, ?). I searched some clue and I think my test should be used by pyflakes, but I'm not sure? So, here are my questions: - on which project should I add a Python 3 import test ? - how I should process ? I think it could help be a lot if someone explain me what one project really check, if it is possible. Thank you. Fran?ois Magimel (Linkid) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From graffatcolmingov at gmail.com Mon Aug 25 02:24:39 2014 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Sun, 24 Aug 2014 19:24:39 -0500 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: <53FA4611.9070605@etu.enseeiht.fr> References: <53FA4611.9070605@etu.enseeiht.fr> Message-ID: On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel wrote: > Hello! > > I'm new in this mailing, so I will introduce myself first. I'm Fran?ois > (alias Linkid), a French engineering student who code mainly in Python. > I'm involved in some open source projects and some of them like Django > or OpenStack. > > I would like to add a test for Python 3 to check an import, but I don't > really know on which project (pep8, pyflakes, ?) to do that and how to > do it (by a push request on github or somewhere else, by a bug report, > ?). I searched some clue and I think my test should be used by pyflakes, > but I'm not sure? So, here are my questions: > - on which project should I add a Python 3 import test ? > - how I should process ? > > I think it could help be a lot if someone explain me what one project > really check, if it is possible. > > Thank you. > > Fran?ois Magimel (Linkid) Hello Fran?ois, I'm not quite sure anyone on this list can answer your question. You haven't given us any guidance about what the check is that you would like to add. Do you want to check for imports that are not used in Python 3? Are you looking for imports that would fail on Python 3 instead? Are you looking to ensure some style of imports? Perhaps you're looking to do what openstack/hacking already does (ensure only modules are imported)? There are too many possibilities for us to be helpful. Further, unless what you wish to add is part of http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you that it does *not* belong in pep8. If you can give us more details I can also tell you whether it belongs in PyFlakes. If it turns out it does not belong in PyFlakes, you can always write and release your own plugin for Flake8. Sorry I cannot be more helpful, Ian From francois.magimel at etu.enseeiht.fr Mon Aug 25 10:36:27 2014 From: francois.magimel at etu.enseeiht.fr (=?UTF-8?B?RnJhbsOnb2lzIE1hZ2ltZWw=?=) Date: Mon, 25 Aug 2014 10:36:27 +0200 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: References: <53FA4611.9070605@etu.enseeiht.fr> Message-ID: <53FAF58B.8070903@etu.enseeiht.fr> Le 25/08/2014 02:24, Ian Cordasco a ?crit : > On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel > wrote: >> Hello! >> >> I'm new in this mailing, so I will introduce myself first. I'm Fran?ois >> (alias Linkid), a French engineering student who code mainly in Python. >> I'm involved in some open source projects and some of them like Django >> or OpenStack. >> >> I would like to add a test for Python 3 to check an import, but I don't >> really know on which project (pep8, pyflakes, ?) to do that and how to >> do it (by a push request on github or somewhere else, by a bug report, >> ?). I searched some clue and I think my test should be used by pyflakes, >> but I'm not sure? So, here are my questions: >> - on which project should I add a Python 3 import test ? >> - how I should process ? >> >> I think it could help be a lot if someone explain me what one project >> really check, if it is possible. >> >> Thank you. >> >> Fran?ois Magimel (Linkid) > Hello Fran?ois, > > I'm not quite sure anyone on this list can answer your question. You > haven't given us any guidance about what the check is that you would > like to add. Do you want to check for imports that are not used in > Python 3? Are you looking for imports that would fail on Python 3 > instead? Are you looking to ensure some style of imports? Perhaps > you're looking to do what openstack/hacking already does (ensure only > modules are imported)? There are too many possibilities for us to be > helpful. > > Further, unless what you wish to add is part of > http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you > that it does *not* belong in pep8. If you can give us more details I > can also tell you whether it belongs in PyFlakes. If it turns out it > does not belong in PyFlakes, you can always write and release your own > plugin for Flake8. > > Sorry I cannot be more helpful, > Ian Hello, Oh, yes, it will be better if I give some details. My code didn't pass my python 3 tests due to an import of string. As a matter of fact, I was using string.letters which is not in python 3 anymore. However, when I tested my code with flake8, I wasn't warned about it. So, I would like to add this warning (maybe to PyFlakes, but I'm not sure). And I think it is not only an OpenStack issue because it concerns every projects. So, if someone can help me to add it (to PyFlakes?) by giving me the process (PR on GitHub?), I will be very happy to contribute :). Thank you for your answer, Ian. Fran?ois -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From sylvain.thenault at logilab.fr Mon Aug 25 14:01:02 2014 From: sylvain.thenault at logilab.fr (Sylvain =?utf-8?B?VGjDqW5hdWx0?=) Date: Mon, 25 Aug 2014 14:01:02 +0200 Subject: [code-quality] Pylint not reporting modules passed on command line In-Reply-To: <53E533A8.1000108@sandia.gov> References: <53E533A8.1000108@sandia.gov> Message-ID: <20140825120102.GB4864@logilab.fr> On 08 ao?t 14:31, Mark E. Hamilton wrote: > Hi, again, Hi Mark, > I've got a test structure that looks like this: > > % find . > . > ./test_dir1 > ./test_dir1/subdir1 > ./test_dir1/subdir1/test1.py > ./test_dir2 > ./test_dir2/subdir2 > ./test_dir2/subdir2/test2.py > > If I pass both .py files to pylint on the command line it processes > both, but only reports one of them in the 'by module' section. > > % pylint test_dir1/subdir1/test1.py test_dir2/subdir2/test2.py > No config file found, using default configuration > ************* Module test1 > C: 5, 0: Line too long (87/80) (line-too-long) > ... > ************* Module test2 > C: 1, 0: Missing module docstring (missing-docstring) > ... > % errors / warnings by module > ----------------------------- > > +-------+------+--------+---------+-----------+ > |module |error |warning |refactor |convention | > +=======+======+========+=========+===========+ > |test2 |0.00 |100.00 |100.00 |60.00 | > +-------+------+--------+---------+-----------+ > ... > Statistics by type > ------------------ > > +---------+-------+-----------+-----------+------------+---------+ > |type |number |old number |difference |%documented |%badname | > +=========+=======+===========+===========+============+=========+ > |module |2 |2 |= |0.00 |0.00 | > +---------+-------+-----------+-----------+------------+---------+ > ... > > > It's always the same file (test2.py) which gets reported, even if I > change the order of the files on the command line. The same thing > occurs if I pass --output-format=text or --output-format=html; both > the pylint_global.txt and pylint_global.html files are missing the > test1.py module from the 'errors/warnings by module' section. > > Is this a bug, or just something I'm doing wrong or misunderstanding? This is a bug that should be reported on https://bitbucket.org/logilab/pylint/issues Thanks! -- Sylvain Th?nault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, M?th. Agiles: http://www.logilab.fr/formations D?veloppement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org From graffatcolmingov at gmail.com Mon Aug 25 14:38:59 2014 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Mon, 25 Aug 2014 07:38:59 -0500 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: <53FAF58B.8070903@etu.enseeiht.fr> References: <53FA4611.9070605@etu.enseeiht.fr> <53FAF58B.8070903@etu.enseeiht.fr> Message-ID: So Flake8 would actually recognize that if you installed Flake8 under Python 3 (e.g., pip3 install flake8), and then run flake8 from Python 3. You can do this with a virtualenv more easily like: virtualenv -ppython3 path/to/virtualenv source path/to/virtualenv/bin/activate pip install flake8 flake8 project/ PyFlakes will only run checks for the version of Python it is installed on. Let me know if you run into any problems with this. On Mon, Aug 25, 2014 at 3:36 AM, Fran?ois Magimel wrote: > > Le 25/08/2014 02:24, Ian Cordasco a ?crit : >> On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel >> wrote: >>> Hello! >>> >>> I'm new in this mailing, so I will introduce myself first. I'm Fran?ois >>> (alias Linkid), a French engineering student who code mainly in Python. >>> I'm involved in some open source projects and some of them like Django >>> or OpenStack. >>> >>> I would like to add a test for Python 3 to check an import, but I don't >>> really know on which project (pep8, pyflakes, ?) to do that and how to >>> do it (by a push request on github or somewhere else, by a bug report, >>> ?). I searched some clue and I think my test should be used by pyflakes, >>> but I'm not sure? So, here are my questions: >>> - on which project should I add a Python 3 import test ? >>> - how I should process ? >>> >>> I think it could help be a lot if someone explain me what one project >>> really check, if it is possible. >>> >>> Thank you. >>> >>> Fran?ois Magimel (Linkid) >> Hello Fran?ois, >> >> I'm not quite sure anyone on this list can answer your question. You >> haven't given us any guidance about what the check is that you would >> like to add. Do you want to check for imports that are not used in >> Python 3? Are you looking for imports that would fail on Python 3 >> instead? Are you looking to ensure some style of imports? Perhaps >> you're looking to do what openstack/hacking already does (ensure only >> modules are imported)? There are too many possibilities for us to be >> helpful. >> >> Further, unless what you wish to add is part of >> http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you >> that it does *not* belong in pep8. If you can give us more details I >> can also tell you whether it belongs in PyFlakes. If it turns out it >> does not belong in PyFlakes, you can always write and release your own >> plugin for Flake8. >> >> Sorry I cannot be more helpful, >> Ian > > Hello, > > Oh, yes, it will be better if I give some details. My code didn't pass > my python 3 tests due to an import of string. As a matter of fact, I was > using string.letters which is not in python 3 anymore. However, when I > tested my code with flake8, I wasn't warned about it. So, I would like > to add this warning (maybe to PyFlakes, but I'm not sure). And I think > it is not only an OpenStack issue because it concerns every projects. > So, if someone can help me to add it (to PyFlakes?) by giving me the > process (PR on GitHub?), I will be very happy to contribute :). > > Thank you for your answer, Ian. > Fran?ois > From francois.magimel at etu.enseeiht.fr Mon Aug 25 17:33:06 2014 From: francois.magimel at etu.enseeiht.fr (=?UTF-8?B?RnJhbsOnb2lzIE1hZ2ltZWw=?=) Date: Mon, 25 Aug 2014 17:33:06 +0200 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: References: <53FA4611.9070605@etu.enseeiht.fr> <53FAF58B.8070903@etu.enseeiht.fr> Message-ID: <53FB5732.7000308@etu.enseeiht.fr> I tested with python 3.4, but Flake8 didn't recognized this error? But I thought Flake8 only runs pep8, PyFlakes & co. tests, no? So, if I would like to add this test, it may belong to PyFlakes, right? Le 25/08/2014 14:38, Ian Cordasco a ?crit : > So Flake8 would actually recognize that if you installed Flake8 under > Python 3 (e.g., pip3 install flake8), and then run flake8 from Python > 3. > > You can do this with a virtualenv more easily like: > > virtualenv -ppython3 path/to/virtualenv > source path/to/virtualenv/bin/activate > pip install flake8 > flake8 project/ > > PyFlakes will only run checks for the version of Python it is > installed on. Let me know if you run into any problems with this. > > On Mon, Aug 25, 2014 at 3:36 AM, Fran?ois Magimel > wrote: >> Le 25/08/2014 02:24, Ian Cordasco a ?crit : >>> On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel >>> wrote: >>>> Hello! >>>> >>>> I'm new in this mailing, so I will introduce myself first. I'm Fran?ois >>>> (alias Linkid), a French engineering student who code mainly in Python. >>>> I'm involved in some open source projects and some of them like Django >>>> or OpenStack. >>>> >>>> I would like to add a test for Python 3 to check an import, but I don't >>>> really know on which project (pep8, pyflakes, ?) to do that and how to >>>> do it (by a push request on github or somewhere else, by a bug report, >>>> ?). I searched some clue and I think my test should be used by pyflakes, >>>> but I'm not sure? So, here are my questions: >>>> - on which project should I add a Python 3 import test ? >>>> - how I should process ? >>>> >>>> I think it could help be a lot if someone explain me what one project >>>> really check, if it is possible. >>>> >>>> Thank you. >>>> >>>> Fran?ois Magimel (Linkid) >>> Hello Fran?ois, >>> >>> I'm not quite sure anyone on this list can answer your question. You >>> haven't given us any guidance about what the check is that you would >>> like to add. Do you want to check for imports that are not used in >>> Python 3? Are you looking for imports that would fail on Python 3 >>> instead? Are you looking to ensure some style of imports? Perhaps >>> you're looking to do what openstack/hacking already does (ensure only >>> modules are imported)? There are too many possibilities for us to be >>> helpful. >>> >>> Further, unless what you wish to add is part of >>> http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you >>> that it does *not* belong in pep8. If you can give us more details I >>> can also tell you whether it belongs in PyFlakes. If it turns out it >>> does not belong in PyFlakes, you can always write and release your own >>> plugin for Flake8. >>> >>> Sorry I cannot be more helpful, >>> Ian >> Hello, >> >> Oh, yes, it will be better if I give some details. My code didn't pass >> my python 3 tests due to an import of string. As a matter of fact, I was >> using string.letters which is not in python 3 anymore. However, when I >> tested my code with flake8, I wasn't warned about it. So, I would like >> to add this warning (maybe to PyFlakes, but I'm not sure). And I think >> it is not only an OpenStack issue because it concerns every projects. >> So, if someone can help me to add it (to PyFlakes?) by giving me the >> process (PR on GitHub?), I will be very happy to contribute :). >> >> Thank you for your answer, Ian. >> Fran?ois >> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From graffatcolmingov at gmail.com Mon Aug 25 18:11:28 2014 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Mon, 25 Aug 2014 11:11:28 -0500 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: <53FB5732.7000308@etu.enseeiht.fr> References: <53FA4611.9070605@etu.enseeiht.fr> <53FAF58B.8070903@etu.enseeiht.fr> <53FB5732.7000308@etu.enseeiht.fr> Message-ID: Can you please reply with the output from: flake8 --version On Mon, Aug 25, 2014 at 10:33 AM, Fran?ois Magimel wrote: > I tested with python 3.4, but Flake8 didn't recognized this error? > But I thought Flake8 only runs pep8, PyFlakes & co. tests, no? So, if I > would like to add this test, it may belong to PyFlakes, right? > > > Le 25/08/2014 14:38, Ian Cordasco a ?crit : >> So Flake8 would actually recognize that if you installed Flake8 under >> Python 3 (e.g., pip3 install flake8), and then run flake8 from Python >> 3. >> >> You can do this with a virtualenv more easily like: >> >> virtualenv -ppython3 path/to/virtualenv >> source path/to/virtualenv/bin/activate >> pip install flake8 >> flake8 project/ >> >> PyFlakes will only run checks for the version of Python it is >> installed on. Let me know if you run into any problems with this. >> >> On Mon, Aug 25, 2014 at 3:36 AM, Fran?ois Magimel >> wrote: >>> Le 25/08/2014 02:24, Ian Cordasco a ?crit : >>>> On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel >>>> wrote: >>>>> Hello! >>>>> >>>>> I'm new in this mailing, so I will introduce myself first. I'm Fran?ois >>>>> (alias Linkid), a French engineering student who code mainly in Python. >>>>> I'm involved in some open source projects and some of them like Django >>>>> or OpenStack. >>>>> >>>>> I would like to add a test for Python 3 to check an import, but I don't >>>>> really know on which project (pep8, pyflakes, ?) to do that and how to >>>>> do it (by a push request on github or somewhere else, by a bug report, >>>>> ?). I searched some clue and I think my test should be used by pyflakes, >>>>> but I'm not sure? So, here are my questions: >>>>> - on which project should I add a Python 3 import test ? >>>>> - how I should process ? >>>>> >>>>> I think it could help be a lot if someone explain me what one project >>>>> really check, if it is possible. >>>>> >>>>> Thank you. >>>>> >>>>> Fran?ois Magimel (Linkid) >>>> Hello Fran?ois, >>>> >>>> I'm not quite sure anyone on this list can answer your question. You >>>> haven't given us any guidance about what the check is that you would >>>> like to add. Do you want to check for imports that are not used in >>>> Python 3? Are you looking for imports that would fail on Python 3 >>>> instead? Are you looking to ensure some style of imports? Perhaps >>>> you're looking to do what openstack/hacking already does (ensure only >>>> modules are imported)? There are too many possibilities for us to be >>>> helpful. >>>> >>>> Further, unless what you wish to add is part of >>>> http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you >>>> that it does *not* belong in pep8. If you can give us more details I >>>> can also tell you whether it belongs in PyFlakes. If it turns out it >>>> does not belong in PyFlakes, you can always write and release your own >>>> plugin for Flake8. >>>> >>>> Sorry I cannot be more helpful, >>>> Ian >>> Hello, >>> >>> Oh, yes, it will be better if I give some details. My code didn't pass >>> my python 3 tests due to an import of string. As a matter of fact, I was >>> using string.letters which is not in python 3 anymore. However, when I >>> tested my code with flake8, I wasn't warned about it. So, I would like >>> to add this warning (maybe to PyFlakes, but I'm not sure). And I think >>> it is not only an OpenStack issue because it concerns every projects. >>> So, if someone can help me to add it (to PyFlakes?) by giving me the >>> process (PR on GitHub?), I will be very happy to contribute :). >>> >>> Thank you for your answer, Ian. >>> Fran?ois >>> > > From francois.magimel at etu.enseeiht.fr Wed Aug 27 10:15:44 2014 From: francois.magimel at etu.enseeiht.fr (=?UTF-8?B?RnJhbsOnb2lzIE1hZ2ltZWw=?=) Date: Wed, 27 Aug 2014 10:15:44 +0200 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: References: <53FA4611.9070605@etu.enseeiht.fr> <53FAF58B.8070903@etu.enseeiht.fr> <53FB5732.7000308@etu.enseeiht.fr> Message-ID: <53FD93B0.1000900@etu.enseeiht.fr> Of course! Here is the return: $ flake8 --version 2.2.3 (pep8: 1.5.7, pyflakes: 0.8.1, mccabe: 0.2.1) CPython 3.4.1 on Linux And the code to test: import string print(string.letters) Le 25/08/2014 18:11, Ian Cordasco a ?crit : > Can you please reply with the output from: > > flake8 --version > > On Mon, Aug 25, 2014 at 10:33 AM, Fran?ois Magimel > wrote: >> I tested with python 3.4, but Flake8 didn't recognized this error? >> But I thought Flake8 only runs pep8, PyFlakes & co. tests, no? So, if I >> would like to add this test, it may belong to PyFlakes, right? >> >> >> Le 25/08/2014 14:38, Ian Cordasco a ?crit : >>> So Flake8 would actually recognize that if you installed Flake8 under >>> Python 3 (e.g., pip3 install flake8), and then run flake8 from Python >>> 3. >>> >>> You can do this with a virtualenv more easily like: >>> >>> virtualenv -ppython3 path/to/virtualenv >>> source path/to/virtualenv/bin/activate >>> pip install flake8 >>> flake8 project/ >>> >>> PyFlakes will only run checks for the version of Python it is >>> installed on. Let me know if you run into any problems with this. >>> >>> On Mon, Aug 25, 2014 at 3:36 AM, Fran?ois Magimel >>> wrote: >>>> Le 25/08/2014 02:24, Ian Cordasco a ?crit : >>>>> On Sun, Aug 24, 2014 at 3:07 PM, Fran?ois Magimel >>>>> wrote: >>>>>> Hello! >>>>>> >>>>>> I'm new in this mailing, so I will introduce myself first. I'm Fran?ois >>>>>> (alias Linkid), a French engineering student who code mainly in Python. >>>>>> I'm involved in some open source projects and some of them like Django >>>>>> or OpenStack. >>>>>> >>>>>> I would like to add a test for Python 3 to check an import, but I don't >>>>>> really know on which project (pep8, pyflakes, ?) to do that and how to >>>>>> do it (by a push request on github or somewhere else, by a bug report, >>>>>> ?). I searched some clue and I think my test should be used by pyflakes, >>>>>> but I'm not sure? So, here are my questions: >>>>>> - on which project should I add a Python 3 import test ? >>>>>> - how I should process ? >>>>>> >>>>>> I think it could help be a lot if someone explain me what one project >>>>>> really check, if it is possible. >>>>>> >>>>>> Thank you. >>>>>> >>>>>> Fran?ois Magimel (Linkid) >>>>> Hello Fran?ois, >>>>> >>>>> I'm not quite sure anyone on this list can answer your question. You >>>>> haven't given us any guidance about what the check is that you would >>>>> like to add. Do you want to check for imports that are not used in >>>>> Python 3? Are you looking for imports that would fail on Python 3 >>>>> instead? Are you looking to ensure some style of imports? Perhaps >>>>> you're looking to do what openstack/hacking already does (ensure only >>>>> modules are imported)? There are too many possibilities for us to be >>>>> helpful. >>>>> >>>>> Further, unless what you wish to add is part of >>>>> http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you >>>>> that it does *not* belong in pep8. If you can give us more details I >>>>> can also tell you whether it belongs in PyFlakes. If it turns out it >>>>> does not belong in PyFlakes, you can always write and release your own >>>>> plugin for Flake8. >>>>> >>>>> Sorry I cannot be more helpful, >>>>> Ian >>>> Hello, >>>> >>>> Oh, yes, it will be better if I give some details. My code didn't pass >>>> my python 3 tests due to an import of string. As a matter of fact, I was >>>> using string.letters which is not in python 3 anymore. However, when I >>>> tested my code with flake8, I wasn't warned about it. So, I would like >>>> to add this warning (maybe to PyFlakes, but I'm not sure). And I think >>>> it is not only an OpenStack issue because it concerns every projects. >>>> So, if someone can help me to add it (to PyFlakes?) by giving me the >>>> process (PR on GitHub?), I will be very happy to contribute :). >>>> >>>> Thank you for your answer, Ian. >>>> Fran?ois >>>> >> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From graffatcolmingov at gmail.com Thu Aug 28 01:16:07 2014 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Wed, 27 Aug 2014 18:16:07 -0500 Subject: [code-quality] How and where to add tests for Python 3 In-Reply-To: <53FD93B0.1000900@etu.enseeiht.fr> References: <53FA4611.9070605@etu.enseeiht.fr> <53FAF58B.8070903@etu.enseeiht.fr> <53FB5732.7000308@etu.enseeiht.fr> <53FD93B0.1000900@etu.enseeiht.fr> Message-ID: On Wed, Aug 27, 2014 at 3:15 AM, Fran?ois Magimel wrote: > Of course! Here is the return: > $ flake8 --version > 2.2.3 (pep8: 1.5.7, pyflakes: 0.8.1, mccabe: 0.2.1) CPython 3.4.1 on Linux > > And the code to test: > > import string > > print(string.letters) Oh, I see the confusion. So this passes because pyflakes will compile the code but that doesn't do attribute checking (that's done at runtime by Python), so the import works just fine. Pyflakes doesn't make assumptions about the attribute (letters in this case) and to add attribute checking to every module imported would significantly increase the complexity of the project. You would have to do several things: 1. Find where the module is being imported from (I can not remember if the AST holds this information, but I strongly doubt it does) 2. Load/compile the module in question 3. Attempt to statically determine if the attribute is available which may be in fact very error-prone. The first point sounds very simple, but is in fact not as simple as it might seem. More importantly to me, I'd like to focus on the third point. While most modules do not dynamically handle attributes there are plenty which do. One prime example of this is flask. For any extension of the framework, you can use entry points so that a user can do: from flask.ext import sqlalchemy Naturally the flask.ext module does not have every extension statically defined, in fact it has some very clever machinery to provide this interface to the user that would be far too complicated to detect or handle. Adding this kind of checking would ultimately be problematic and at times flat-out wrong. If you're still up for adding this, I'd strongly encourage you to try your hand adding it to PyFlakes. I'll even give you a lot of credit if you can get it to play nicely with modules like flask.ext. From vanderkelen.francois at gmail.com Thu Aug 28 19:06:34 2014 From: vanderkelen.francois at gmail.com (=?UTF-8?Q?Fran=C3=A7ois_Vanderkelen?=) Date: Thu, 28 Aug 2014 19:06:34 +0200 Subject: [code-quality] Yet another namespace issue ? Virtualenv Message-ID: Hi experts, I have another issue which seems to be related to namespaces but happening only inside virtualenv. Whenever I am running pylint on a namespaced module calling dependencies inside another module within the same namespace (or a parent one), I get an unable to import "module" error. I missed a command and installed all my packages in my global environement by mistake and ran the same pylint, everything was running smoothly (went from -14,14 to 8.46 for a single file). I tried to change the vitualen pylint version to match the one installed globally without success. Looks like the pylint inside my virtualenv is not running on the correct path. I will continue digging and try to provide you with more details (and files) but I was wondering if this was a known issue or just a configuration thing ? Thanks in advance. Fran?ois -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvain.thenault at logilab.fr Fri Aug 29 07:27:34 2014 From: sylvain.thenault at logilab.fr (Sylvain =?utf-8?B?VGjDqW5hdWx0?=) Date: Fri, 29 Aug 2014 07:27:34 +0200 Subject: [code-quality] Yet another namespace issue ? Virtualenv In-Reply-To: References: Message-ID: <20140829052734.GB3039@logilab.fr> On 28 ao?t 19:06, Fran?ois Vanderkelen wrote: > Hi experts, Hi Fran?ois, > I have another issue which seems to be related to namespaces but happening > only inside virtualenv. > > Whenever I am running pylint on a namespaced module calling dependencies > inside another module within the same namespace (or a parent one), I get an > unable to import "module" error. > > I missed a command and installed all my packages in my global environement > by mistake and ran the same pylint, everything was running smoothly (went > from -14,14 to 8.46 for a single file). > > I tried to change the vitualen pylint version to match the one installed > globally without success. Looks like the pylint inside my virtualenv is not > running on the correct path. > > I will continue digging and try to provide you with more details (and > files) but I was wondering if this was a known issue or just a > configuration thing ? we've been suspecting such problems for a while but we're still missing some concret information about this (and I'm personnaly not much a user of virtual env and namesace pacckage splitted across various directories). So it would be valuable to add a new issue with all the information you get about the subject. Thanks! -- Sylvain Th?nault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, M?th. Agiles: http://www.logilab.fr/formations D?veloppement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org From vanderkelen.francois at gmail.com Fri Aug 29 10:06:48 2014 From: vanderkelen.francois at gmail.com (=?UTF-8?Q?Fran=C3=A7ois_Vanderkelen?=) Date: Fri, 29 Aug 2014 10:06:48 +0200 Subject: [code-quality] Yet another namespace issue ? Virtualenv In-Reply-To: <20140829052734.GB3039@logilab.fr> References: <20140829052734.GB3039@logilab.fr> Message-ID: Hi Sylvain, Thanks for the answer, here is the issue : https://bitbucket.org/logilab/pylint/issue/324/namespaces-and-virutlaenv. I also provided you with a repository allowing you to try it out. Cheers 2014-08-29 7:27 GMT+02:00 Sylvain Th?nault : > On 28 ao?t 19:06, Fran?ois Vanderkelen wrote: > > Hi experts, > > Hi Fran?ois, > > > I have another issue which seems to be related to namespaces but > happening > > only inside virtualenv. > > > > Whenever I am running pylint on a namespaced module calling dependencies > > inside another module within the same namespace (or a parent one), I get > an > > unable to import "module" error. > > > > I missed a command and installed all my packages in my global > environement > > by mistake and ran the same pylint, everything was running smoothly (went > > from -14,14 to 8.46 for a single file). > > > > I tried to change the vitualen pylint version to match the one installed > > globally without success. Looks like the pylint inside my virtualenv is > not > > running on the correct path. > > > > I will continue digging and try to provide you with more details (and > > files) but I was wondering if this was a known issue or just a > > configuration thing ? > > we've been suspecting such problems for a while but we're still missing > some > concret information about this (and I'm personnaly not much a user of > virtual > env and namesace pacckage splitted across various directories). So it > would be > valuable to add a new issue with all the information you get about the > subject. > > Thanks! > -- > Sylvain Th?nault, LOGILAB, Paris (01.45.32.03.12) - Toulouse > (05.62.17.16.42) > Formations Python, Debian, M?th. Agiles: http://www.logilab.fr/formations > D?veloppement logiciel sur mesure: http://www.logilab.fr/services > CubicWeb, the semantic web framework: http://www.cubicweb.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvain.thenault at logilab.fr Fri Aug 29 10:14:32 2014 From: sylvain.thenault at logilab.fr (Sylvain =?utf-8?B?VGjDqW5hdWx0?=) Date: Fri, 29 Aug 2014 10:14:32 +0200 Subject: [code-quality] Yet another namespace issue ? Virtualenv In-Reply-To: References: <20140829052734.GB3039@logilab.fr> Message-ID: <20140829081432.GI3039@logilab.fr> On 29 ao?t 10:06, Fran?ois Vanderkelen wrote: > Hi Sylvain, > > Thanks for the answer, here is the issue : > https://bitbucket.org/logilab/pylint/issue/324/namespaces-and-virutlaenv. > > I also provided you with a repository allowing you to try it out. great, thx! -- Sylvain Th?nault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, M?th. Agiles: http://www.logilab.fr/formations D?veloppement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org