Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate bdist_rpm #2780

Merged
merged 6 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
strategy:
matrix:
python:
- pypy3
- 3.6
- 3.9
- 3.10.0-alpha - 3.10.99
- pypy3
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ docs/build
include
lib
distribute.egg-info
foo.egg-info
setuptools.egg-info
.coverage
.eggs
Expand Down
2 changes: 2 additions & 0 deletions changelog.d/1988-change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecated the ``bdist_rom`` command. Binary packages should be built as wheels instead.
hugovk marked this conversation as resolved.
Show resolved Hide resolved
-- by :user:`hugovk`
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ addopts=
--doctest-modules
--doctest-glob=pkg_resources/api_tests.txt
-r sxX
--color=yes
jaraco marked this conversation as resolved.
Show resolved Hide resolved
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
# workaround for warning pytest-dev/pytest#6178
junit_family=xunit2
Expand Down
9 changes: 9 additions & 0 deletions setuptools/command/bdist_rpm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import distutils.command.bdist_rpm as orig
import warnings

from setuptools import SetuptoolsDeprecationWarning


class bdist_rpm(orig.bdist_rpm):
Expand All @@ -11,6 +14,12 @@ class bdist_rpm(orig.bdist_rpm):
"""

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
self.run_command('egg_info')

Expand Down
27 changes: 27 additions & 0 deletions setuptools/tests/test_bdist_deprecations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""develop tests
"""
import mock
import sys

import pytest

from setuptools.dist import Distribution
from setuptools import SetuptoolsDeprecationWarning


@pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only')
@mock.patch('distutils.command.bdist_rpm.bdist_rpm')
def test_bdist_rpm_warning(distutils_cmd):
dist = Distribution(
dict(
script_name='setup.py',
script_args=['bdist_rpm'],
name='foo',
py_modules=['hi'],
)
)
dist.parse_command_line()
with pytest.warns(SetuptoolsDeprecationWarning):
dist.run_commands()

distutils_cmd.run.assert_called_once()