swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

Can't install with pip 20 #74

Closed WickedShell closed 4 years ago

WickedShell commented 4 years ago

With pip 20.1 installing fails due to the following error:

$ pip install edn_format
Collecting edn_format
  Downloading edn_format-0.7.1.tar.gz (18 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/runner/ardupilot/python3-env/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o3m17uee/edn-format/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o3m17uee/edn-format/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-z0lgf504
         cwd: /tmp/pip-install-o3m17uee/edn-format/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-o3m17uee/edn-format/setup.py", line 11, in <module>
        requirements = [str(ir.req) for ir in parse_requirements('requirements.txt', session=False)]
      File "/tmp/pip-install-o3m17uee/edn-format/setup.py", line 11, in <listcomp>
        requirements = [str(ir.req) for ir in parse_requirements('requirements.txt', session=False)]
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

It appears that parse_requirements changed such that the setup is now broken. I don't use python enough to be sure, but it appears that using this directly is generally not considered a good idea.

swaroopch commented 4 years ago

Thanks @WickedShell for informing us! Unfortunately, I won't be able to look into this until the weekend.

bfontaine commented 4 years ago

Seems like pip’s internal API changed. I made a PR to read the requirements.txt file without relying on that API: https://github.com/swaroopch/edn_format/pull/75

WickedShell commented 4 years ago

Thanks for fixing it so rapidly!