Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #11073 > unrolled thread

Allow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode)

Started byAdam Cécile <acecile@le-vert.net>
First post2018-11-08 09:30 +0100
Last post2018-11-19 22:40 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.debian.maint.python


Contents

  Allow installation on buster of a package not supporting 3.7  (async/await syntax error when generating bytecode) Adam Cécile <acecile@le-vert.net> - 2018-11-08 09:30 +0100
    Re: Allow installation on buster of a package not supporting 3.7  (async/await syntax error when generating bytecode) Nicolas Dandrimont <olasd@debian.org> - 2018-11-08 14:40 +0100
      Re: Allow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode) Adam Cecile <acecile@le-vert.net> - 2018-11-09 18:50 +0100
        Re: Allow installation on buster of a package not supporting 3.7  (async/await syntax error when generating bytecode) Adam Cécile <acecile@le-vert.net> - 2018-11-09 23:30 +0100
    Re: Allow installation on buster of a package not supporting 3.7  (async/await syntax error when generating bytecode) Thomas Goirand <zigo@debian.org> - 2018-11-19 22:40 +0100

#11073 — Allow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode)

FromAdam Cécile <acecile@le-vert.net>
Date2018-11-08 09:30 +0100
SubjectAllow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode)
Message-ID<wRNRn-17G-1@gated-at.bofh.it>
Hello list,


I have a package working perfectly fine on Pyrhon 3.6 but using 
async/await methods so it cannot work on python 3.7 at the moment.
During package compilation, I popd 3.7 from supported version returned 
by py3version and it allows me to build the package just fine:

Problem: I cannot install it. Despite 3.7 was not "enabled" during 
build, when installing debian helpers try to compile bytecode for both 
3.6 and 3.7 and fails. Is there any way to workaround that ?



Thanks in advance,

Adam.


PS: I'm aware this is transitional and the package MUST support 3.7, but 
I kinda need a fast workaround, like right now.

[toc] | [next] | [standalone]


#11082

FromNicolas Dandrimont <olasd@debian.org>
Date2018-11-08 14:40 +0100
Message-ID<wRSHn-40q-9@gated-at.bofh.it>
In reply to#11073

[Multipart message — attachments visible in raw view] — view raw

Hi!

* Adam Cécile <acecile@le-vert.net> [2018-11-08 09:15:59 +0100]:

> Hello list,
> 
> 
> I have a package working perfectly fine on Pyrhon 3.6 but using async/await
> methods so it cannot work on python 3.7 at the moment.
> During package compilation, I popd 3.7 from supported version returned by
> py3version and it allows me to build the package just fine:
> 
> Problem: I cannot install it. Despite 3.7 was not "enabled" during build,
> when installing debian helpers try to compile bytecode for both 3.6 and 3.7
> and fails. Is there any way to workaround that ?

You can use the bcep (bytecompile exception pattern) mechanism. The
documentation can be found in dh_python3(1)[1] and
/usr/share/doc/dh-python/README.PyDist, and you can find some examples in
codesearch.

[1] https://manpages.debian.org/unstable/dh-python/dh_python3.1.en.html#bcep_files

HTH,
-- 
Nicolas Dandrimont

BOFH excuse #227:
Fatal error right in front of screen

[toc] | [prev] | [next] | [standalone]


#11089 — Re: Allow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode)

FromAdam Cecile <acecile@le-vert.net>
Date2018-11-09 18:50 +0100
SubjectRe: Allow installation on buster of a package not supporting 3.7 (async/await syntax error when generating bytecode)
Message-ID<wSj4T-3xC-25@gated-at.bofh.it>
In reply to#11082

[Multipart message — attachments visible in raw view] — view raw

Thanks a lot Nicolas !

It looks perfect, I made the modification but haven't been able to test it yet.

Le 8 novembre 2018 14:26:07 GMT+01:00, Nicolas Dandrimont <olasd@debian.org> a écrit :
>Hi!
>
>* Adam Cécile <acecile@le-vert.net> [2018-11-08 09:15:59 +0100]:
>
>> Hello list,
>> 
>> 
>> I have a package working perfectly fine on Pyrhon 3.6 but using
>async/await
>> methods so it cannot work on python 3.7 at the moment.
>> During package compilation, I popd 3.7 from supported version
>returned by
>> py3version and it allows me to build the package just fine:
>> 
>> Problem: I cannot install it. Despite 3.7 was not "enabled" during
>build,
>> when installing debian helpers try to compile bytecode for both 3.6
>and 3.7
>> and fails. Is there any way to workaround that ?
>
>You can use the bcep (bytecompile exception pattern) mechanism. The
>documentation can be found in dh_python3(1)[1] and
>/usr/share/doc/dh-python/README.PyDist, and you can find some examples
>in
>codesearch.
>
>[1]
>https://manpages.debian.org/unstable/dh-python/dh_python3.1.en.html#bcep_files
>
>HTH,
>-- 
>Nicolas Dandrimont
>
>BOFH excuse #227:
>Fatal error right in front of screen

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

