[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [MoM] lefse migration to python 3



Hello Andreas,

> Your 2to3 patch looks pretty long.  What I'm doing for the conversion
> is the following:
>
>    find . -name "*.py" -exec 2to3 -w \{\} \;
>    find . -name "*.py" -exec sed -i '1s:#!/usr/bin/env
python:#!/usr/bin/python3:' \{\} \;
>    git diff > debian/patches/2to3.patch
>    git stash
>    find . -name "*.bak" -delete
>
> This leads to a way shorter patch than yours mostly single lines
> and not replacements of whole functions.  How did you created your
> patch?

Oh I see. I did:

2to3 --nobackups --write *.py recursively in the main working directory
and lefsebiom folder
autopep8 -i *.py to ensure pep8 compliancy
git diff > debian/patches/2to3.patch
git stash

and allowed dh_python3 to replace the shebang instead of using sed.

I assumed single line replacements not to be possible with the method I
was doing and whole block diff changes the only way. I see what you've
done now.

> BTW, I also add DEP3 headers with the fields
>     Description
>     Author
>     Last-Updated
>     Bug-Debian

Thanks. I was leaving that at the end just so I wasn't sure if the patch
needed redoing.

Kind regards,
Shayan Doust

On 06/09/2019 20:33, Andreas Tille wrote:
> Hi Shayan,
> 
> On Fri, Sep 06, 2019 at 04:57:30PM +0100, Shayan Doust wrote:
>> I think I have done everything to make this package work with python 3
>> and deprecate usage of python 2. First time touching python so I would
>> rather have someone quickly check this before I append a changelog and
> 
> Your 2to3 patch looks pretty long.  What I'm doing for the conversion
> is the following:
> 
>    find . -name "*.py" -exec 2to3 -w \{\} \;
>    find . -name "*.py" -exec sed -i '1s:#!/usr/bin/env python:#!/usr/bin/python3:' \{\} \; 
>    git diff > debian/patches/2to3.patch
>    git stash
>    find . -name "*.bak" -delete
> 
> This leads to a way shorter patch than yours mostly single lines
> and not replacements of whole functions.  How did you created your
> patch?
> 
> BTW, I also add DEP3 headers with the fields
>     Description
>     Author
>     Last-Updated
>     Bug-Debian
> 
> Kind regards
> 
>       Andreas.
> 

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: