Skip to main content

Debmutate is a set of Python modules for manipulating the control files of Debian packages, with the ability to preserve the existing formatting of the control files.

It's built on top of the excellent python-debian library, and was originally extracted from lintian-brush.

To modify one of the control files, use one of the context managers to edit the file.

For example, for debian/control:

from debmutate.control import ControlEditor

with ControlEditor(path='debian/control') as control:
    print(control.source['Maintainer'])
    control.source['Maintainer'] = "Jelmer Vernooij <jelmer@debian.org>"

Or for debian/changelog:

from debmutate.changelog import ChangelogEditor

with ChangelogEditor(path='debian/changelog') as editor:
   editor.add_entry(['Some entry'])

Once you leave the context manager, the changes will be written to disk if there were any. If the editor is unable to preserve the formatting of the control file, it will raise a FormattingUnpreservable error.

If the control file that was edited was generated from another control file (e.g. debian/control.in), debmutate will attempt to update that file instead and then regenerate debian/control. If it is unable to do so, it will raise a GeneratedFile exception.

The file will be left as-is if an exception is raised, or if the .cancel() method is called.

debmutate currently provides editors for the following control files:

  • debian/changelog
  • debian/copyright
  • debian/control
  • debian/patches/series
  • debian/tests/control
  • debian/watch
  • debian/maintscripts, debian/*.maintscripts
  • debian/source/lintian-overrides, debian/*.lintian-overrides
  • debian/debcargo.toml

Metadata

Release files for debmutate 0.75

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

Source distribution (sdist)

Source distribution for debmutate 0.75
File Size Uploaded
debmutate-0.75.tar.gz 83.9 kB Details

Release files / debmutate-0.75.tar.gz

Download URL debmutate-0.75.tar.gz
Size 83.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e40f49a9fb4719c0c12028f59c959fddc94cee26476e73905c5aa75acd0d1a06
BLAKE2b-256 checksum
How to use checksums
66dca455e41c0177637c97d52f489987ad33b426b0077e006650642d02f724e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.9

Release history Release notifications | RSS feed

0.82

1 release file

This release

0.75 This release

1 release file

0.69

1 release file

0.66

1 release file

0.61

1 release file

0.59

1 release file

0.58

1 release file

0.57

1 release file

0.35

1 release file

0.30

1 release file

0.20

1 release file

0.19

1 release file

0.15

1 release file

0.10

1 release file

0.1

1 release file

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