From florian.k at mailbox.org Thu Jul 7 07:03:52 2016 From: florian.k at mailbox.org (Florian Kromer) Date: Thu, 7 Jul 2016 13:03:52 +0200 (CEST) Subject: [code-quality] class diagram dot code of pylint/pyreverse as stdout stream output Message-ID: <1438834899.7060.1467889432168@office.mailbox.org> Hi everyone, is it possible to pipe the dot code of a pylint/pyreverse package or class diagram into the stdout stream instead of creating a .dot file and putting it in there? A bit more details: I write a sphinx-doc extension which shall integrate the dot representation of package and class diagrams generated with pylint/pyreverse into sphinx-doc documentations on the fly. It would be easier for me to integrate the dot code of pylint/pyreverse from its stdout stream instead of struggling with files to get the dot code... Thanks. Florian From graffatcolmingov at gmail.com Thu Jul 7 08:31:55 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Thu, 7 Jul 2016 07:31:55 -0500 Subject: [code-quality] PyCQA News Message-ID: Hey all, It's been a while since we talked about new things happening in the PyCQA. We have new projects and a couple other tiny announcements. New projects! ============= We've added pyflakes and flake8-import-order to our tiny group of folks and of course we're still open to other projects. There is discussion on the Jedi issue tracker (https://github.com/davidhalter/jedi/issues/630) about moving a project that can provide a unified AST to various projects (including some PyCQA projects) into the organization as well. OpenHUB Organization! ===================== We now have an organization on OpenHub: https://www.openhub.net/orgs/PyCQA This means that projects and developers can show their affiliation with the organization. Doing so is *not* mandatory but I thought it might be fun for some people, plus we're part of a fairly small group of people testing this feature for OpenHUB. pycqa.org ========= A little while back I registered the domain and started using sub-domains for documentation, e.g., pydocstyle.pycqa.org flake8.pycqa.org etc. If you have a project in the PyCQA and would like one of those sub-domains for your docs, let me know. They're *very* easy to set-up with ReadTheDocs. New Logo! ========= You might have noticed on our OpenHUB organization or on our GitLab and GitHub organizations, but if you didn't we have a Logo! Glynnis Ritchie made our logo for us and collaborated with the rest of us over on https://github.com/PyCQA/meta/issues/1 Gitter.im ========= We already have (and some of us use) ##python-code-quality on Freenode's IRC servers. IRC, however, is still rather unpopular so some members have started discussing a better persistent chat option (https://github.com/PyCQA/meta/issues/11) and have started testing Gitter.im. Blog (Coming soon) ================== We started discussing a new blog for the organization as a whole: https://github.com/PyCQA/meta/issues/14 I think we can just use Sphinx + ReadTheDocs and a domain hack for all of this. If you have other ideas, weigh in on the issue. Cheers, Ian (sigmavirus24) From pcmanticore at gmail.com Thu Jul 7 11:00:52 2016 From: pcmanticore at gmail.com (Claudiu Popa) Date: Thu, 7 Jul 2016 16:00:52 +0100 Subject: [code-quality] class diagram dot code of pylint/pyreverse as stdout stream output In-Reply-To: <1438834899.7060.1467889432168@office.mailbox.org> References: <1438834899.7060.1467889432168@office.mailbox.org> Message-ID: On Thu, Jul 7, 2016 at 12:03 PM, Florian Kromer wrote: > Hi everyone, > > is it possible to pipe the dot code of a pylint/pyreverse package or class diagram into the stdout stream instead of creating a .dot file and putting it in there? > > A bit more details: > I write a sphinx-doc extension which shall integrate the dot representation of package and class diagrams generated with pylint/pyreverse into sphinx-doc documentations on the fly. It would be easier for me to integrate the dot code of pylint/pyreverse from its stdout stream instead of struggling with files to get the dot code... Hi Florian, Currently this is not possible, since the behavior is hard coded to put the output into a file. But if you want this feature, you can file an issue at https://github.com/PyCQA/pylint, I admit it might be useful. Thanks, Claudiu From florian.k at mailbox.org Thu Jul 7 13:34:04 2016 From: florian.k at mailbox.org (Florian Kromer) Date: Thu, 7 Jul 2016 19:34:04 +0200 (CEST) Subject: [code-quality] class diagram dot code of pylint/pyreverse as stdout stream output In-Reply-To: References: <1438834899.7060.1467889432168@office.mailbox.org> Message-ID: <161896741.933.1467912845021@office.mailbox.org> Hi Claudiu, alright, I will create an issue. Maybe I will find some time to implement it during my vacation. Kind regards, Florian > Claudiu Popa hat am 7. Juli 2016 um 17:00 geschrieben: > > > On Thu, Jul 7, 2016 at 12:03 PM, Florian Kromer wrote: > > Hi everyone, > > > > is it possible to pipe the dot code of a pylint/pyreverse package or class diagram into the stdout stream instead of creating a .dot file and putting it in there? > > > > A bit more details: > > I write a sphinx-doc extension which shall integrate the dot representation of package and class diagrams generated with pylint/pyreverse into sphinx-doc documentations on the fly. It would be easier for me to integrate the dot code of pylint/pyreverse from its stdout stream instead of struggling with files to get the dot code... > > Hi Florian, > > > Currently this is not possible, since the behavior is hard coded > to put the output into a file. But if you want this feature, > you can file an issue at https://github.com/PyCQA/pylint, > I admit it might be useful. > > > Thanks, > Claudiu From pcmanticore at gmail.com Thu Jul 7 14:55:20 2016 From: pcmanticore at gmail.com (Claudiu Popa) Date: Thu, 7 Jul 2016 19:55:20 +0100 Subject: [code-quality] Pylint 1.6.0 released Message-ID: Hi folks, I am joyful to announce the release of Pylint 1.6.0. This is the next minor release in the 1.X branch and most probably the last one, since we are preparing the taking off of Pylint 2.0. This release has a couple of small improvements, bug fixes and new checks, comparing to the last one. You can find more about was changed in this release here: https://docs.pylint.org/en/1.6.0/whatsnew/1.6.html https://docs.pylint.org/en/1.6.0/whatsnew/changelog.html#what-s-new-in-pylint-1-6-0 As usual, don't hesitate to report any new bugs you might encounter with this release. We are also looking for new contributors, so if you feel like taking a stab at a bug or a feature you would like in pylint, open up an issue and let's talk! We are also planning to do releases more often from now on and you can see what we are planning for the next releases here: https://github.com/PyCQA/pylint/milestones Thank you and enjoy, Claudiu Popa From ahirnish at arista.com Tue Jul 12 02:16:59 2016 From: ahirnish at arista.com (Ahirnish Pareek) Date: Tue, 12 Jul 2016 11:46:59 +0530 Subject: [code-quality] Need pointers on how to add test case in the test suite for the functionality I am adding. Message-ID: Hi Devs, I am kind of confused as to how to write test case for my functionality. I am adding the patch in typecheck.py. Is there any guide on adding new test cases? Thanks. -- Regards, Ahirnish -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Tue Jul 12 02:55:17 2016 From: me at the-compiler.org (Florian Bruhin) Date: Tue, 12 Jul 2016 08:55:17 +0200 Subject: [code-quality] Need pointers on how to add test case in the test suite for the functionality I am adding. In-Reply-To: References: Message-ID: <20160712065517.udslescdwkfiekar@tonks> * Ahirnish Pareek [2016-07-12 11:46:59 +0530]: > I am kind of confused as to how to write test case for my functionality. I > am adding the patch in typecheck.py. Is there any guide on adding new test > cases? I'm guessing you're talking about pylint? Might want to mention that, as this ML is for various code quality tools and I had to re-read your message a few times until I understood what you meant ;) As for your question, I have no idea - could you be more specific about what you're working on? Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From graffatcolmingov at gmail.com Sat Jul 16 21:38:32 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Sat, 16 Jul 2016 20:38:32 -0500 Subject: [code-quality] Announcing ci.pycqa.org Message-ID: Hey all! So, Rackspace has provided us with some sponsorship so we can run things like Jenkins! This allows us to run ci.pycqa.org. Flake8 has been using this for continuous integration with GitLab for a while now, but we've recently moved the public address from ci.sigmavir.us (my temporary domain) to ci.pycqa.org and added more build capacity. We should also have money enough to add more build nodes if necessary. We currently support python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy's latest 5.x branch for Python environments. The controlling Jenkins node (that you see at ci.pycqa.org) is running Ubuntu 14.04 while the solitary build node is running 16.04. We also support GitHub Pull Requests and we can probably support other linux variants as well. Presently I'm the sole administrator of all of this, but I'd still like to make sure the larger group can take advantage of it. As for future facing plans, I'd kind of like to utilize Jenkins to its fullest potential, including building wheels after successful builds for PRs for Flake8. This will make it easier for me to install and test the PR itself. I don't presently have that set-up *yet* and I haven't quite figured out how I would do that, but if that sounds interesting to you, let's chat (on this mailing list or in private). Finally, I just wanted to thank Rackspace again (and Jesse Noller in particular) for this sponsorship. If you're one of those inclined to tweet, you should thank Jesse @jessenoller. I'm sure he'd appreciate it. Cheers, Ian From graffatcolmingov at gmail.com Sat Jul 16 21:45:22 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Sat, 16 Jul 2016 20:45:22 -0500 Subject: [code-quality] Announcing ci.pycqa.org In-Reply-To: References: Message-ID: On Sat, Jul 16, 2016 at 8:38 PM, Ian Cordasco wrote: > Hey all! > > So, Rackspace has provided us with some sponsorship so we can run > things like Jenkins! This allows us to run ci.pycqa.org. > > Flake8 has been using this for continuous integration with GitLab for > a while now, but we've recently moved the public address from > ci.sigmavir.us (my temporary domain) to ci.pycqa.org and added more > build capacity. We should also have money enough to add more build > nodes if necessary. > > We currently support python 2.6, 2.7, 3.3, 3.4, 3.5, and pypy's latest > 5.x branch for Python environments. The controlling Jenkins node (that > you see at ci.pycqa.org) is running Ubuntu 14.04 while the solitary > build node is running 16.04. We also support GitHub Pull Requests and > we can probably support other linux variants as well. > > Presently I'm the sole administrator of all of this, but I'd still > like to make sure the larger group can take advantage of it. > > As for future facing plans, I'd kind of like to utilize Jenkins to its > fullest potential, including building wheels after successful builds > for PRs for Flake8. This will make it easier for me to install and > test the PR itself. I don't presently have that set-up *yet* and I > haven't quite figured out how I would do that, but if that sounds > interesting to you, let's chat (on this mailing list or in private). > > Finally, I just wanted to thank Rackspace again (and Jesse Noller in > particular) for this sponsorship. If you're one of those inclined to > tweet, you should thank Jesse @jessenoller. I'm sure he'd appreciate > it. > > Cheers, > Ian Oh, also, if anyone's familiar with setting up Let's Encrypt + Jenkins, I'd love to collaborate on that. I would really prefer to have Jenkins behind HTTPS than not. :) From stum at hudson-trading.com Wed Jul 20 13:20:14 2016 From: stum at hudson-trading.com (Tim Stumbaugh) Date: Wed, 20 Jul 2016 13:20:14 -0400 Subject: [code-quality] [pylint] disabled messages with --errors-only Message-ID: Hi, Since command line flags are processed after config file directives, error messages that are disabled in a config file (or in a command line flag that appears before --errors-only) are not respected when running in errors-only mode. This appears to be because errors-only mode unconditionally enables all messages with a category of 'E' or 'F'. We have a config file that has the messages that has a few error messages disabled (because of highly-dynamic features that we use that pylint can't interpret correctly), but we do run pylint in errors-only mode quite often. A patch that works for us is to change PyLinter.disable_noerror_messages not to ever enable messages (but only to disable non error messages). That seems like quite a large change though, since a user who only passes --enable (or enables messages through the config file) would not get messages in --errors-only that they haven't asked for. Is there an opinion on what patch might be acceptable for the project? Would it work to add an extra flag or put extra state in the PyLinter object so that it knows which messages have been explicitly disabled? Thanks, tjs -- Tim Stumbaugh Operations Hudson River Trading -------------- next part -------------- An HTML attachment was scrubbed... URL: From pcmanticore at gmail.com Wed Jul 20 18:14:11 2016 From: pcmanticore at gmail.com (Claudiu Popa) Date: Thu, 21 Jul 2016 01:14:11 +0300 Subject: [code-quality] [pylint] disabled messages with --errors-only In-Reply-To: References: Message-ID: On Wed, Jul 20, 2016 at 8:20 PM, Tim Stumbaugh wrote: > Hi, > > Since command line flags are processed after config file directives, error > messages that are disabled in a config file (or in a command line flag that > appears before --errors-only) are not respected when running in errors-only > mode. > > This appears to be because errors-only mode unconditionally enables all > messages with a category of 'E' or 'F'. > > We have a config file that has the messages that has a few error messages > disabled (because of highly-dynamic features that we use that pylint can't > interpret correctly), but we do run pylint in errors-only mode quite often. > > A patch that works for us is to change PyLinter.disable_noerror_messages not > to ever enable messages (but only to disable non error messages). That seems > like quite a large change though, since a user who only passes --enable (or > enables messages through the config file) would not get messages in > --errors-only that they haven't asked for. > > Is there an opinion on what patch might be acceptable for the project? Would > it work to add an extra flag or put extra state in the PyLinter object so > that it knows which messages have been explicitly disabled? > > Thanks, > tjs > Hi, I think we should not touch the error-only mode, especially since it does not provide any guarantee that the previous configured disables or enables are respected, being a mode selection rather than a verbatim shortcut towards disable=all enable=E (the same way with --py3k), the mode being to activate all the known errors. This problem can be of course solved without touching any code, at least on the CLI level that would be equivalent to --disable=all --enable=E,F --disable=m1,m2,m3., while in the configuration this would be equivalent to disable=all enable=E,F disable=m1,m2,m3 with the only caveat that this is currently not possible, due to the fact that we do not support duplicate options in the config files. We still can support this feature with a custom dict type for the config parser, so that is not necessarily an unavoidable problem. These two solutions though have the disadvantages that you will have to repeat the mantra all the time, but I can't find right now an alternative. Having the CLI pragma controls take in account what was activated or deactivated in the config file leads to confusion (if I disable X in config file and with the CLI I am doing --enable=E, should the last part enable X if it was already disabled? If not, why? How do you detect the rule and what gets enabled and what not.) This turns into a slippery slope of edge cases and behavior for which we have to check the documentation all the time. I would rather introduce a DSL that would alleviate our current limitations with the binary world of enabled and disabled messages (with something that can manage to hand pick only those messages from a category of messages, while satisfying some conditions). Claudiu From stum at hudson-trading.com Wed Jul 20 18:25:48 2016 From: stum at hudson-trading.com (Tim Stumbaugh) Date: Wed, 20 Jul 2016 18:25:48 -0400 Subject: [code-quality] [pylint] disabled messages with --errors-only In-Reply-To: References: Message-ID: OK, that's fair. I totally understand the concern that it becomes a slippery slope. It's just a bit annoying to have to remember to get the order of -E and --disable right. :) Thanks for the consideration, anyway! tjs On Wed, Jul 20, 2016 at 6:14 PM, Claudiu Popa wrote: > On Wed, Jul 20, 2016 at 8:20 PM, Tim Stumbaugh > wrote: > > Hi, > > > > Since command line flags are processed after config file directives, > error > > messages that are disabled in a config file (or in a command line flag > that > > appears before --errors-only) are not respected when running in > errors-only > > mode. > > > > This appears to be because errors-only mode unconditionally enables all > > messages with a category of 'E' or 'F'. > > > > We have a config file that has the messages that has a few error messages > > disabled (because of highly-dynamic features that we use that pylint > can't > > interpret correctly), but we do run pylint in errors-only mode quite > often. > > > > A patch that works for us is to change PyLinter.disable_noerror_messages > not > > to ever enable messages (but only to disable non error messages). That > seems > > like quite a large change though, since a user who only passes --enable > (or > > enables messages through the config file) would not get messages in > > --errors-only that they haven't asked for. > > > > Is there an opinion on what patch might be acceptable for the project? > Would > > it work to add an extra flag or put extra state in the PyLinter object so > > that it knows which messages have been explicitly disabled? > > > > Thanks, > > tjs > > > > > Hi, > > I think we should not touch the error-only mode, especially since > it does not provide any guarantee that the previous configured > disables or enables are respected, being a mode selection rather > than a verbatim shortcut towards disable=all enable=E (the > same way with --py3k), the mode being to activate all the known errors. > > This problem can be of course solved without touching any code, > at least on the CLI level that would be equivalent to > > --disable=all --enable=E,F --disable=m1,m2,m3., > > while in the configuration this would be equivalent to > > disable=all > enable=E,F > disable=m1,m2,m3 > > with the only caveat that this is currently not possible, due > to the fact that we do not support duplicate options > in the config files. We still can support this feature with > a custom dict type for the config parser, so that is not necessarily > an unavoidable problem. > > These two solutions though have the disadvantages that you will > have to repeat the mantra all the time, but I can't find right now > an alternative. > Having the CLI pragma controls take in account what was activated > or deactivated in the config file leads to confusion > (if I disable X in config file and with the CLI I am doing > --enable=E, should the last part enable X if it was already > disabled? If not, why? How do you detect the rule and what gets enabled > and what not.) This turns into a slippery slope of edge cases and > behavior for which we have to check the documentation all the time. > > I would rather introduce a DSL that would alleviate our current > limitations with the binary world of enabled and disabled > messages > (with something that can manage to hand pick only those > messages from a category of messages, while > satisfying some conditions). > > > Claudiu > -- Tim Stumbaugh Operations Hudson River Trading -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrik.mrx at gmail.com Fri Jul 22 14:08:38 2016 From: patrik.mrx at gmail.com (mrx) Date: Fri, 22 Jul 2016 20:08:38 +0200 Subject: [code-quality] Module checking In-Reply-To: References: Message-ID: Hi, Thanks a lot for a wonderful and very useful tool in pylint. I am interested in having pylint check that the 'interface' specified in the __init__.py is respected and no one is importing stuff outside that interface. Is there something like this available in pylint? If not, could you give me some hints how to write it? I don't have a lot of experience with the pylint codebase though. Thanks in advance! Patrik -------------- next part -------------- An HTML attachment was scrubbed... URL: From marius at gedmin.as Sun Jul 24 16:45:41 2016 From: marius at gedmin.as (Marius Gedminas) Date: Sun, 24 Jul 2016 23:45:41 +0300 Subject: [code-quality] Announcing ci.pycqa.org In-Reply-To: References: Message-ID: <20160724204541.GA12289@platonas> On Sat, Jul 16, 2016 at 08:45:22PM -0500, Ian Cordasco wrote: > Oh, also, if anyone's familiar with setting up Let's Encrypt + > Jenkins, I'd love to collaborate on that. I would really prefer to > have Jenkins behind HTTPS than not. :) Did anyone get back to you about that? I'm running a Jenkins behind HTTPS for my personal FOSS projects at https://jenkins.gedmin.as. The setup is Ubuntu 14.04 LTS + Apache doing the HTTPS and delegating to Jenkins via mod_proxy. The LetsEncrypt bits are handled by certbot, with a cron script that runs certbot renew once a week. I've a Windows worker too, which needed some convincing to accept LetsEncrypt certs: https://github.com/mgedmin/letsencrypt-java I'm currently on vacation and am tying to stay away from email (and computers in general, excepting my smartphone). I'll be back online in August, if you've any questions. Marius Gedminas -- The best developers are also the ones sick enough to enjoy it. -- moffdub on stackoverflow.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 173 bytes Desc: not available URL: From graffatcolmingov at gmail.com Mon Jul 25 08:31:46 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Mon, 25 Jul 2016 07:31:46 -0500 Subject: [code-quality] Announcing ci.pycqa.org In-Reply-To: <20160724204541.GA12289@platonas> References: <20160724204541.GA12289@platonas> Message-ID: On Sun, Jul 24, 2016 at 3:45 PM, Marius Gedminas wrote: > On Sat, Jul 16, 2016 at 08:45:22PM -0500, Ian Cordasco wrote: >> Oh, also, if anyone's familiar with setting up Let's Encrypt + >> Jenkins, I'd love to collaborate on that. I would really prefer to >> have Jenkins behind HTTPS than not. :) > > Did anyone get back to you about that? > > I'm running a Jenkins behind HTTPS for my personal FOSS projects at > https://jenkins.gedmin.as. The setup is Ubuntu 14.04 LTS + Apache doing > the HTTPS and delegating to Jenkins via mod_proxy. The LetsEncrypt bits > are handled by certbot, with a cron script that runs certbot renew once > a week. > > I've a Windows worker too, which needed some convincing to accept > LetsEncrypt certs: https://github.com/mgedmin/letsencrypt-java > > I'm currently on vacation and am tying to stay away from email (and > computers in general, excepting my smartphone). I'll be back online in > August, if you've any questions. > > Marius Gedminas Thanks Marius! I had actually been experimenting with it all weekend long and am happy to say that https://ci.pycqa.org is now working and receiving an A rating from SSLLabs. :D Enjoy your vacation! Cheers! Ian From jack.wilsdon at gmail.com Wed Jul 27 12:05:31 2016 From: jack.wilsdon at gmail.com (Jack Wilsdon) Date: Wed, 27 Jul 2016 17:05:31 +0100 Subject: [code-quality] Importing __version__ / __author__ without causing an unused import error Message-ID: <981E4D8C-D72F-47DE-822C-49347829D824@gmail.com> Hi, I'm looking for a way to import __version__ / __author__ into my __init__.py without causing an F401 error. Defining __version__ normally works fine: > init.py __version__ = '1.0.0' __author__ = 'Jack Wilsdon But if I define them in an external file and import them, I get an F401 error: > __version__.py __version__ = '1.0.0' __author__ = 'Jack Wilsdon > init.py from __version__ import __version__, __author__ # I get an F > flake8 __init__.py __init__.py:1:1: F401 '__version.__author__' imported but unused __init__.py:1:1: F401 '__version.__version__' imported but unused Is there anything I can do about this? I know I could add "# noqa: F401" to the end of the import, but it just feels like a bit of a "hack" to me. I could also add __version__ and __author__ to __all__ in init.py, but then they would be imported if anyone used "from my_module import *", which is definitely not what I want. Is this a bug in flake8/pyflakes or just my understanding of how __version__ and __author__ are exempt from F401 errors normally. Thanks, Jack From indigo at bitglue.com Wed Jul 27 12:59:00 2016 From: indigo at bitglue.com (Phil Frost) Date: Wed, 27 Jul 2016 12:59:00 -0400 Subject: [code-quality] Importing __version__ / __author__ without causing an unused import error In-Reply-To: <981E4D8C-D72F-47DE-822C-49347829D824@gmail.com> References: <981E4D8C-D72F-47DE-822C-49347829D824@gmail.com> Message-ID: <125da872-fa69-ae4f-cfe4-5c63e69df11f@bitglue.com> On 07/27/2016 12:05 PM, Jack Wilsdon wrote: > I'm looking for a way to import __version__ / __author__ into my __init__.py without causing an F401 error. List it in __all__. From graffatcolmingov at gmail.com Wed Jul 27 13:30:40 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Wed, 27 Jul 2016 12:30:40 -0500 Subject: [code-quality] Importing __version__ / __author__ without causing an unused import error In-Reply-To: <981E4D8C-D72F-47DE-822C-49347829D824@gmail.com> References: <981E4D8C-D72F-47DE-822C-49347829D824@gmail.com> Message-ID: On Wed, Jul 27, 2016 at 11:05 AM, Jack Wilsdon wrote: > Hi, > > I'm looking for a way to import __version__ / __author__ into my __init__.py without causing an F401 error. > > Defining __version__ normally works fine: > >> init.py > > __version__ = '1.0.0' > __author__ = 'Jack Wilsdon > > But if I define them in an external file and import them, I get an F401 error: > >> __version__.py > > __version__ = '1.0.0' > __author__ = 'Jack Wilsdon > >> init.py > > from __version__ import __version__, __author__ # I get an F > >> flake8 __init__.py > > __init__.py:1:1: F401 '__version.__author__' imported but unused > __init__.py:1:1: F401 '__version.__version__' imported but unused > > Is there anything I can do about this? I know I could add "# noqa: F401" to the end of the import, but it just feels like a bit of a "hack" to me. > > I could also add __version__ and __author__ to __all__ in init.py, but then they would be imported if anyone used "from my_module import *", which is definitely not what I want. > > Is this a bug in flake8/pyflakes or just my understanding of how __version__ and __author__ are exempt from F401 errors normally. I wouldn't consider it a bug in either. There might be a case for special-casing some dunder variables but it's not really a bug. I'm not sure why you think __version__ and __author__ are exempt from F401 errors normally. F401 means they were imported without being used. If you mean, why don't I see F401 when I define them in __init__.py to start with, then that's because like all module globals, pyflakes does not check to see if it's used later because module constants may not need to be used.