def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') requirements = ["zope.interface >= 3.6.0"] from twisted.python.dist import (STATIC_PACKAGE_METADATA, getExtensions, getScripts, setup, _EXTRAS_REQUIRE) setup_args = STATIC_PACKAGE_METADATA.copy() setup_args.update( dict( packages=setuptools.find_packages(), install_requires=requirements, conditionalExtensions=getExtensions(), scripts=getScripts(), include_package_data=True, zip_safe=False, extras_require=_EXTRAS_REQUIRE, )) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') if sys.version_info[0] >= 3: requirements = ["zope.interface >= 4.0.2"] else: requirements = ["zope.interface >= 3.6.0"] from twisted.python.dist import (STATIC_PACKAGE_METADATA, getExtensions, getConsoleScripts, setup, _EXTRAS_REQUIRE) setup_args = STATIC_PACKAGE_METADATA.copy() setup_args.update( dict( packages=setuptools.find_packages(), install_requires=requirements, conditionalExtensions=getExtensions(), entry_points={'console_scripts': getConsoleScripts()}, include_package_data=True, zip_safe=False, extras_require=_EXTRAS_REQUIRE, )) if sys.version_info[0] >= 3: setup_args.update(dict(cmdclass={ 'build_py': PickyBuildPy, })) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') requirements = ["zope.interface >= 3.6.0"] from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getExtensions, getScripts, setup, _EXTRAS_REQUIRE) setup_args = STATIC_PACKAGE_METADATA.copy() setup_args.update(dict( packages=setuptools.find_packages(), install_requires=requirements, conditionalExtensions=getExtensions(), scripts=getScripts(), include_package_data=True, zip_safe=False, extras_require=_EXTRAS_REQUIRE, )) setup(**setup_args)
def main(): # Make sure the to-be-installed version of Twisted is used, if available, # since we're importing from it: if os.path.exists('twisted'): sys.path.insert(0, '.') from twisted.python.dist import (STATIC_PACKAGE_METADATA, getExtensions, getScripts, setup) args = STATIC_PACKAGE_METADATA.copy() args.update( dict( cmdclass={ 'build_py': PickyBuildPy, 'build_scripts': PickyBuildScripts, }, packages=find_packages(), conditionalExtensions=getExtensions(), install_requires=["zope.interface >= 4.0.2"], zip_safe=False, include_package_data=True, scripts=getScripts(), )) setup(**args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') from twisted import copyright from twisted.python.dist import getDataFiles, getExtensions, getScripts, \ getPackages, setup, twisted_subprojects # "" is included because core scripts are directly in bin/ projects = [''] + [x for x in os.listdir('bin') if os.path.isdir(os.path.join("bin", x)) and x in twisted_subprojects] scripts = [] for i in projects: scripts.extend(getScripts(i)) setup_args = dict( # metadata name="Twisted", version=copyright.version, description="An asynchronous networking framework written in Python", author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", maintainer_email="*****@*****.**", url="http://twistedmatrix.com/", license="MIT", long_description="""\ An extensible framework for Python programming, with special focus on event-based network programming and multiprotocol integration. """, packages = getPackages('twisted'), conditionalExtensions = getExtensions(), scripts = scripts, data_files=getDataFiles('twisted'), classifiers=[ "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", ]) if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface"] try: list(parse_requirements(requirements)) except: print """You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """ else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') from twisted import copyright from twisted.python.dist import getDataFiles, getExtensions, getScripts, \ getPackages, setup, twisted_subprojects # "" is included because core scripts are directly in bin/ projects = [''] + [x for x in os.listdir('bin') if os.path.isdir(os.path.join("bin", x)) and x in twisted_subprojects] scripts = [] for i in projects: scripts.extend(getScripts(i)) setup_args = dict( # metadata name="Twisted", version=copyright.version, description="An asynchronous networking framework written in Python", author="Twisted Matrix Laboratories", author_email="*****@*****.**", maintainer="Glyph Lefkowitz", maintainer_email="*****@*****.**", url="http://twistedmatrix.com/", license="MIT", long_description="""\ An extensible framework for Python programming, with special focus on event-based network programming and multiprotocol integration. """, packages = getPackages('twisted'), conditionalExtensions = getExtensions(), scripts = scripts, data_files=getDataFiles('twisted'), classifiers=[ "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", ]) if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists("twisted"): sys.path.insert(0, ".") setup_args = {} if "setuptools" in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print( """You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """ ) else: setup_args["install_requires"] = requirements setup_args["include_package_data"] = True setup_args["zip_safe"] = False from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup, _EXTRAS_REQUIRE, ) scripts = getAllScripts() setup_args.update( dict( packages=getPackages("twisted"), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles("twisted"), **STATIC_PACKAGE_METADATA ) ) setup(**setup_args)
def assertExtensions(self, expected): """ Assert that the given names match the (sorted) names of discovered extensions. """ extensions = dist.getExtensions() names = [extension.name for extension in extensions] self.assertEqual(sorted(names), expected)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ # On Python 3, use setup3.py until Python 3 port is done: if sys.version_info[0] > 2: import setup3 setup3.main() return if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import (STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup, _EXTRAS_REQUIRE) scripts = getAllScripts() setup_args.update( dict(packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, extras_require=_EXTRAS_REQUIRE, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
def main(args): """ Invoke twisted.python.dist with the appropriate metadata about the Twisted package. """ if os.path.exists('twisted'): sys.path.insert(0, '.') setup_args = {} if 'setuptools' in sys.modules: from pkg_resources import parse_requirements requirements = ["zope.interface >= 3.6.0"] try: list(parse_requirements(requirements)) except: print("""You seem to be running a very old version of setuptools. This version of setuptools has a bug parsing dependencies, so automatic dependency resolution is disabled. """) else: setup_args['install_requires'] = requirements setuptools._TWISTED_NO_CHECK_REQUIREMENTS = True setup_args['include_package_data'] = True setup_args['zip_safe'] = False from twisted.python.dist import ( STATIC_PACKAGE_METADATA, getDataFiles, getExtensions, getAllScripts, getPackages, setup) scripts = getAllScripts() setup_args.update(dict( packages=getPackages('twisted'), conditionalExtensions=getExtensions(), scripts=scripts, data_files=getDataFiles('twisted'), **STATIC_PACKAGE_METADATA)) setup(**setup_args)
def test_initgroups(self): """ If C{os.initgroups} is present (Python 2.7 and Python 3.3 and newer), L{twisted.python._initgroups} is not returned as an extension to build from L{getExtensions}. """ extensions = getExtensions() found = None for extension in extensions: if extension.name == "twisted.python._initgroups": found = extension if sys.version_info[:2] >= (2, 7): self.assertIdentical( None, found, "Should not have found twisted.python._initgroups extension " "definition.") else: self.assertNotIdentical( None, found, "Should have found twisted.python._initgroups extension " "definition.")