From patchwork Thu Jul 27 14:34:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [STABLE] setup: silence warning of unknown option python_requires on distutils From: Yuya Nishihara X-Patchwork-Id: 22564 Message-Id: <08f557c2b20e2ae98f57.1501166084@mimosa> To: mercurial-devel@mercurial-scm.org Date: Thu, 27 Jul 2017 23:34:44 +0900 # HG changeset patch # User Yuya Nishihara # Date 1501164914 -32400 # Thu Jul 27 23:15:14 2017 +0900 # Branch stable # Node ID 08f557c2b20e2ae98f57b76fcb2ea0d870cfdcba # Parent c5607b65fcb8cf5b789c49a8cf4fecfe83931727 setup: silence warning of unknown option python_requires on distutils /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires' diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -111,7 +111,8 @@ from distutils import log # We have issues with setuptools on some platforms and builders. Until # those are resolved, setuptools is opt-in except for platforms where # we don't have issues. -if os.name == 'nt' or 'FORCE_SETUPTOOLS' in os.environ: +issetuptools = (os.name == 'nt' or 'FORCE_SETUPTOOLS' in os.environ) +if issetuptools: from setuptools import setup else: from distutils.core import setup @@ -843,6 +844,8 @@ setupversion = version.decode('ascii') extra = {} +if issetuptools: + extra['python_requires'] = supportedpy if py2exeloaded: extra['console'] = [ {'script':'hg', @@ -937,5 +940,4 @@ setup(name='mercurial', 'welcome': 'contrib/macosx/Welcome.html', }, }, - python_requires=supportedpy, **extra)