linkedin / linkedin/shiv

use shiv as "transparent" package compressor

Open
#109 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

Hello,

I have use cases where I want to deploy a "compact" python distribution in terms of files and Mb.
I am using the python embedded distribution + shiv to come down to ~35 files and 48 Mb on windows with pandas+matplotlib which is what I want.
However, the core entry point of the distribution should still be the python.exe and not the shiv file (I am using the python/powerBI itnerface that requires a python.exe).

So I am ending doing some "dark magic" in the sitecustomize.py to boostrap the "extra.pyz" (containing all dependencies not packaged with the python embedded distribution: pandas, matplotlib, etc) by reusing the logic of the `_bootstrap.bootstrap()` method but without the last part (the `run` or `execute_interpreter` call) which works.

Would there be some interest to add this use case (supporting on the fly cache compressed packages including .dll/.so files) to shiv capabilities ?

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 by reading shiv's _bootstrap.bootstrap() logic and the existing sitecustomize.py workaround described in the issue, with attention to extra.pyz and the Python embedded distribution. Define support for using python.exe as the entry point while loading compressed packages, including .dll and .so files, and verify the resulting distribution remains compact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.