Skip to content

An example to show the PEX/scie-based single-file Python app packaging

License

Notifications You must be signed in to change notification settings

lablup/example-self-contained-python-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

# create a venv first
pip install pex

Independent scripts

Building pex to ship dependencies

make script-env

It creates script-env.pex file, which works like a Python executable but uses the interpreter available in the system while all dependencies in requirements.txt are included inside.

Uploading to customer sites

Copy the following files:

  • dist/script-env.pex
  • scripts/xxx.py

Executing the scripts

Assuming that the current shell has a working, compatible Python interpreter (usually the version installed by us, an indygreg build):

chmod +x dist/script-env.px
./dist/script-env.pex scripts/xxx.py

Independent executable

First, download the appropriate science binary from the scie-lift release page, and make it available via your PATH.

Then run:

make simple-curl-app

Executing the executable

It will automatically download and install the statically built Python and start:

./dist/simple-curl https://example.com

Reference

About

An example to show the PEX/scie-based single-file Python app packaging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published