Update setup.py to be compatible with pipenv by georgiemathews · Pull Request #24789 · huggingface/transformers (original) (raw)

I'm confused. install_requires is already a list as seen on line 415.

Thanks for taking a look @sgugger!

It seems to be a requirementslib bug that occurs when one of the items in the list of dependencies is declared with a string interpolation..

I'm not sure why using the list constructor fixes the bug. This is the behavior when installing transformers through pipenv without the bugfix:

$ pipenv install git+https://github.com/huggingface/transformers#egg=transformers
Installing git+https://github.com/huggingface/transformers@v4.30.0#egg=transformers...
Resolving
git+https://github.com/huggingface/transformers@v4.30.0#egg=transformers...
✘ Locking Failed!
Traceback (most recent call last):
  ...
  File "/home/gmathews/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 659, in _find_install_requires
    return [el.s for el in variable.elts]
  File "/home/gmathews/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 659, in <listcomp>
    return [el.s for el in variable.elts]
AttributeError: 'Subscript' object has no attribute 's'