Skip to main content

Python SHIV-version, which creates user owned directires if SHIV_ROOT is used.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

pypi license supported

snake

shiv-userdirs

Project Status: Archived

This fork was created to work around a limitation in the original linkedin/shiv: when SHIV_ROOT pointed to a shared directory, shiv would extract into that directory without any per-user isolation. This caused permission problems in multi-user environments — especially for service accounts without a writable home directory. The workaround creates a user-owned subdirectory (<SHIV_ROOT>/<uid>/, chmod 700) so that each user has an isolated extraction path.

The projects that relied on this fork have since been migrated to AppImage deployment using ssh-mitm/appimage (PyPI), so this package is no longer maintained. It is published to PyPI for archival purposes only.

If you need continued development or have a use case for this approach, feel free to reach out to Manfred Kaiser or open an issue on GitHub.

Python SHIV-version, which creates user-owned directories if SHIV_ROOT is used.

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

-c flake8 specifies the console script that should be invoked when the executable runs, -o ~/bin/flake8 specifies the location of the generated executable file and flake8 is the dependency that should be installed from PyPI.

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

pip install shiv-userdirs

You can even create a pyz of shiv using shiv!

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

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

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_userdirs-1.0.5.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

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

shiv_userdirs-1.0.5-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file shiv_userdirs-1.0.5.tar.gz.

File metadata

  • Download URL: shiv_userdirs-1.0.5.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shiv_userdirs-1.0.5.tar.gz
Algorithm Hash digest
SHA256 6f94d39c40a13fada214bdf84668a9e3037da9d38d6be7f5d3ee00b1a88c23e3
MD5 c6e9a71cd8d5da90db396fdb1df70836
BLAKE2b-256 4e3c4739ea9035b6c16b402caf13133539b4e7b99829ed8d92cd3635bdbd8197

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiv_userdirs-1.0.5.tar.gz:

Publisher: publish.yml on manfred-kaiser/shiv-userdirs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shiv_userdirs-1.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: shiv_userdirs-1.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shiv_userdirs-1.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d78d264b1aa6ef9649967cc8ab22fbd2ca530d27ef18458dd19c2e53c6b635a8
MD5 7e4512c6f87d4d4f10eaaf344641104d
BLAKE2b-256 c73339e7488be31c233e1e8575193a3841b6dcf702d23e0882ddbb960625f208

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiv_userdirs-1.0.5-py2.py3-none-any.whl:

Publisher: publish.yml on manfred-kaiser/shiv-userdirs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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