Skip to content

Commit

Permalink
Emit a SetuptoolsDeprecationWarning when setup_requires is used. Ref #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Oct 22, 2021
1 parent fee9d17 commit 18b997d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions changelog.d/2823.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Officially deprecated support for ``setup_requires``. Users are encouraged instead to migrate to PEP 518 ``build-system.requires`` in ``pyproject.toml``. Users reliant on ``setup_requires`` should consider pinning to this major version to avoid disruption.
25 changes: 14 additions & 11 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
# workaround for warning pytest-dev/pytest#6178
junit_family=xunit2
filterwarnings=
# Fail on warnings
error
# Fail on warnings
error

## upstream
## upstream
# Suppress deprecation warning in flake8
ignore:SelectableGroups dict interface is deprecated::flake8
# Suppress deprecation warning in pypa/packaging#433
ignore:The distutils package is deprecated::packaging.tags
## end upstream

# https://github.com/pypa/setuptools/issues/1823
ignore:bdist_wininst command is deprecated
# Suppress this error; unimportant for CI tests
ignore:Extraction path is writable by group/others:UserWarning
# Suppress weird RuntimeWarning.
ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning
# Suppress use of bytes for filenames on Windows until fixed #2016
ignore:The Windows bytes API has been deprecated:DeprecationWarning
# https://github.com/pypa/setuptools/issues/1823
ignore:bdist_wininst command is deprecated
# Suppress this error; unimportant for CI tests
ignore:Extraction path is writable by group/others:UserWarning
# Suppress weird RuntimeWarning.
ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning
# Suppress use of bytes for filenames on Windows until fixed #2016
ignore:The Windows bytes API has been deprecated:DeprecationWarning

# https://github.com/pypa/setuptools/issues/2823
ignore:setup_requires is deprecated.
6 changes: 6 additions & 0 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import functools
import os
import re
import warnings

import _distutils_hack.override # noqa: F401

Expand Down Expand Up @@ -144,6 +145,11 @@ def finalize_options(self):
# Honor setup.cfg's options.
dist.parse_config_files(ignore_option_errors=True)
if dist.setup_requires:
warnings.warn(
"setup_requires is deprecated. Supply build "
"dependencies using PEP 517 pyproject.toml build-requires.",
SetuptoolsDeprecationWarning,
)
dist.fetch_build_eggs(dist.setup_requires)


Expand Down

0 comments on commit 18b997d

Please sign in to comment.