Path: blob/main/test/lib/python3.9/site-packages/setuptools/command/bdist_rpm.py
4799 views
import distutils.command.bdist_rpm as orig1import warnings23from setuptools import SetuptoolsDeprecationWarning456class bdist_rpm(orig.bdist_rpm):7"""8Override the default bdist_rpm behavior to do the following:9101. Run egg_info to ensure the name and version are properly calculated.112. Always run 'install' using --single-version-externally-managed to12disable eggs in RPM distributions.13"""1415def run(self):16warnings.warn(17"bdist_rpm is deprecated and will be removed in a future "18"version. Use bdist_wheel (wheel packages) instead.",19SetuptoolsDeprecationWarning,20)2122# ensure distro name is up-to-date23self.run_command('egg_info')2425orig.bdist_rpm.run(self)2627def _make_spec_file(self):28spec = orig.bdist_rpm._make_spec_file(self)29spec = [30line.replace(31"setup.py install ",32"setup.py install --single-version-externally-managed "33).replace(34"%setup",35"%setup -n %{name}-%{unmangled_version}"36)37for line in spec38]39return spec404142