Skip to main content

Build Linux deb installers from a pipenv program.

Allows Linux deb installers to be built from python applications that use pipenv.

Installing pipenv2deb

To install pipenv2deb run the following command on a debian based (E.G Ubuntu, Debian etc) Linux computer.

sudo python3 -m pip install .

Note

  • python3 must start a python version >= 3.8.
  • sudo must be used to install pipenv2deb as to generate a deb file the pipenv2deb command must be executed as root. Therefore pipenv2deb cannot be placed under ~/.local/ which is the case if sudo is not used.

Using pipenv2deb

To use the pipenv2deb tool run the 'sudo python3 -m pipenv2deb' command in a folder containing the following.

  • Pipfile This defines the environment that you program or programs will execute in. (See https://realpython.com/what-is-pip/ for more information on pip).
  • debian: A folder containing the debian build files as detailed below (required).
               control:  The debian config file (required).
               preinst:  Script executed before installation (optional).
               postinst: Script executed after installation (optional).
               prerm:    Script executed before removal (optional).
               postrm:   Script executed after removal (optional).

See https://www.debian.org/doc/manuals/debian-faq/pkg-basics.en.html for more information on these files.

Other folders are optional

  • root-fs: Contains files/folders to be copied into the root of the destination file system.

  • init.d: Contains startup script file/s to be installed into /etc/init.d (optional). To auto start these on install the postinst script must start the service.

Any other folder name (optional) that is not debian, packages, build or .venv is copied to the package folder unless an exclude_folder_list.txt file exists. If this file exists then each line should detail folder that is to be excluded.

Folders that are installed will typically be python modules that are required by your application.

If the create_pip_env.sh file is not present in the top level folder then it is created. This script is copied to the target system in order to create the virtual python environment during installation.

Finally there should be at least one python file with a main entry point (required).

Examples

The https://github.com/pjaos/pipenv2deb/tree/master/examples folder provides examples of how to use pipenv2deb.

Command line help

Run the 'sudo python3 -m pipenv2deb -h' command (once pipenv2deb is installed) for command line help as shown below.

Build deb Linux install packages from a python pipenv environment.

This command must be executed in a folder containing.
Pipfile       The pipenv Pilefile (required).
<python file> At least one python file with a main entry point (required).
debian:       A folder containing the debian build files as detailed below (required).
              control:  The debian config file (required).
              preinst:  Script executed before installation (optional).
              postinst: Script executed after installation (optional).
              prerm:    Script executed before removal (optional).
              postrm:   Script executed after removal (optional).

 root-fs:    Contains files/folders to be copied into the root of the destination file
              system (optional).
 init.d:     Contains startup script file/s to be installed into /etc/init.d (optional).
              To auto start these on install the postinst script must start the service.

              Any other folder name (optional) that is not debian, packages, build
              or .venv is copied to the package folder unless
              a exclude_folder_list.txt file exists. If this file exists then each line should
              detail folder that is to be excluded. This folder list is in addition to those detailed above.

              Folders that are installed will typically be python modules that are required
              by your application.

The output *.deb package file is placed in the local packages folder.

Options:
  -h, --help  show this help message and exit
  --debug     Enable debugging.
  --venv      Include the .venv folder from the output deb file. This
              increases the size output deb file but ensures the virtual
              environment is copied rather than rebuilt on the target machine.
  --clean     Remove the packages output folder containing the deb installer
              files.
  --lbp       Leave build path. A debugging option to allow the 'build' folder
              to be examined after the build has completed. This 'build'
              folder is normally removed when the build is complete.
  --rpm       Produce an RPM installer as well as the debian installer.
  --tgz       Produce a TGZ installer as well as the debian installer.
  --check     Perform a 'pipenv check' before building the installer.
  --venv_oip  If this option is used the .venv folder is not placed in the
              install path. The default is for the .venv foldler to be placed
              in the install path under /usr/local/bin/<app folder name>. If
              this option is used then the default pipenv location is used
              which is typically under ~/.local/share/virtualenvs

Release files for pipenv2deb 2.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipenv2deb 2.0.7
File Size Uploaded
pipenv2deb-2.0.7.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipenv2deb 2.0.7
File Interpreter ABI Platform
pipenv2deb-2.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / pipenv2deb-2.0.7.tar.gz

Download URL pipenv2deb-2.0.7.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a18a7b674c38b79c5d317b60c4980127d923fb19d7a155508847b5edbc241f2d
BLAKE2b-256 checksum
How to use checksums
5447232124f68d4ce0aca2cb0909923852e59594a039c68011895029f9610952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release files / pipenv2deb-2.0.7-py3-none-any.whl

Download URL pipenv2deb-2.0.7-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef453ca03c5b93b0b4a4022136adfb5daa4ae96126379a7b612bec4450097841
BLAKE2b-256 checksum
How to use checksums
680b3f056fb28e59f4d76e4eb2bc7028d61f3907eba6a01552f629c006bb1dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

2.0.7 This release

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page