linkedin / shiv

shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441, but with all their dependencies included.
BSD 2-Clause "Simplified" License
1.73k stars 94 forks source link

enable shiv with no pip_args nor site_packages #214

Closed sdementen closed 1 year ago

sdementen commented 2 years ago

Currently shiv does not support to provide empty pip_args or no site_packages in the CLI. This PR fixes that and also adapt the create_archive to handle an empty /site-packages/ folder. It also ensures that the pip_args is a list of str. If pip_args is just a str, it will be splitted (today, if pip_args=="pip", it will install the "p" and the "i" package)

lorencarvalho commented 2 years ago

Hi @sdementen,

I am curious what the purpose of this PR is, if there are no dependencies to include, I would imagine that Python's own zipapp module would be sufficient, no?

sdementen commented 2 years ago

hi @lorencarvalho, it allows to deliver a .pyz that runs a specific python interpreter (via the shebang line) and run some preamble code

lorencarvalho commented 1 year ago

@sdementen I see, that's a bit divergent from the purpose of shiv, a problem that might be better solved in a deployment tool.