jetforce icon indicating copy to clipboard operation
jetforce copied to clipboard

Failure to install pyasn1 / cryptography / setuptools_rust

Open montsamu opened this issue 3 years ago • 2 comments

Following combination of virtualenv and git clone instructions leads to:

error: The 'pyasn1' distribution was not found and is required by service-identity

Commands typed:

cd projects/
git clone https://github.com/michael-lazar/jetforce
cd jetforce/
python3 -m venv venv
. ./venv/bin/activate
python setup.py install

Expected result: installation success, jetforce at venv/bin/jetforce

Actual result: error regarding 'pyasn1'.

Python version used: 3.7.3

Trying the obvious fix (adding pyasn1 to setup.py install_requires) resulted in a second error while building cryptography (3.4.4):

ModuleNotFoundError: No module named 'setuptools_rust'

This is I think an issue with the 'cryptography' package not properly identifying its own build requirements to include setuptools-rust. For jetforce, perhaps either documenting this issue, or requiring setuptools-rust in its own installRequires (undesired) until cryptography fixes this issue.

montsamu avatar Feb 13 '21 18:02 montsamu

Oof. Based on actually poking around cryptography for this, it looks like a very widespread issue:

https://github.com/pyca/cryptography/issues/5799

With the 'solution' being pinning to cryptography<3.4 and hoping that 3.3 security patches continue...

montsamu avatar Feb 13 '21 18:02 montsamu

Hey, thanks for the bug report! I've been following along with the cryptography news and I was wondering if anyone was going to run into this. I don't think there's anything that I can really do to help on my end. Pinning the requirement inside of jetforce feels wrong given this won't be an issue in most environments. And I don't maintain any downstream packages that would be affected.

You can always pin the cryptography version like this if you're installing from source

git clone https://github.com/michael-lazar/jetforce
cd jetforce/
python3 -m venv venv
. ./venv/bin/activate
python -m pip install . cryptography==3.3

or if installing from PyPI

python -m pip install jetforce cryptography==3.3

I'll keep this ticket open and in case people want to document future updates here

michael-lazar avatar Feb 16 '21 03:02 michael-lazar