7.3. Using automatically generated dependencies for Python RPMs
You can automatically generate dependencies for Python RPMs by using upstream-provided metadata.
Prerequisites
-
A
specfile for the RPM exists. For more information, see A spec file description for an example Python package.
Procedure
Include one of the following directories in the resulting RPM:
-
.dist-info .egg-infoThe RPM build process automatically generates virtual
pythonX.Ydistprovides from these directories, for example:python3.12dist(pello)The Python dependency generator then reads the upstream metadata and generates runtime requirements for each RPM package using the generated
pythonX.Ydistvirtual provides. Example of a generated requirements tag:Requires: python3.12dist(requests)
-
-
Inspect the generated
Requires. -
To remove some of the generated
Requires, modify the upstream-provided metadata in the%prepsection of thespecfile. -
To disable the automatic requirements generator, include the
%{?python_disable_dependency_generator}macro above the main package’s%descriptiondeclaration.