up
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from ..dist import Distribution
|
||||
from ..warnings import SetuptoolsDeprecationWarning
|
||||
|
||||
import distutils.command.bdist_rpm as orig
|
||||
import warnings
|
||||
|
||||
from setuptools import SetuptoolsDeprecationWarning
|
||||
|
||||
|
||||
class bdist_rpm(orig.bdist_rpm):
|
||||
@@ -13,17 +13,11 @@ class bdist_rpm(orig.bdist_rpm):
|
||||
disable eggs in RPM distributions.
|
||||
"""
|
||||
|
||||
distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
|
||||
|
||||
def run(self) -> None:
|
||||
SetuptoolsDeprecationWarning.emit(
|
||||
"Deprecated command",
|
||||
"""
|
||||
bdist_rpm is deprecated and will be removed in a future version.
|
||||
Use bdist_wheel (wheel packages) instead.
|
||||
""",
|
||||
see_url="https://github.com/pypa/setuptools/issues/1988",
|
||||
due_date=(2023, 10, 30), # Deprecation introduced in 22 Oct 2021.
|
||||
def run(self):
|
||||
warnings.warn(
|
||||
"bdist_rpm is deprecated and will be removed in a future "
|
||||
"version. Use bdist_wheel (wheel packages) instead.",
|
||||
SetuptoolsDeprecationWarning,
|
||||
)
|
||||
|
||||
# ensure distro name is up-to-date
|
||||
@@ -33,10 +27,14 @@ class bdist_rpm(orig.bdist_rpm):
|
||||
|
||||
def _make_spec_file(self):
|
||||
spec = orig.bdist_rpm._make_spec_file(self)
|
||||
return [
|
||||
spec = [
|
||||
line.replace(
|
||||
"setup.py install ",
|
||||
"setup.py install --single-version-externally-managed ",
|
||||
).replace("%setup", "%setup -n %{name}-%{unmangled_version}")
|
||||
"setup.py install --single-version-externally-managed "
|
||||
).replace(
|
||||
"%setup",
|
||||
"%setup -n %{name}-%{unmangled_version}"
|
||||
)
|
||||
for line in spec
|
||||
]
|
||||
return spec
|
||||
|
||||
Reference in New Issue
Block a user