1 import distutils
.command
.bdist_rpm
as orig
3 from ..warnings
import SetuptoolsDeprecationWarning
6 class bdist_rpm(orig
.bdist_rpm
):
8 Override the default bdist_rpm behavior to do the following:
10 1. Run egg_info to ensure the name and version are properly calculated.
11 2. Always run 'install' using --single-version-externally-managed to
12 disable eggs in RPM distributions.
16 SetuptoolsDeprecationWarning
.emit(
19 bdist_rpm is deprecated and will be removed in a future version.
20 Use bdist_wheel (wheel packages) instead.
22 see_url
="https://github.com/pypa/setuptools/issues/1988",
23 due_date
=(2023, 10, 30), # Deprecation introduced in 22 Oct 2021.
26 # ensure distro name is up-to-date
27 self
.run_command('egg_info')
29 orig
.bdist_rpm
.run(self
)
31 def _make_spec_file(self
):
32 spec
= orig
.bdist_rpm
._make
_spec
_file
(self
)
36 "setup.py install --single-version-externally-managed ",
37 ).replace("%setup", "%setup -n %{name}-%{unmangled_version}")