testing-cabal / linecache2

Backport of the Python stdlib linecache module
1 stars 5 forks source link

SyntaxError while building with Python 2.7.5 #12

Closed smoretti closed 6 years ago

smoretti commented 7 years ago

Hi

I have an issue while installing the library with Python 2.7.5 (It if fine with Python 3.4.1). setup.py build step looks fine but setup.py install step returns this error:

File "/software/lib/python2.7/site-packages/linecache2/tests/inspect_fodder2.py", line 102 def keyworded(*arg1, arg2=1): ^ SyntaxError: invalid syntax

prat0318 commented 7 years ago

Same here.

jenisys commented 6 years ago

That happens also for me when I try to install my package with python setup.py install that indirectly depends on linecache2 (via traceback2) and linecache2 is not installed yet. This is a major annoyance.

NOTE: This problem does not occur when everything is installed with pip.

rbtcollins commented 6 years ago

This is happening in the precompilation of .pyc files and should be entirely harmless.

jenisys commented 6 years ago

Sorry, I disagree. It causes certain package installation scenarios to fail.

rbtcollins commented 6 years ago

Please provide more details then.

jenisys commented 6 years ago

I must correct myself. This was a major nuisance in the past because it prevented me from installing my project which depended on traceback2 which depended on linecache2. I always needed manual steps to overcome the problem. As stated above installation of the source package caused the problem. Fixes around pip, setuptools, wheel, etc. seem to have solved this problem.

Now it just looks bad when you see errors during the installation process of a package. It makes me normally think that the project/package maintainer does not care about the provided package.

rbtcollins commented 6 years ago

I can understand that; however the issue here is that thsi is a test file that we need to introspect python3 features, so it literally cannot be compatible with python2. Its not loaded at runtime, and is only tested conditionally on python3.