Coder Social home page Coder Social logo

warsaw / shiv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linkedin/shiv

0.0 1.0 0.0 239 KB

shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441, but with all their dependencies included.

License: BSD 2-Clause "Simplified" License

Python 99.96% Shell 0.04%

shiv's Introduction

pypi ci codecov docs license supported

snake

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!

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

๐Ÿ“— Full documentation can be found here.

sys requirements

  • python3.6+
  • linux/osx/windows

quickstart

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 flake8 with shiv:

$ shiv -c flake8 -o ~/bin/flake8 flake8
$ ~/bin/flake8 --version
3.7.8 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.4 on Darwin

Creating an interactive executable with the boto library:

$ shiv -o boto.pyz boto
Collecting boto
Installing collected packages: boto
Successfully installed boto-2.49.0
$ ./boto.pyz
Python 3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:54:52)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import boto
>>> boto.__version__
'2.49.0'

installing

You can install shiv by simply downloading a release from https://github.com/linkedin/shiv/releases or via pip / pypi:

pip install shiv

You can even create a pyz of shiv using shiv!

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

developing

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

git clone [email protected]:linkedin/shiv.git
cd shiv
python3 -m venv venv
source ./venv/bin/activate
python3 setup.py develop

Don't forget to run and write tests:

python3 -m pip install tox
tox

To build documentation when you changed something in docs:

python3 -m pip install -r docs/requirements.txt
sphinx-build docs build/html

gotchas

Zipapps created with shiv are not guaranteed to be cross-compatible with other architectures. For example, a pyz file built on a Mac may only work on other Macs, likewise for RHEL, etc. This usually only applies to zipapps that have C extensions in their dependencies. If all your dependencies are pure python, then chances are the pyz will work on other platforms. Just something to be aware of.

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:

Logo by Juliette Carvalho

shiv's People

Contributors

lorencarvalho avatar anthrotype avatar jhermann avatar ipmb avatar dsully avatar pfmoore avatar bzzzzzz avatar htp84 avatar itamarst avatar luislew avatar jeis2497052 avatar jayvdb avatar loganrosen avatar tekumara avatar rsalmaso avatar timgates42 avatar jmrgibson avatar yhlam avatar devxpy avatar dhermes avatar dchimeno avatar cclauss avatar chriscarini avatar agargiulo avatar rouge8 avatar akrk1986 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.