peterbe / peterbe/hashin

Hashin fails to use ABI binaries (PEP 425)

Open
#62 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
107
Forks
31
PR merge metrics
No merged PRs in 30d

Description

I found this trying to install cryptography. It publishes an ABI3 which pip uses on a python 3.6 system

/tmp > virtualenv -p python3.6 ve
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr/local/lib/python3.6.2'
New python executable in /tmp/ve/bin/python3.6
Also creating executable in /tmp/ve/bin/python
Installing setuptools, pip, wheel...done.

/tmp > ve/bin/pip install cryptography==2.2.2
Collecting cryptography==2.2.2
  Using cached cryptography-2.2.2-cp34-abi3-manylinux1_x86_64.whl
Collecting idna>=2.1 (from cryptography==2.2.2)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting six>=1.4.1 (from cryptography==2.2.2)
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography==2.2.2)
  Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography==2.2.2)
  Using cached cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography==2.2.2)
Installing collected packages: idna, six, asn1crypto, pycparser, cffi, cryptography
Successfully installed asn1crypto-0.24.0 cffi-1.11.5 cryptography-2.2.2 idna-2.6 pycparser-2.18 six-1.11.0

Annoyingly hashin doesn't choose the same version when generating it's hashes

tmp > ve/bin/hashin --verbose cryptography==2.2.2 --python-version 3.6
https://pypi.org/pypi/cryptography/json
* Found URL https://files.pythonhosted.org/packages/90/c9/3164aec0c129e0753bd92201b69f1dd859e29b243f516daab2d48557cb9f/cryptography-2.2.2-cp36-cp36m-win32.whl
*   Hash f6c821ac253c19f2ad4c8691633ae1d1a17f120d5b01ea1d256d7b602bc59887
* Found URL https://files.pythonhosted.org/packages/67/62/67faef32908026e816a74b4b97491f8b9ff393d2951820573599c105cc32/cryptography-2.2.2-cp36-cp36m-win_amd64.whl
*   Hash ba6a774749b6e510cffc2fb98535f717e0e5fd91c7c99a61d223293df79ab351
* Found URL https://files.pythonhosted.org/packages/ec/b2/faa78c1ab928d2b2c634c8b41ff1181f0abdd9adf9193211bd606ffa57e2/cryptography-2.2.2.tar.gz
*   Hash 9fc295bf69130a342e7a19a39d7bbeb15c0bcaabc7382ec33ef3b2b7d18d2f63
* Editing requirements.txt

Which means pip will fail with --require-hashes when trying to install from requirements.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with ve/bin/hashin --verbose cryptography==2.2.2 --python-version 3.6 and compare its output with pip's selected cryptography-2.2.2-cp34-abi3-manylinux1_x86_64.whl. Trace the package URL selection and requirements.txt editing path; done means the generated hashes include the ABI3 binary pip selects and install successfully with --require-hashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.