Skip to content
limafreshPublic

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

CTkDeb

Static Badge Static Badge

A CustomTkinter app for easily packaging CustomTkinter, Tkinter, and other Python GUI projects into DEB and RPM packages for Linux. It has GUI, CLI, and Python modes. You can create a small DEB or RPM package without deep packaging experience.

Install

pip install CTkDeb[gui]
  • Creating DEB packages requires the dpkg-deb tool (pre-installed on most Debian-like systems, probably does not need to be installed separately).
  • Creating RPM packages requires the rpmbuild tool.

Run

Run this in the project folder (relative to which the paths in the config are specified)

ctkdeb-gui

GUI

Screenshot

CLI

ctkdeb config.json --create deb

View all arguments:

ctkdeb --help

Python

from ctkdeb import Packager

packager = Packager("config.json")
packager.create_deb()
# or
packager.create_rpm("fedora")

View all supported RPM distros:

from ctkdeb import show_supported_rpm_distros
show_supported_rpm_distros()

Arguments:

Argument Type Description
json_path str or dict Path to the JSON config (or its dict), required
project_folder str Path to the project folder (if the command is not executed from it)
desktop_entry str Path to the custom desktop entry (or its text)
output_folder str Path to the output folder

Good to know

Tip

Specifying pip dependencies is only recommended if they are written in pure Python (e.g. CTkMenuBar). If not, it's better to search for the required dependency in the distribution repositories and specify it as a DEB or RPM dependency. For example, for Pillow, specify python3-pil for DEB or python3-pillow for RPM (Fedora/Mageia) instead of pillow in the "Pip dependencies" line.

FAQ

Do I need to specify Python and GUI toolkits as dependencies?

In any case, you don't need to specify Python; the tool will do it for you. If your project's GUI toolkit is among the available options in the "Project type" field, and you select that option, you do not need to specify the GUI toolkit either.

Can I use CTkDeb to package PyQt projects?

Yes, but you will have to find the correct names for the PyQt packages yourself and specify them in the dependencies. In "Project type" select "Other GUI".

Can the tool be run on Windows?

You can run it (for example, to create a config), but you cannot create packages on Windows.

Other

App icon: Claude Sonnet 5 (with modifications by Claude Sonnet 5.5).