chimpler / pyhocon

HOCON parser for Python
Apache License 2.0
502 stars 118 forks source link

Update pyparsing requires lock to be more strict #275

Closed KevinMFong closed 2 years ago

KevinMFong commented 2 years ago

Summary

Update pyparsing install_requires lock in setup.py to be more strict and prevent installing pyparsing>=3 when installing pyhocon.

The recent pyparsing v3 release dropped support for Python 3.5. Without this change, running pyhocon on Python 3.5 can result in SyntaxError errors.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 96.154% when pulling 39f79e2557a050ecc18410098763d03bf8ee6a7e on KevinMFong:requirements into 091830001f2d44f91f0f8281fb119c87fd1f6660 on chimpler:master.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 96.154% when pulling 39f79e2557a050ecc18410098763d03bf8ee6a7e on KevinMFong:requirements into 091830001f2d44f91f0f8281fb119c87fd1f6660 on chimpler:master.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 96.154% when pulling 39f79e2557a050ecc18410098763d03bf8ee6a7e on KevinMFong:requirements into 091830001f2d44f91f0f8281fb119c87fd1f6660 on chimpler:master.

darthbear commented 2 years ago

Thank you @KevinMFong for your PR!

KevinMFong commented 2 years ago

No problem, thanks for maintaining this package!

immortalyash commented 2 years ago

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
immortalyash commented 2 years ago

Related Open PR: https://github.com/chimpler/pyhocon/pull/276/commits

scottj97 commented 2 years ago

As the failing CI in #276 shows, there is an additional problem with pyparsing 3.0 (in addition to the SyntaxError on 3.5).

sbachstein commented 2 years ago

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