linkedin / linkedin/shiv

support for packages with a .pth file

Open
#223 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

When creating a pyz file with dependencies "requests pip_system_certs", the file "pip_system_certs.pth" extracted in the ~/.shiv/pyzfolder/site-packages is not handled (tested by running `import requests; requests.get("https://some.website.needing.system.certificate.store")` which triggers a `'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'` error)

Would it be possible to make the ~/.shiv/pyzfolder/site-packages folder be considered as one of the directory with .pth that are handled ?

Or automatically run the following code (will handle the .pth files in the folder) during the bootstrap ?
```python
import site
site.addsitedir("~/.shiv/pyzfolder/site-packages")
site.main()
```

Contributor guide

Open the contributing guide

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 at shiv's bootstrap path and reproduce a pyz built with the requests and pip_system_certs dependencies. Verify how ~/.shiv/pyzfolder/site-packages is handled and whether pip_system_certs.pth is processed; done means the packaged HTTPS request succeeds without the certificate verification error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.