Skip to main content

A command line utility for building fully self contained Python zipapps.

Project description

[![PyPI](https://img.shields.io/pypi/v/shiv.svg)](https://pypi.python.org/pypi/shiv)
[![Build Status](https://travis-ci.org/linkedin/shiv.svg?branch=master)](https://travis-ci.org/linkedin/shiv)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/vb9yht30n0iuy4y9?svg=true)](https://ci.appveyor.com/project/sixninetynine/shiv)
[![Coverage Status](https://coveralls.io/repos/github/linkedin/shiv/badge.svg)](https://coveralls.io/github/linkedin/shiv)
[![Documentation Status](https://readthedocs.org/projects/shiv/badge/?version=latest)](http://shiv.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Supported](https://img.shields.io/pypi/pyversions/shiv.svg)](https://pypi.python.org/pypi/shiv)

![snake](logo.png)

# shiv
shiv is a command line utility for building fully self-contained Python zipapps as outlined in [PEP 441](https://www.python.org/dev/peps/pep-0441/), but with all their dependencies included!

shiv's primary goal is making distributing Python applications fast & easy.

Full documentation can be found [here](http://shiv.readthedocs.io/en/latest/).

### sys requirements

- python3.6+
- linux/osx/windows

### how to

shiv has a few command line options of its own and accepts almost all options passable to `pip install`.

##### simple cli example

Creating an executable of pipenv with shiv:

```sh
$ shiv -c pipenv -o ~/bin/pipenv pipenv pew
$ ~/bin/pipenv --version
pipenv, version 2018.05.18
```

##### complex example involving a wheel cache

Creating an interactive executable with a downloaded wheel of boto:

```sh
$ python3 -m pip download boto
Collecting boto
File was already downloaded /tmp/tmp.iklsO1qyd3/boto-2.48.0-py2.py3-none-any.whl
Successfully downloaded boto
$ shiv -o boto.pyz --find-links . --no-index boto
shiv! 🔪
Collecting boto
Installing collected packages: boto
Successfully installed boto-2.48.0
done
$ ./boto.pyz
Python 3.6.1 (default, Apr 19 2017, 21:58:41)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import boto
>>>
```

### installing

You can install shiv via `pip` / `pypi`

```sh
pip install shiv
```

You can even create a pyz _of_ shiv _using_ shiv!

```sh
python3 -m venv shiv
source shiv/bin/activate
pip install shiv
shiv -c shiv -o shiv shiv
```

### developing

We'd love contributions! Getting bootstrapped to develop is easy:

```sh
git clone git@github.com:linkedin/shiv.git
cd shiv
python3 setup.py venv
. activate
python3 setup.py develop
```

Don't forget to run and write tests:

```sh
pip install tox
tox
```

### gotchas

Zipapps created with shiv are not cross-compatible with other architectures. For example, a `pyz`
file built on a Mac will only work on other Macs, likewise for RHEL, etc.

Zipapps created with shiv *will* extract themselves into `~/.shiv`, unless overridden via
`SHIV_ROOT`. If you create many utilities with shiv, you may want to occasionally clean this
directory.

---

### acknowledgements

Similar projects:

* [PEX](https://github.com/pantsbuild/pex)
* [pyzzer](https://pypi.org/project/pyzzer/#description)
* [superzippy](https://github.com/brownhead/superzippy)

Logo by Juliette Carvalho


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shiv-0.0.33.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shiv-0.0.33-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file shiv-0.0.33.tar.gz.

File metadata

  • Download URL: shiv-0.0.33.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/17.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.1

File hashes

Hashes for shiv-0.0.33.tar.gz
Algorithm Hash digest
SHA256 06fd8dabc6334584193fbb57d651211ffb0fbb8e52c00fda5111ae025e0b43f0
MD5 c27498fe9ecffa1ef7bc4d63f724d51f
BLAKE2b-256 15bfa6080aaf4bf3b3ff0ee2b8ecb881d56cf716ce9a2d73ca7b131c04e71dcc

See more details on using hashes here.

File details

Details for the file shiv-0.0.33-py3-none-any.whl.

File metadata

  • Download URL: shiv-0.0.33-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/17.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.1

File hashes

Hashes for shiv-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 65768d72f7ff1d9cf7b53434131770e07865d2eafac516cdb45c8fd7a2a5fa70
MD5 da0250135e5827142b03025e837313c8
BLAKE2b-256 0b596997785114e339b99fca125ff315ef92f4466bb0dca28cf975f853457f86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page