fromsetuptoolsimportsetup,find_packagessetup(name="my-python-app",version="0.1",packages=find_packages(),entry_points={"console_scripts":["myapp=my_python_app.app:main"]},install_requires=[],# Add dependencies here if anyauthor="Your Name",description="A simple Python app",)
Source: my-python-app
Section: utils
Priority: optional
Maintainer: Your Name <your.email@example.com>
Build-Depends: debhelper (>= 9), dh-python, python3-all
Standards-Version: 4.5.0
Homepage: <optional URL>
Package: my-python-app
Architecture: all
Depends: python3 (>= 3.5), ${misc:Depends}, ${python3:Depends}
Description: A simple Python application
This is a test package for my Python app.
my-python-app (1.0-1) unstable; urgency=medium
* Initial release.
* Added feature X for better performance.
* Fixed bug in module Y.
-- John Doe <john@example.com> Mon, 17 Mar 2025 12:34:56 +0000
my-python-app (1.0-1) unstable; urgency=medium
- package name: my-python-app
- version: (1.0-1)
- 1.0: upstream (code version)
- -1: Debian version (change in the rules and control files)
- distribution:
- unstable → Default for new packages.
- stable → For official stable releases.
- testing → For testing before stable.
- experimental → For experimental features.
- urgency:
- low → No hurry.
- medium → Normal (default).
- high → Important security fixes.
- emergency → Critical fixes, immediate attention.
#!/bin/shset-e# Exit on any error# Example: Create a config directory for your Python appif["$1"="configure"];thenmkdir-p/etc/my-python-app
echo"Configuration directory created."fiexit0
#!/bin/shset-e# Exit on any error# Example: Remove the config directory on purgeif["$1"="purge"];thenif[-d/etc/my-python-app];thenrm-rf/etc/my-python-app
echo"Configuration directory removed."fifiexit0
The debian/changelog file is a required part of a Debian package. It’s a human-readable log of changes made to the package across its versions. It follows a specific format and is used by tools like dpkg and apt to display package history and determine version ordering. It’s also critical for maintaining a package in a Debian repository.
Format of debian/changelog
First Line:
my-python-app: Package name.
(0.1-1): Version (explained below).
unstable: Target distribution (e.g., unstable, stable, or a codename like bookworm).
urgency=medium: Priority of the update (e.g., low, medium, high, critical).
Change List:
Bullet points (*) describing what changed in this version.
Signature Line:
Author’s name, email, and timestamp.
What is dch?
dch (Debian CHangelog) is a command-line tool from the devscripts package that simplifies editing debian/changelog. It helps you:
dch-e
# Opens the changelog in your default editor (e.g., nano or VS Code if configured).
Versioning: What Does -[number] Mean?
The version in debian/changelog (e.g., 0.1-1) follows Debian’s versioning scheme: [upstream_version]-[debian_revision].
Upstream Version (0.1):
This is the version of your software (e.g., from setup.py in your Python project).
You increment this when you make changes to the actual code (e.g., 0.1 to 0.2 for a new feature).
Debian Revision (-1):
This is the packaging version, incremented when you change the Debian packaging (e.g., fix a bug in debian/rules or postinst) without changing the upstream code.
Example: If you release 0.1-1 and later fix a packaging issue, the next version would be 0.1-2.
Rules for the - and Number
1234
Initial Release: Start with -1 (e.g., 0.1-1).
Packaging Changes Only: Keep the upstream version the same and increment the revision (e.g., 0.1-1 → 0.1-2).
New Upstream Release: Increment the upstream version and reset the revision to -1 (e.g., 0.1-1 → 0.2-1).
No - Needed: If you’re not maintaining separate upstream and Debian versions (common for simple projects), you can omit the revision (e.g., 0.1), but including it (e.g., 0.1-1) is standard practice.
Examples
123
0.1-1: First Debian package of upstream version 0.1.
0.1-2: Second packaging attempt of upstream 0.1 (e.g., fixed a typo in debian/control).
0.2-1: New upstream version 0.2, first Debian package.