[toc] | [prev] | [next] | [standalone]


#11090

FromAdam Cécile <acecile@le-vert.net>
Date2018-11-09 23:30 +0100
Message-ID<wSnrP-6o1-1@gated-at.bofh.it>
In reply to#11089

[Multipart message — attachments visible in raw view] — view raw

Just tried but it's not working:

I wrote:

dir|3.7-|/usr/lib/python3/dist-packages/tensorflow/

But installing the package gives:

Traceback (most recent call last):
   File "/usr/bin/py3compile", line 290, in <module>
     main()
   File "/usr/bin/py3compile", line 266, in main
     e_patterns = get_exclude_patterns()
   File "/usr/bin/py3compile", line 93, in get_exclude_patterns
     for type_, vers, dname, pattern in get_exclude_patterns_from_dir():
   File "/usr/share/python3/debpython/__init__.py", line 22, in __call__
     self.cache[key] = self.func(*args, **kwargs)
   File "/usr/bin/py3compile", line 68, in get_exclude_patterns_from_dir
     type_, vrange, dname, pattern = line.split('|', 3)
ValueError: not enough values to unpack (expected 4, got 3)

I'm wondering if the "dir" type is actually supported: "re" type 
contains the appropriate number of fields.

Regards, Adam.

On 11/9/18 6:43 PM, Adam Cecile wrote:
> Thanks a lot Nicolas !
>
> It looks perfect, I made the modification but haven't been able to 
> test it yet.
>
> Le 8 novembre 2018 14:26:07 GMT+01:00, Nicolas Dandrimont 
> <olasd@debian.org> a écrit :
>
>     Hi!
>
>     * Adam Cécile <acecile@le-vert.net> [2018-11-08 09:15:59 +0100]:
>
>         Hello list, I have a package working perfectly fine on Pyrhon
>         3.6 but using async/await methods so it cannot work on python
>         3.7 at the moment. During package compilation, I popd 3.7 from
>         supported version returned by py3version and it allows me to
>         build the package just fine: Problem: I cannot install it.
>         Despite 3.7 was not "enabled" during build, when installing
>         debian helpers try to compile bytecode for both 3.6 and 3.7
>         and fails. Is there any way to workaround that ? 
>
>
>     You can use the bcep (bytecompile exception pattern) mechanism. The
>     documentation can be found in dh_python3(1)[1] and
>     /usr/share/doc/dh-python/README.PyDist, and you can find some examples in
>     codesearch.
>
>     [1]https://manpages.debian.org/unstable/dh-python/dh_python3.1.en.html#bcep_files
>
>     HTH,
>
>
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez 
> excuser ma brièveté. 


[toc] | [prev] | [next] | [standalone]


#11101

FromThomas Goirand <zigo@debian.org>
Date2018-11-19 22:40 +0100
Message-ID<wVZqV-89D-23@gated-at.bofh.it>
In reply to#11073
On 11/8/18 9:15 AM, Adam Cécile wrote:
> Hello list,
> 
> 
> I have a package working perfectly fine on Pyrhon 3.6 but using
> async/await methods so it cannot work on python 3.7 at the moment.
> During package compilation, I popd 3.7 from supported version returned
> by py3version and it allows me to build the package just fine:
> 
> Problem: I cannot install it. Despite 3.7 was not "enabled" during
> build, when installing debian helpers try to compile bytecode for both
> 3.6 and 3.7 and fails. Is there any way to workaround that ?
> 
> 
> 
> Thanks in advance,
> 
> Adam.

Hi,

Unless your package has "async" or "await" as API, you should ...

...simply patch the bad code so that it doesn't include await / async
where it should not. I did this extensively for OpenStack, and that's
really not hard to do.

The most annoying one was Glance, as one of its folder was named
"async". It's annoying because a patch file cannot rename a folder with
zero byte files (and in Python, there's many __init__.py files...). So,
one has to rename the folder in debian/rules, and the rest of the patch
is done as usual (except that it's done *before* the folder rename).

I hope this helps,

Cheers,

Thomas Goirand (zigo)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web