Skip to content

📦 Install Python programs in a safe and isolated environment.

License

Notifications You must be signed in to change notification settings

julianolf/sandboxing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sandboxing

Tests

Install Python programs in a safe and isolated environment.

This script is intended to be used as an installation tool for Python programs that do not have their own installation method with dependency isolation. It uses Python's built-in modules venv and pip to create a virtual environment, install the program along with its dependencies inside that environment, and create symbolic links for the executable scripts registered in the Python package. These links are placed in the user's local bin directory, usually ~/.local/bin.

Requirements

Python 3.7+ with venv, pip, and ensurepip installed.

Most Python installations come with venv, pip, and ensurepip by default.

Usage

For a better user experience, copy the install.py script and define your package and flags directly in the code so users can omit the extra arguments after python3 -.

The examples below are for illustration purposes and can be run as-is to test the script.

Installing the latest version of cowsay from PyPI:

curl -sSf https://raw.githubusercontent.com/julianolf/sandboxing/refs/heads/main/install.py | python3 - cowsay

Installing a specific version:

curl -sSf https://raw.githubusercontent.com/julianolf/sandboxing/refs/heads/main/install.py | python3 - cowsay --version=6.0

To update a previously installed program, simply run the installation script again.

To uninstall a program:

curl -sSf https://raw.githubusercontent.com/julianolf/sandboxing/refs/heads/main/install.py | python3 - cowsay --uninstall

For more options and usage, run:

curl -sSf https://raw.githubusercontent.com/julianolf/sandboxing/refs/heads/main/install.py | python3 - --help

About

📦 Install Python programs in a safe and isolated environment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published