Dear Piotr,

I maintain the package "turing", which build-depends on python-jedi. 
I found the reason why python-jedi FTBFS: setup.py tries to find out
the package's version by parsing jedi/__init__.py, but the parse tree
was interpreted in two different ways, depending on python's version.

I checked that the right expressions to access the package's version is
always `tree.body[1].value.s` and never `tree.body[0].value.s`, so I
simplified the source code.

Please find attached the patch used by quilt to fix this bug.

In case you have no time to publish a new version of your package, I am
pushing it as a NMU into DELAYED+15.

Best regards,                   Georges.

-- 
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70

Cleaned out an alternative to assign the variable 'version' for
the package, which was not accessed in the same way, depending on
Python language's version.

It looked like a non-documented workaround to compensate some weird
behavior of an older version of the module ast.
Index: python-jedi-0.12.0/setup.py
===================================================================
--- python-jedi-0.12.0.orig/setup.py
+++ python-jedi-0.12.0/setup.py
@@ -11,10 +11,7 @@ __AUTHOR_EMAIL__ = 'davidhalter88@gmail.
 # Get the version from within jedi. It's defined in exactly one place now.
 with open('jedi/__init__.py') as f:
     tree = ast.parse(f.read())
-if sys.version_info > (3, 7):
-    version = tree.body[0].value.s
-else:
-    version = tree.body[1].value.s
+version = tree.body[1].value.s
 
 readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read()
 with open('requirements.txt') as f:

Attachment: signature.asc
Description: PGP signature

Reply via email to