Election-Tech-Initiative/electionguard-python

๐Ÿž electionguard-python fails to install dependencies

alecslupu opened this issue ยท 0 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When trying to install and use electionguard-python, there is an error when trying to install dependencies.
When running make install the following output is being presented:

๐Ÿ”ง INSTALL
poetry install
Installing dependencies from lock file

Package operations: 131 installs, 0 updates, 0 removals

  โ€ข Installing attrs (21.4.0): Failed

  AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:54 in dumps
       50โ”‚                 ),
       51โ”‚                 u"status": response.status,
       52โ”‚                 u"version": response.version,
       53โ”‚                 u"reason": text_type(response.reason),
    โ†’  54โ”‚                 u"strict": response.strict,
       55โ”‚                 u"decode_content": response.decode_content,
       56โ”‚             }
       57โ”‚         }
       58โ”‚ 

  โ€ข Installing pycparser (2.21): Failed

  AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:54 in dumps
       50โ”‚                 ),
       51โ”‚                 u"status": response.status,
       52โ”‚                 u"version": response.version,
       53โ”‚                 u"reason": text_type(response.reason),
    โ†’  54โ”‚                 u"strict": response.strict,
       55โ”‚                 u"decode_content": response.decode_content,
       56โ”‚             }
       57โ”‚         }
       58โ”‚ 

  โ€ข Installing pyrsistent (0.18.1): Failed

  AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:54 in dumps
       50โ”‚                 ),
       51โ”‚                 u"status": response.status,
       52โ”‚                 u"version": response.version,
       53โ”‚                 u"reason": text_type(response.reason),
    โ†’  54โ”‚                 u"strict": response.strict,
       55โ”‚                 u"decode_content": response.decode_content,
       56โ”‚             }
       57โ”‚         }
       58โ”‚ 

  โ€ข Installing six (1.16.0): Failed

  TypeError

  __init__() got an unexpected keyword argument 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:141 in prepare_response
      137โ”‚             #
      138โ”‚             #     TypeError: 'str' does not support the buffer interface
      139โ”‚             body = io.BytesIO(body_raw.encode("utf8"))
      140โ”‚ 
    โ†’ 141โ”‚         return HTTPResponse(body=body, preload_content=False, **cached["response"])
      142โ”‚ 
      143โ”‚     def _loads_v0(self, request, data, body_file=None):
      144โ”‚         # The original legacy cache data. This doesn't contain enough
      145โ”‚         # information to construct everything we need, so we'll treat this as

  โ€ข Installing traitlets (5.1.1): Failed

  AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:54 in dumps
       50โ”‚                 ),
       51โ”‚                 u"status": response.status,
       52โ”‚                 u"version": response.version,
       53โ”‚                 u"reason": text_type(response.reason),
    โ†’  54โ”‚                 u"strict": response.strict,
       55โ”‚                 u"decode_content": response.decode_content,
       56โ”‚             }
       57โ”‚         }
       58โ”‚ 

  โ€ข Installing zipp (3.8.0): Failed

  AttributeError

  'HTTPResponse' object has no attribute 'strict'

  at ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/cachecontrol/serialize.py:54 in dumps
       50โ”‚                 ),
       51โ”‚                 u"status": response.status,
       52โ”‚                 u"version": response.version,
       53โ”‚                 u"reason": text_type(response.reason),
    โ†’  54โ”‚                 u"strict": response.strict,
       55โ”‚                 u"decode_content": response.decode_content,
       56โ”‚             }
       57โ”‚         }
       58โ”‚ 

make: *** [Makefile:25: install] Error 1

Expected Behavior

running make environment && make install should be successful.

Steps To Reproduce

No response

Environment

- OS: Ubuntu 22.04

Anything else?

Solution proposed by psf/cachecontrol#292 is to upgrade poetry version to 1.4.2

I have tested locally, and works as expected. The line needed to be changed is:
https://github.com/microsoft/electionguard-python/blob/b3ddc2a732f6c5f078a3afbe05b00d632a2ff5e0/Makefile#LL17C2-L17C31