Open FRidh opened 8 years ago
I can't reproduce this, I have pystache 0.5.4 installed on Python 3.5.1 and it works.
I have the same issue. I am using Python '3.3.5 (default, Jun 15 2016, 19:45:40) [MSC v.1800 32 bit (Intel)]' installed in LibreOffice installation 5.1.4.2 (32bit) on Windows 7 (64bit).
I just installed pip 6.1.1. and install pystache 0.5.4.
After executionf the import pystache
a get the same error.
Found the same issue with Python 3.6.3. Apparently pip did not update pystache code from Python 2 to Python 3 during installation (the SyntaxError initially reported stems from the invalid ur string specifier in Python 3). Solved running manually 2to3 on the pystache installation folder as per the installation instructions:
2to3 --write --nobackups --no-diffs site-packages\pystache
I'm getting this same issue in Python 3.7.6
Same issue with Python 3.6.10, pip (both 18.1 and latest 20.0.2) and pystache 0.5.4. Didn't have the issue with 3.6.1.
This seems to be a problem with 2to3. When I run "python -m lib2to3" with Python 3.6.1 on the pystache site-packages directory I get a list of changes that would be made. When I run with Python 3.6.10 I simply get:
RefactoringTool: No files need to be modified.
Problem went away when I removed this post-build step from our Python build:
# Pre-compile all .py files to .pyc and delete .py files
./bin/python3 -m compileall -bf .
find . -name "__pycache__" -type d -print0 | xargs -0 /bin/rm -rf
find . -name "*.py" -type f -print0 | xargs -0 /bin/rm -rf
I've not investigated why this caused the issue.
From the readme
Pystache is written in Python 2 and must be converted to Python 3 prior to using it with Python 3. The installation process (and tox) do this automatically.
It seems that the last working build is with pip 20.3.3. After that, the build step that compiles python2 code to python3 seems to be skipped. (see below, the real issue is setuptools)
From https://github.com/nicolargo/glances/issues/1793#issuecomment-765922759
it looks like it relies on lib2to3 to work in Python 3 and there are issues with 2to3 which is noted to be unstable with Python 3.9 and deprecated in 3.10
I am sorry to say that this signals that the project is indeed abandoned and people should look elsewhere - https://github.com/defunkt/pystache/pull/213
Scratch the above message. The actual reason the build is failing is not pip but setuptools.
From https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v5800
v58.0.0
Breaking Changes
#2086: Removed support for 2to3 during builds. Projects should port to a unified codebase or pin to an older version of Setuptools using PEP 518 build-requires.
So, starting today, environments that pull in the new release of setuptools (v58 or later) will fail to build pystache.
I have forked pystache and dropped support for python2 in order to avoid this issue here – https://github.com/PennyDreadfulMTG/pystache
Tested with python 3.4 and 3.5