Closed KevinMFong closed 2 years ago
Thank you @KevinMFong for your PR!
No problem, thanks for maintaining this package!
breaks compatibility while installing with Python2.7 and pip==20.1.1
Can you use pyparsing>=2.0.0,<3
instead?
Error:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ZN7btg/pyhocon/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ZN7btg/pyhocon/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-iAh70E
cwd: /tmp/pip-install-ZN7btg/pyhocon/
Complete output (1 lines):
error in pyhocon setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
Related Open PR: https://github.com/chimpler/pyhocon/pull/276/commits
As the failing CI in #276 shows, there is an additional problem with pyparsing 3.0 (in addition to the SyntaxError on 3.5).
As another addition to this: Since the release of pyparsing==3.0.7
the following HOCON will not parse and exit with a pyparsing exception, using either pyhocon==0.3.58
(or pyhocon==0.3.59
with pyparsing replaced with the latest 3.0.7
):
a = 1
w = 2
Exception
pyparsing.exceptions.ParseException: Expected end of text, found '=' (at char 8), (line:2, col:3)
It seems to be related to the time period keywords. So apparently the issue occurs because the line break between the assignments is interpreted as a white space, resulting in it being read as a = 1 w(eek) [...]
where the following =
obviously does not make sense anymore.
The issue seems to be known on pyparsing side: https://github.com/pyparsing/pyparsing/issues/359
Summary
Update
pyparsing
install_requires
lock insetup.py
to be more strict and prevent installingpyparsing>=3
when installingpyhocon
.The recent
pyparsing
v3 release dropped support for Python 3.5. Without this change, runningpyhocon
on Python 3.5 can result inSyntaxError
errors.