Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
I’d like to +1 the idea of moving these custom checks from repositories to hacking. We, in murano, had a couple of commits, that added custom checks like checking that we do not use xrange, mutable objects as default arguments, etc. At first those look good and logical, but as their numbers grew, it started to look like it 1) bloats the repository with lot’s of unrelated, non-specific code/checks 2) makes OpenStack code-base less uniform (different project have different set of rules) 3) doesn’t reuse the same code, but encourages contributors to copy-paste the same rule to a dozen of repositories, which is a bad thing overall I believe that if you find yourself in a situation, where you want to add a custom check to repository — you should first consider adding this very check to hacking instead. On the other hand releasing a new version of hacking and bumping it’s version in global requirements (it’s currently pinned to <0.11), might be a painful process. Is there any procedure, that hacking (and/or OS community as a whole) follows, regarding those upgrades? -- Kirill Zaitsev Murano team Software Engineer Mirantis, Inc On 19 January 2016 at 16:38:56, Akihiro Motoki (amot...@gmail.com) wrote: 2016-01-19 18:58 GMT+09:00 Kekane, Abhishek <abhishek.kek...@nttdata.com>: > > > -Original Message- > From: Andreas Jaeger [mailto:a...@suse.com] > Sent: 19 January 2016 15:19 > To: OpenStack Development Mailing List (not for usage questions) > Subject: Re: [openstack-dev] [all][clients] Enable hacking in python-*clients > > On 2016-01-19 10:44, Abhishek Kekane wrote: >>> Hi Abishek, >> >>> In my understanding, hacking check is enabled for most (or all) of >> >>> python-*client. >> >>> For example, flake8 is run for each neutronclient review [1]. >> >>> test-requirements installs hacking, so I believe hacking check is enabled. >> >>> openstackclient and novaclient do the same [2] [3]. >> >>> Am I missing something? >> >> Hi Akhiro Motoki, >> >> Individual OpenStack projects has separate hacking module (e.g. >> nova/hacking/checks.py) which contains additional rules other than >> standard PEP8 errors/warnings. >> >> In similar mode can we do same in python-*clients? > > Let's share one common set of rules and not have each repo additional ones. > So, if those are useful, propose them for the hacking repo. Totally agree. > To answer your questions: Sure, it can be done but why? > > Because we can encounter this issues in local environments only, also we can > add custom checks like > 1. use six.string_types instead of basestring > 2. use dict.items or six.iteritems(dict) instead of dict.items > 3. checks on assertions etc. If you find hacking rules you feel useful for various projects, I would suggest you try to add them to the hacking repo first. If there is still a reasonable reasons to add the rules to individual repos, you can propose them (though I believe it is a rare care). I am not sure there are common rules specific to python-*client repos, but it seems this is not a case of yours as far as I read this thread. Akihiro > > Abhishek > > Andreas > -- > Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Felix Imendörffer, Jane Smithard, Graham Norton, > HRB 21284 (AG Nürnberg) > GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 > > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > __ > Disclaimer: This email and any attachments are sent in strictest confidence > for the sole use of the addressee and may contain legally privileged, > confidential, and proprietary data. If you are not the intended recipient, > please advise the sender by replying promptly to this email and then delete > and destroy this email and any attachments without any further use, copying > or forwarding. > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openst
Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
> Hi Abishek, > In my understanding, hacking check is enabled for most (or all) of > python-*client. > For example, flake8 is run for each neutronclient review [1]. > test-requirements installs hacking, so I believe hacking check is enabled. > openstackclient and novaclient do the same [2] [3]. > Am I missing something? Hi Akhiro Motoki, Individual OpenStack projects has separate hacking module (e.g. nova/hacking/checks.py) which contains additional rules other than standard PEP8 errors/warnings. In similar mode can we do same in python-*clients? Abhishek > [1] > http://git.openstack.org/cgit/openstack/python-neutronclient/tree/tox.ini#n26 > [2] > http://git.openstack.org/cgit/openstack/python-openstackclient/tree/tox.ini#n15 > [3] http://git.openstack.org/cgit/openstack/python-novaclient/tree/tox.ini#n24 From: Kekane, Abhishek [mailto:abhishek.kek...@nttdata.com] Sent: 19 January 2016 10:49 To: OpenStack Development Mailing List (openstack-dev@lists.openstack.org) Subject: [openstack-dev] [all][clients] Enable hacking in python-*clients Hi Devs, As of now all OpenStack projects has hacking checks which take cares about OpenStack guidelines issues are caught while running PEP8 checks using tox. There are no such checks in any of the python-*client. IMO its worth to enable hacking checks in python-*clients as well which will caught some guidelines issues in local environment only, Please let me know your opinion on the same. Thanks & Regards, Abhishek Kekane __ Disclaimer: This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding. __ Disclaimer: This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding.__ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
On 2016-01-19 10:44, Abhishek Kekane wrote: Hi Abishek, In my understanding, hacking check is enabled for most (or all) of python-*client. For example, flake8 is run for each neutronclient review [1]. test-requirements installs hacking, so I believe hacking check is enabled. openstackclient and novaclient do the same [2] [3]. Am I missing something? Hi Akhiro Motoki, Individual OpenStack projects has separate hacking module (e.g. nova/hacking/checks.py) which contains additional rules other than standard PEP8 errors/warnings. In similar mode can we do same in python-*clients? Let's share one common set of rules and not have each repo additional ones. So, if those are useful, propose them for the hacking repo. To answer your questions: Sure, it can be done but why? Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
-Original Message- From: Andreas Jaeger [mailto:a...@suse.com] Sent: 19 January 2016 15:19 To: OpenStack Development Mailing List (not for usage questions) Subject: Re: [openstack-dev] [all][clients] Enable hacking in python-*clients On 2016-01-19 10:44, Abhishek Kekane wrote: >> Hi Abishek, > >> In my understanding, hacking check is enabled for most (or all) of > >> python-*client. > >> For example, flake8 is run for each neutronclient review [1]. > >> test-requirements installs hacking, so I believe hacking check is enabled. > >> openstackclient and novaclient do the same [2] [3]. > >> Am I missing something? > > Hi Akhiro Motoki, > > Individual OpenStack projects has separate hacking module (e.g. > nova/hacking/checks.py) which contains additional rules other than > standard PEP8 errors/warnings. > > In similar mode can we do same in python-*clients? Let's share one common set of rules and not have each repo additional ones. So, if those are useful, propose them for the hacking repo. To answer your questions: Sure, it can be done but why? Because we can encounter this issues in local environments only, also we can add custom checks like 1. use six.string_types instead of basestring 2. use dict.items or six.iteritems(dict) instead of dict.items 3. checks on assertions etc. Abhishek Andreas -- Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ Disclaimer: This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding. __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
2016-01-19 18:58 GMT+09:00 Kekane, Abhishek <abhishek.kek...@nttdata.com>: > > > -Original Message- > From: Andreas Jaeger [mailto:a...@suse.com] > Sent: 19 January 2016 15:19 > To: OpenStack Development Mailing List (not for usage questions) > Subject: Re: [openstack-dev] [all][clients] Enable hacking in python-*clients > > On 2016-01-19 10:44, Abhishek Kekane wrote: >>> Hi Abishek, >> >>> In my understanding, hacking check is enabled for most (or all) of >> >>> python-*client. >> >>> For example, flake8 is run for each neutronclient review [1]. >> >>> test-requirements installs hacking, so I believe hacking check is enabled. >> >>> openstackclient and novaclient do the same [2] [3]. >> >>> Am I missing something? >> >> Hi Akhiro Motoki, >> >> Individual OpenStack projects has separate hacking module (e.g. >> nova/hacking/checks.py) which contains additional rules other than >> standard PEP8 errors/warnings. >> >> In similar mode can we do same in python-*clients? > > Let's share one common set of rules and not have each repo additional ones. > So, if those are useful, propose them for the hacking repo. Totally agree. > To answer your questions: Sure, it can be done but why? > > Because we can encounter this issues in local environments only, also we can > add custom checks like > 1. use six.string_types instead of basestring > 2. use dict.items or six.iteritems(dict) instead of dict.items > 3. checks on assertions etc. If you find hacking rules you feel useful for various projects, I would suggest you try to add them to the hacking repo first. If there is still a reasonable reasons to add the rules to individual repos, you can propose them (though I believe it is a rare care). I am not sure there are common rules specific to python-*client repos, but it seems this is not a case of yours as far as I read this thread. Akihiro > > Abhishek > > Andreas > -- > Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi >SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Felix Imendörffer, Jane Smithard, Graham Norton, > HRB 21284 (AG Nürnberg) > GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 > > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > __ > Disclaimer: This email and any attachments are sent in strictest confidence > for the sole use of the addressee and may contain legally privileged, > confidential, and proprietary data. If you are not the intended recipient, > please advise the sender by replying promptly to this email and then delete > and destroy this email and any attachments without any further use, copying > or forwarding. > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [all][clients] Enable hacking in python-*clients
Hi Devs, As of now all OpenStack projects has hacking checks which take cares about OpenStack guidelines issues are caught while running PEP8 checks using tox. There are no such checks in any of the python-*client. IMO its worth to enable hacking checks in python-*clients as well which will caught some guidelines issues in local environment only, Please let me know your opinion on the same. Thanks & Regards, Abhishek Kekane __ Disclaimer: This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding.__ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [all][clients] Enable hacking in python-*clients
Hi Abishek, In my understanding, hacking check is enabled for most (or all) of python-*client. For example, flake8 is run for each neutronclient review [1]. test-requirements installs hacking, so I believe hacking check is enabled. openstackclient and novaclient do the same [2] [3]. Am I missing something? [1] http://git.openstack.org/cgit/openstack/python-neutronclient/tree/tox.ini#n26 [2] http://git.openstack.org/cgit/openstack/python-openstackclient/tree/tox.ini#n15 [3] http://git.openstack.org/cgit/openstack/python-novaclient/tree/tox.ini#n24 2016-01-19 14:18 GMT+09:00 Kekane, Abhishek: > Hi Devs, > > > > As of now all OpenStack projects has hacking checks which take cares about > OpenStack guidelines issues are caught while running PEP8 checks using tox. > > There are no such checks in any of the python-*client. > > > > IMO its worth to enable hacking checks in python-*clients as well which will > caught some guidelines issues in local environment only, > > > > Please let me know your opinion on the same. > > > > Thanks & Regards, > > > > Abhishek Kekane > > > __ > Disclaimer: This email and any attachments are sent in strictest confidence > for the sole use of the addressee and may contain legally privileged, > confidential, and proprietary data. If you are not the intended recipient, > please advise the sender by replying promptly to this email and then delete > and destroy this email and any attachments without any further use, copying > or forwarding. > > __ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > __ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev