[code-quality] How and where to add tests for Python 3

François Magimel francois.magimel at etu.enseeiht.fr
Mon Aug 25 17:33:06 CEST 2014


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
> <francois.magimel at etu.enseeiht.fr> wrote:
>> Le 25/08/2014 02:24, Ian Cordasco a écrit :
>>> On Sun, Aug 24, 2014 at 3:07 PM, François Magimel
>>> <francois.magimel at etu.enseeiht.fr> 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: <http://mail.python.org/pipermail/code-quality/attachments/20140825/e3854268/attachment.sig>


More information about the code-quality mailing list