Skip to main content

A tool to produce a deb installer for a python projects that use pipenv.

Project description

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

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

pipenv2deb-2.0.7.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

pipenv2deb-2.0.7-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file pipenv2deb-2.0.7.tar.gz.

File metadata

  • Download URL: pipenv2deb-2.0.7.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pipenv2deb-2.0.7.tar.gz
Algorithm Hash digest
SHA256 a18a7b674c38b79c5d317b60c4980127d923fb19d7a155508847b5edbc241f2d
MD5 034ce7a0192f80d68293085a6983fd2c
BLAKE2b-256 5447232124f68d4ce0aca2cb0909923852e59594a039c68011895029f9610952

See more details on using hashes here.

File details

Details for the file pipenv2deb-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: pipenv2deb-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pipenv2deb-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ef453ca03c5b93b0b4a4022136adfb5daa4ae96126379a7b612bec4450097841
MD5 0d4a5c42c3d452b4f763b749ad35dfdc
BLAKE2b-256 680b3f056fb28e59f4d76e4eb2bc7028d61f3907eba6a01552f629c006bb1dab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page