Skip to content

Commit

Permalink
Merge pull request #2777 from plumdog/do-not-error-if-use-2to3-is-false
Browse files Browse the repository at this point in the history
Do not error if use_2to3 is set to a false value
  • Loading branch information
jaraco committed Sep 8, 2021
2 parents b254ea7 + 00c0ef5 commit 3b549e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/2777.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Build does not fail fast when ``use_2to3`` is supplied but set to a false value.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ distutils.setup_keywords =
dependency_links = setuptools.dist:assert_string_list
test_loader = setuptools.dist:check_importable
test_runner = setuptools.dist:check_importable
use_2to3 = setuptools.dist:invalid
use_2to3 = setuptools.dist:invalid_unless_false
egg_info.writers =
PKG-INFO = setuptools.command.egg_info:write_pkg_info
requires.txt = setuptools.command.egg_info:write_requirements
Expand Down
5 changes: 4 additions & 1 deletion setuptools/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ def assert_bool(dist, attr, value):
raise DistutilsSetupError(tmpl.format(attr=attr, value=value))


def invalid(dist, attr, value):
def invalid_unless_false(dist, attr, value):
if not value:
warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
return
raise DistutilsSetupError(f"{attr} is invalid.")


Expand Down

0 comments on commit 3b549e5

Please sign in to comment.