# HG changeset patch # User Yuya Nishihara # Date 2017-07-27 14:15:14 # Node ID 47829b89c8c6ccaab6916ec0fa34880f114a58f0 # Parent cfa08b06d8b5c4de525cbd38d1f41bdd7cbc4083 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 @@ -847,6 +848,8 @@ setupversion = version.decode('ascii') extra = {} +if issetuptools: + extra['python_requires'] = supportedpy if py2exeloaded: extra['console'] = [ {'script':'hg', @@ -946,5 +949,4 @@ setup(name='mercurial', 'welcome': 'contrib/macosx/Welcome.html', }, }, - python_requires=supportedpy, **extra)