On Tue, Aug 9, 2016 at 12:36 PM, Eyal Edri <eedri@redhat.com> wrote:
Adding infra also, as might be relevant for our code.

On Tue, Aug 9, 2016 at 11:06 AM, Sandro Bonazzola <sbonazzo@redhat.com> wrote:
Hi,
in project maintained by integration team we tried to adhere to some styling rules while writing python code, one of these was related to the import lines. After a lot of time doing this manually, we discovered isort ( https://pypi.python.org/pypi/isort/4.2.5 )


Available in fedora 24 updates-testing as python-isort, should land to stable pretty soon.

 
We're using it before we push our code to gerrit and a few days ago I sent a patch for the python code within ovirt-engine: https://gerrit.ovirt.org/61964

Going to merge this tomorrow.

 

The configuration we're currently using is:

$ cat ~/.isort.cfg [settings] line_length=79 known_standard_library=configparser,Cheetah.Template force_single_line=True default_section=FIRSTPARTY known_otopi=otopi known_host_deploy=ovirt_host_deploy known_ovirt_engine=ovirt_engine known_ovirt_engine_setup=ovirt_engine_setup known_ovirt_setup_lib=ovirt_setup_lib known_vdsm=vdsm known_ovirt_hosted_engine_setup=ovirt_hosted_engine_setup sections=FUTURE,STDLIB,FIRSTPARTY,OTOPI,VDSM,HOST_DEPLOY,OVIRT_ENGINE,OVIRT_ENGINE_SETUP,OVIRT_SETUP_LIB,OVIRT_HOSTED_ENGINE_SETUP,THIRDPARTY,LOCALFOLDER lines_between_types=2

It has been proposed to add 'isort --check-only' in check-patch.for python projects in addition to pep8 style checking.


No objections, I take this as approved. Opening a ticket.
 

It has also been proposed to reach consensus on isort configuration so all the python code
within ovirt project will have same styling.

No suggestions, I take proposed config as approved as a start. We can amend it later on.
 

I'd like to get some feedback about these proposal in order to decide how to procede.

Thanks,

--
Sandro Bonazzola
Better technology. Faster innovation. Powered by community collaboration.
See how it works at redhat.com

_______________________________________________
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel



--
Eyal Edri
Associate Manager
RHV DevOps
EMEA ENG Virtualization R&D
Red Hat Israel

phone: +972-9-7692018
irc: eedri (on #tlv #rhev-dev #rhev-integ)



--
Sandro Bonazzola
Better technology. Faster innovation. Powered by community collaboration.
See how it works at redhat.com