A package and CLI tool to generate RPM release fields and changelogs.
Project description
This project hosts the rpmautospec python package and command line tool, which automatically calculates release numbers and generates the changelog for RPM packages from their dist-git repository.
Dependencies:
Python >= 3.9
babel >= 2.8
pygit2 >= 1.4
rpmautospec-core >= 0.1.4
Optional dependencies:
poetry >= 1.2 (if using poetry to install)
General
The command line tool rpmautospec can calculate the release and generate the changelog from the spec file of an RPM package and its git history, as well as process that spec file into a form which can be consumed by rpmbuild, and convert traditional spec files to using these automatic features.
Running the Examples
To run the examples with the rpmautospec command line tool from this repository (as opposed to a version that may be installed system-wide), you can install it into a Python virtualenv, managed either manually or by the poetry tool. For the latter, substitute running rpmautospec by running poetry run rpmautospec below.
To install the package, run this (optionally, within an activated virtualenv):
poetry install
The examples work with the guake package. Clone its dist-git repository this way, in a location of your choice, and then change into the repository worktree:
fedpkg clone guake cd guake
Generate the Changelog
This will generate the changelog from the contents of the repository and the history:
rpmautospec generate-changelog
Calculate the Release Field Value
This will generate the numerical value for the release field from the number of commits since the Version field was last updated:
rpmautospec calculate-release
The rpmautospec Python module is not thread/multiprocess-safe
rpmautospec redefines some RPM macros when parsing spec files or expanding macros. These definitions are only relevant to the current instance of the rpm module imported in Python, they are not persistent. rpmautospec cleans those definitions when it is done by reloading the RPM configuration.
However, if another thread or process running from the same Python interpreter instance attempts to change or expand RPM macros in the meantime, the definitions might clash and the cleanup might override other changes.
In case this breaks your use case, please open an issue to discuss it. We can cooperate on some locking mechanism.
Contributing
You need to be legally allowed to submit any contribution to this project. What this means in detail is laid out in the file DCO.txt next to this file. The mechanism by which you certify this is adding a Signed-off-by trailer to git commit log messages, you can do this by using the --signoff/-s option to git commit.
—
License: MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rpmautospec-0.6.4.tar.gz.
File metadata
- Download URL: rpmautospec-0.6.4.tar.gz
- Upload date:
- Size: 106.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a3007c1c339063d8d9829a95b297f4c5086ce6f104c4c13ca59e4449f824ca4
|
|
| MD5 |
ad6d5ab62f18d4fca699eb1986341939
|
|
| BLAKE2b-256 |
9d2fe08d9c400f8ce38b7ab2f89fd352060eed0d5bfd37fdc6ec48ec46532c01
|
File details
Details for the file rpmautospec-0.6.4-py3-none-any.whl.
File metadata
- Download URL: rpmautospec-0.6.4-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6da9b96389b2cf59901b8c194ea81748756e0aa50e9f35dc111a987d5a32d7d0
|
|
| MD5 |
ce03a698b39ec6766322647beb9d6bc0
|
|
| BLAKE2b-256 |
9524ec1c99a2271ac75f2328b5ab867ffe07523613961506a7d03a0457503cd1
|