setup.py
changeset 46483 16c18d5e5dc8
parent 46441 cabc5e9366c5
parent 46354 ed43b6fa847e
child 46564 866eb4d6bd9f
equal deleted inserted replaced
46482:892eb7c5edaa 46483:16c18d5e5dc8
  1698     'mercurial.cext',
  1698     'mercurial.cext',
  1699     #'mercurial.cffi',
  1699     #'mercurial.cffi',
  1700     'mercurial.pure',
  1700     'mercurial.pure',
  1701 ]
  1701 ]
  1702 
  1702 
       
  1703 py2exe_includes = []
       
  1704 
  1703 py2exeexcludes = []
  1705 py2exeexcludes = []
  1704 py2exedllexcludes = ['crypt32.dll']
  1706 py2exedllexcludes = ['crypt32.dll']
  1705 
  1707 
  1706 if issetuptools:
  1708 if issetuptools:
  1707     extra['python_requires'] = supportedpy
  1709     extra['python_requires'] = supportedpy
  1708 
  1710 
  1709 if py2exeloaded:
  1711 if py2exeloaded:
  1710     extra['console'] = [
  1712     extra['console'] = [
  1711         {
  1713         {
  1712             'script': 'hg',
  1714             'script': 'hg',
  1713             'copyright': 'Copyright (C) 2005-2020 Matt Mackall and others',
  1715             'copyright': 'Copyright (C) 2005-2021 Matt Mackall and others',
  1714             'product_version': version,
  1716             'product_version': version,
  1715         }
  1717         }
  1716     ]
  1718     ]
  1717     # Sub command of 'build' because 'py2exe' does not handle sub_commands.
  1719     # Sub command of 'build' because 'py2exe' does not handle sub_commands.
  1718     # Need to override hgbuild because it has a private copy of
  1720     # Need to override hgbuild because it has a private copy of
  1725     # variables. This is better than setup.cfg files because it allows
  1727     # variables. This is better than setup.cfg files because it allows
  1726     # supplementing configs instead of replacing them.
  1728     # supplementing configs instead of replacing them.
  1727     extrapackages = os.environ.get('HG_PY2EXE_EXTRA_PACKAGES')
  1729     extrapackages = os.environ.get('HG_PY2EXE_EXTRA_PACKAGES')
  1728     if extrapackages:
  1730     if extrapackages:
  1729         py2exepackages.extend(extrapackages.split(' '))
  1731         py2exepackages.extend(extrapackages.split(' '))
       
  1732 
       
  1733     extra_includes = os.environ.get('HG_PY2EXE_EXTRA_INCLUDES')
       
  1734     if extra_includes:
       
  1735         py2exe_includes.extend(extra_includes.split(' '))
  1730 
  1736 
  1731     excludes = os.environ.get('HG_PY2EXE_EXTRA_EXCLUDES')
  1737     excludes = os.environ.get('HG_PY2EXE_EXTRA_EXCLUDES')
  1732     if excludes:
  1738     if excludes:
  1733         py2exeexcludes.extend(excludes.split(' '))
  1739         py2exeexcludes.extend(excludes.split(' '))
  1734 
  1740 
  1825     distclass=hgdist,
  1831     distclass=hgdist,
  1826     options={
  1832     options={
  1827         'py2exe': {
  1833         'py2exe': {
  1828             'bundle_files': 3,
  1834             'bundle_files': 3,
  1829             'dll_excludes': py2exedllexcludes,
  1835             'dll_excludes': py2exedllexcludes,
       
  1836             'includes': py2exe_includes,
  1830             'excludes': py2exeexcludes,
  1837             'excludes': py2exeexcludes,
  1831             'packages': py2exepackages,
  1838             'packages': py2exepackages,
  1832         },
  1839         },
  1833         'bdist_mpkg': {
  1840         'bdist_mpkg': {
  1834             'zipdist': False,
  1841             'zipdist': False,